HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Can I change the SID of an Oracle database?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
canthesiddatabaseoraclechange

Problem

The Server is Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit

Is there an easy & quick way to change the SIDs of the test databases on the server?

Dropping & recreating of the database is an option for me. But I'm looking for something requiring less time.

The other option to assign names in the clients tnsnames.ora is prone to errors, because they are not administrated centrally.

Compared with the time to drop & create a database on SQL-Server, the amount of time required to create a new Oracle database is excessively greater.
Further on SQL-Server you can rename SQL-Server instances. [ Usually you rename the server where SQL-Server is running and have some problems until you rename the server too ].

Solution

You need to recreate the control file

This post by Kaunain Ahmed describes the necessary steps:



  • 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


There are other tools referenced in the thread.

Here's a post by AskTom which references the process in more detail. While it's for 10g, it should still work.

Context

StackExchange Database Administrators Q#338, answer score: 17

Revisions (0)

No revisions yet.