Change the SID of an Oracle database
Since 9i dbnewid utility (nid) can be used to change database name
(and DBID if required).
If database name being changed only then resetlogs is not required:
1. startup database in mount mode
shutdown immediate
startup mount
2. run nid to change database name:
nid target=sys/syspassword@dbtns dbname=newname setname=YES
3. shutdown and start database in mount mode:
shutdown immediate
startup mount
4. change db_name in spfile (or in pfile editing the file):
alter system set db_name=newname scope=spfile;
5. recreate password file:
orapwd file=orapwnewname password=syspassword
6. startup the database
startup
7. post rename steps:
change SID in listener.ora
correct tnsnames.ora
remove old trace directories
change /etc/oratab (UNIX) or rename windows service using
You need to recreate the control file
- do: alter database backup controlfile to trace;
- extract the "create controlfile" command from the background-dump-destination tracefile.
- shutdown the DB.
- Change the DB-Name in your init.ora and change the init.ora
- Change the SID in the /etc/oratab or /var/opt/oracle/oratab
- Change the SID in your environment and source it
- Startup the database to mount-status startup mount
- Re-Create the controlfile with the statement from position 2.
- Do a alter database rename global_name to 10.Change the TNS-Configuration accordingly $ORACLE_HOME/network/admin/*.ora Look for SID and GLOBAL_NAME
No comments:
Post a Comment