Sunday, April 3, 2016

Oracle – New DBID Post-Clone Task

Oracle – New DBID Post-Clone Task

After a clone it is sometimes necessary to change the dbid (particularly when not using RMAN). Therefore you need to perform the following:

$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Jun 29 11:36:36 2011
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.
Total System Global Area  264241152 bytes
Fixed Size                  2072056 bytes
Variable Size              88080904 bytes
Database Buffers          167772160 bytes
Redo Buffers                6316032 bytes
Database mounted.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64
With the Partitioning and Data Mining options

$ nid TARGET=/
DBNEWID: Release 10.2.0.3.0 - Production on Wed Jun 29 11:37:11 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to database SAWTST1 (DBID=1067814800)
Connected to server version 10.2.0
Control Files in database:
/sawtst1/ctrl1/sawtst1_01.ctl
/sawtst1/ctrl2/sawtst1_02.ctl
Change database ID of database SAWTST1? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 1067814800 to 2196809383
Control File /sawtst1/ctrl1/sawtst1_01.ctl - modified
Control File /sawtst1/ctrl2/sawtst1_02.ctl - modified
Datafile /sawtst1/system/system_01.dbf - dbid changed
Datafile /sawtst1/undo/undotbs_01.dbf - dbid changed
Datafile /sawtst1/system/sysaux_01.dbf - dbid changed
Datafile /sawtst1/oradata/users_01.dbf - dbid changed
Datafile /sawtst1/oradata/data_01.dbf - dbid changed
Datafile /sawtst1/oradata/data_02.dbf - dbid changed
Datafile /sawtst1/oradata/data_03.dbf - dbid changed
Datafile /sawtst1/oradata/indexes_01.dbf - dbid changed
Datafile /sawtst1/oradata/indexes_02.dbf - dbid changed
Datafile /sawtst1/oradata/csmig_01.dbf - dbid changed
Datafile /sawtst1/oradata/cm_rem_ts_01.dbf - dbid changed
Datafile /sawtst1/temp/temp_01.dbf - dbid changed
Control File /sawtst1/ctrl1/sawtst1_01.ctl - dbid changed
Control File /sawtst1/ctrl2/sawtst1_02.ctl - dbid changed
Instance shut down
Database ID for database SAWTST1 changed to 2196809383.
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.

$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Jun 29 11:37:40 2011
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to an idle instance.

SQL> startup mount
ORACLE instance started.
Total System Global Area  264241152 bytes
Fixed Size                  2072056 bytes
Variable Size              88080904 bytes
Database Buffers          167772160 bytes
Redo Buffers                6316032 bytes
Database mounted.

SQL> alter database open resetlogs;
Database altered.

No comments:

Post a Comment