OCP Blog
Super DBA
How change DBID and DBNAME for Oracle Database
by Vazha Mantua Monday, June 18, 2012 3:46 PM


Main method changing dbname of database is recreating controlfile with set new name condition, but after this operation DBID will not changed.

Oracle Provide very simple tool, which help you change both DBID and DBNAME.


When the DBID of a database is changed, all previous backups and archived logs of the database become unusable. After you change the DBID, you must open the database with the RESETLOG option, which re-creates the online redo logs, that’s why you should make a backup of the whole database immediately after changing the DBID. During changing DBID database change DBID for all datafiles and controlfiles.

Changing the DBNAME without changing the DBID does not require you to open with the RESETLOGS option, so database backups and archived logs are not invalidated, additionally You must change the DB_NAME initialization parameter after a database name change to reflect the new name. Also, you may have to re-create the Oracle password file. If you restore an old backup of the control file (before the name change), then you should use the initialization parameter file and password file from before the database name change,During changing DBNAME database change DBID for only controlfile not datafiles!

Let See example :

1. Ensure that you have validate backup

2.Shutdown database and startup in mount mode

3.To change the database name in addition to the DBID, specify the DBNAME parameter. This example changes the name to NEW_SID, also you should configure net service for connecting DB.

     $ORACLE_HOME/product/11.2.0/bin/nid   TARGET=SYS/password@test DBNAME=NEW_SID


4. After changing DBID and DBNAME ,you should change DB_NAME parameter on SPFILE(PFILE), shutdown database, mount it and open with resetlog option.


If you want only change DBNAME you should run command:

$ORACLE_HOME/product/11.2.0/bin/nid TARGET=SYS/password@test DBNAME=NEW_SID SETNAME=YES


For this case you don’t need open database with resetlog clause, but for both cases you should recreate password file.


Filter by APML


<<  September 2020  >>

View posts in large calendar