jump to navigation

Changing DBID…………. December 28, 2009

Posted by sendtoshailesh in Uncategorized.
trackback

Well…….. Changing DBID in Oracle Database is not a big deal, however its very rare to do so. My intention is to just write this to have a ready reference at any time to confirm the steps to perform the Change of DBID.

Sometime I think that when it is desperately needed. Only one situation when DB is cloned in a way that it DBID remains same and we want to register both DB in single repository of RMAN. I think there there is no other solution to do that. I would be very happy if someone add some more situations where it is desperately needed.

Following are the steps to do:

1) Mount the database
SQL> startup mount
ORACLE instance started.

Total System Global Area 481267712 bytes
Fixed Size 1300716 bytes
Variable Size 226494228 bytes
Database Buffers 247463936 bytes
Redo Buffers 6008832 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

2) Run the nid tool from os prompt.
[oracle@zoomer ~]$ nid target = /

DBNEWID: Release 11.1.0.6.0 – Production on Thu Dec 24 20:05:44 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to database orcl (DBID=3682169720)

Connected to server version 11.1.0

Control Files in database:
/u01/app/oracle/oradata/orcl/control01.ctl
/u01/app/oracle/oradata/orcl/control02.ctl
/u01/app/oracle/oradata/orcl/control03.ctl

Change database ID of database orcl? (Y/[N]) => y

Proceeding with operation
Changing database ID from 3682169720 to 3682222232
Control File /u01/app/oracle/oradata/orcl/control01.ctl – modified
Control File /u01/app/oracle/oradata/orcl/control02.ctl – modified
Control File /u01/app/oracle/oradata/orcl/control03.ctl – modified
Datafile /u01/app/oracle/oradata/orcl/system01.dbf – dbid changed
Datafile /u01/app/oracle/oradata/orcl/sysaux01.dbf – dbid changed
Datafile /u01/app/oracle/oradata/orcl/undotbs01.dbf – dbid changed
Datafile /u01/app/oracle/oradata/orcl/users01.dbf – dbid changed
Datafile /u01/app/oracle/oradata/orcl/temp01.dbf – dbid changed
Control File /u01/app/oracle/oradata/orcl/control01.ctl – dbid changed
Control File /u01/app/oracle/oradata/orcl/control02.ctl – dbid changed
Control File /u01/app/oracle/oradata/orcl/control03.ctl – dbid changed
Instance shut down

Database ID for database orcl changed to 3682222232.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID – Completed succesfully.

[oracle@zoomer ~]$

3) Open the database with resetlogs
SQL> alter database open resetlogs;

Database altered.

SQL> select dbid from v$database;

DBID
———-
5948456232

In regards to some other references, above process can be done while opening the DB read-only. But I am not sure……..I will test it after sometime.

Advertisements

Comments»

No comments yet — be the first.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: