Changing SID on RAC environment

Just a short note documenting a procedure that isn’t done frequently, and I didn’t see described anywhere else.
Somewhere last month a customer asked for my help in changing 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 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 instance

  6. start instance again.

  7. verify it looks ok by running “select instance_name from v$instance”.

  8. stop 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.

http://www.pythian.com/blog/changing-sid-on-rac-environment/

At least on the systems I managed, although the SPFILE is on ASM, there is a PFILE “initSID.ora” that contains a single line:
SPFILE=+ASM/

As far as I know this line is mandatory, and if you change the path to the SPFILE in ASM (which we did), you will need to change it on all nodes.

If you just replace the existing SPFILE in the same location, but don’t create a new one, you can skip this space �C regardless of whether or not ASM is involved.




你可能感兴趣的:(procedure,databases,Anywhere,customer,Corporate)