Pythian Blog: Technical Track

Changing SID on a RAC Environment

This post is just a short note documenting a procedure that isn’t done frequently or described anywhere else (to my knowledge).
Sometime last month, a customer asked for my help to change the SIDs on one of his RAC databases to match the new corporate standard. The database name matched the standard so we could leave that alone, but the SID needed to be changed.
Here’s what we did to change it (on 11gR2, but it should work on older versions too):

  1. Save a copy of SPFILE as pfile.
  2. Replace all SIDs in pfile.
  3. Stop database: srvctl stop database -d <dbname>.

On one node:

  1. Export ORACLE_SID=<new SID>.
  2. Rename init.ora file:
    cp init<old sid>.ora init<new sid>.ora
  3. Start instance no mount:
    startup nomount pfile=/home/oracle/temp_pfile
  4. Replace SPFILE with the modified version:
    create spfile=’+DATADG01/<dbname>/spfile<dbname>.ora’ from pfile=’/home/oracle/temp_pfile’;
  5. Stop the instance.
  6. Start the instance again.
  7. Make sure that it looks okay by running “select instance_name from v$instance”.
  8. Stop the instance.

Then:

  1. Rename init.ora on other cluster nodes.
  2. Unregister instances from srvctl:
    srvctl remove instance -d <dbname> -i <old sid node 1>
    srvctl remove instance -d <dbname> -i <old sid node 2>
    srvctl remove instance -d <dbname> -i <old sid node 3>
  3. Register new instances:
    srvctl add instance -d <dbname> -i <new sid node 1> -n <hostname node 1>
    srvctl add instance -d <dbname> -i <new sid node 2> -n <hostname node 2>
    srvctl add instance -d <dbname> -i <new sid node 3> -n <hostname node 3>

Enjoy!

And of course, comment below if you think I forgot a step or know about a better way to do it.

No Comments Yet

Let us know what you think

Subscribe by email