Ways to find Out DBID of Oracle Database in 11gR2

DBID stands for database identifier which is a unique identifier for each oracle database running in your server. DBID information is found in control files as well as datafile header.

If the database is up and running then DBID can be found from v$database or while connecting to rman target /

1.. If Oracle Database is up and running then connect rman then along with database name you will find DBID of the database or using v$database DBID can be found.

100.png

2.. If configure control file auto backup is on and Format %F is set then while taking backup of control file it will print DBID of database.

%F Combines the DBID, day, month, year, and sequence into a unique and repeatable generated name .

101.png

102.png

3.. Printing DBID in alert log file using package DBMS.SYSTEM

where ksdwrt is used to write messages to the alertlog or trace files.

EXEC DBMS_System.ksdwrt(n, message);

EXEC DBMS_System.ksdwrt(2, ‘DBID’); Where the value of “n” indicates the destination and could be as follows.

a.. trace file

b.. alertlog

c.. both

104.png

Once procedure is completed successfully grep DBID from alert log.

105.png

4.. Dumping DBID to dump file using SYSAUX datafile

106.png

Once database is started in nomount mode using alter system dump datafile dump DBID to trace file.

107.png

To get information navigate to USER_DUMP_DEST and search for recently created trace file for database and using grep find out DBID of Database.

108.png

Note :- Other then SYSAUX datafile other datafile can be also used like users01.dbf

5.. Dumping DBID to dump file using redo log files.

Again start database in nomount mode using any of redo log file dump DB ID to dump file in under trace file directory.

110

111.png

6.. Few Test Cases when DBID is not set and set and restoring control file from autobackup and backup of control file.

6.1.. If DBID is not set while doing restore of control file and control file is restored from autobackup then AUTOBACKUP search with format “%F” will not attempted because DBID was not set.

112.png

6.2.. If DBID is set then AUTOBACKUP search with format “%F” is attempted because DBID was set And control file will be restored from autobackup as given below.

113.png

6.3.. And if DBID is not set and you are doing restore of control file from backup of control file then it will restore control file from backup of control file only.

114.png

Happy Learning !!!!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s