Change Database DBID with NID utility in Oracle

Change DBID with NID utility

NID utility is used by oracle to change the DBID and database name. It is very useful command. It help to change the DBID and dbname after the refresh activity from production.

Following are the steps for Changing the DBID of the database

1. Connect to the database with sqlplus.
sqlplus / as sysdba

2. Shutdown the database with immediate command.
shutdown immediate

3. Start the database up to mount state.
startup mount

4. Exit the sqlplus
Exit

5. Connect with NID utility to change DBID of database.

nid TARGET=SYS/password

DBNEWID: Release 10.2.0.1.0 - Production on Thu May 3 21:18:39 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database SUNNY (DBID=4128987928)
Connected to server version 10.2.0

Control Files in database:
/u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control01.ctl
/u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control02.ctl
/u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control03.ctl

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

Proceeding with operation
Changing database ID from 4128987928 to 4130522736
Control File /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control01.ctl - modified
Control File /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control02.ctl - modified
Control File /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control03.ctl - modified
Datafile /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/system01.dbf - dbid changed
Datafile /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/undotbs01.dbf - dbid changed
Datafile /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/sysaux01.dbf - dbid changed
Datafile /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/users01.dbf - dbid changed
Datafile /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/example01.dbf - dbid changed
Datafile /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/temp01.dbf - dbid changed
Control File /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control01.ctl - dbid changed
Control File /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control02.ctl - dbid changed
Control File /u01/app/oracle/product/10.2.0/db_1/oradata/sunny/control03.ctl - dbid changed
Instance shut down

Database ID for database SUNNY changed to 4130522736.
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

6. Connect with database again
sqlplus / as sysdba
7. Start the database upto mount state
startup mount
8. Open the database with resetlogs commands

alter database open resetlogs;
Database altered.

Advertisements

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.