You are on page 1of 2

Changing DB ID for the Oracle Database

When you clone the database, the DB ID remains same as like the source database,
if you need to change to the different DB ID, then this note will be useful. Th
is is very much useful as in the case of working with RMAN.
Follow the below steps to change the DB ID in Oracle10g and Oracle11g databases:
1. Identify the DBID of the database
SQL> select dbid from v$database;
DBID
1272957858
2. Shutdown the database in normal mode
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
3. Start the database to mount phase
SQL> startup mount
ORACLE instance started.
Total System Global Area
150667264 bytes
Fixed Size
1335080 bytes
Variable Size
92274904 bytes
Database Buffers
50331648 bytes
Redo Buffers
6725632 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Prod
uction
With the Partitioning, OLAP, Data Mining and Real Application Testing options
4. In the Terminal Window, execute the nid command
[oracle@apps ~]$ which nid
/u01/app/oracle/product/11.2.0/dbhome_1/bin/nid
[oracle@apps ~]$ nid target=/
DBNEWID: Release 11.2.0.1.0 Production on Fri Mar 25 16:32:17 2011
Copyright (C) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to database RC (DBID=1272957858)
Connected to server version 11.2.0
Control Files in database:
/u01/app/oracle/oradata/rc/control01.ctl
/u01/app/oracle/oradata/rc/control02.ctl
Change database ID of database RC? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 1272957858 to 2943969233
Control File /u01/app/oracle/oradata/rc/control01.ctl
modified
Control File /u01/app/oracle/oradata/rc/control02.ctl modified
Datafile /u01/app/oracle/oradata/rc/system01.db dbid changed
Datafile /u01/app/oracle/oradata/rc/sysaux01.db dbid changed
Datafile /u01/app/oracle/oradata/rc/undotbs01.db dbid changed
Datafile /u01/app/oracle/oradata/rc/def_perm01.db
dbid changed
Control File /u01/app/oracle/oradata/rc/control01.ctl
dbid changed
Control File /u01/app/oracle/oradata/rc/control02.ctl dbid changed
Instance shut down
Database ID for database RC changed to 2943969233.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID Completed succesfully.
5. Bounce back the database to mount phase
[oracle@apps ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 25 16:33:14 2011
Copyright (C) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance. SQL> 7. SQL> startup mount ORACLE instance started. Identify the new changed DBID SQL> select dbid from v$database. Database altered. DBID 2943969233 . Open the database with resetlog option SQL> alter database open resetlogs . Total System Global Area 150667264 bytes Fixed Size 1335080 bytes Variable Size 92274904 bytes Database Buffers 50331648 bytes Redo Buffers 6725632 bytes Database mounted. 6.