Change SID or DATABASE Name in Oracle 11g
Change SID or DATABASE Name in Oracle 11g
===========================================================================
Steps to change DBID and DBNAME:
Source database name is SBSDSS and we will convert it to dssdr.
$ export ORACLE_SID=SBSDSS
$ sqlplus sys as sysdba
SQL> shutdown immediate
SQL> startup mount
SQL> exit;
$ nid target=sys/Ot6$admin dbname=dssdr SETNAME=YES
Change database ID and database name SBSDSS to dssdr? (Y/[N]) => Y
Modify parameter file and generate a new password file before restarting.
Database ID for database dssdr changed to 3803284043.
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 name and ID.
DBNEWID - Completed succesfully.
$ cd /data1/oracle11g/product/11.2.0/dbhome_2/dbs/
Now, create new password file for new name:
$ orapwd file=$ORACLE_HOME/dbs/orapwdssdr password=sys force=y
Make new init.ora file and from existing init.ora file and change db_name parame
ter from SBSDSS to dssdr
$ cp initSBSDSS.ora initdssdr.ora
change *.db_name='SBSDSS' to *.db_name='dssdr' in init file.
Change the $ORACLE_HOME/network/admin/tnsnames.ora file wherever it has the old
db name.
If there is a static registration of the database in the listener.ora file then
change the database name in the following file $ORACLE_HOME/network/admin/listen
er.ora.
Open the database with Resetlogs option:
$ sqlplus sys as sysdba
SQL> startup mount
SQL> alter database open resetlogs;
SQL> select instance_name from v$instance;