Monday, September 30, 2013

How to Modify Oracle RAC spfile Location

Information about How To Modify Oracle RAC spfile Location
This document will explain how to modify the location of the spfile with the srvctl command.

Document Creator
Todd Walters 

Requirements
  • Oracle RAC is installed on srv0dbx01, srv0dbx02, and srv0dbx03
  • The name of the database is PWAKDB
  • Each Instance is called PWAKdbX where X is the node, i.e. PWAKDB1
  • srvctl is used to control all nodes. srvctl -h will show you syntax help
  • showcrs script stored in oracle home directory will show status of all nodes.
  • If srvctl does not stop and start instance properly verify TNS_ADMIN env is set.
  • TIP: Run export SRVM_TRACE=TRUE
    Then try and start instance:$ srvctl start instance -d PWAKdb -I PWAKdb3
    This will then let you see the log file as it starts and check for errors.
How to Modify Oracle spfile Location 
  1. Login to Oracle Server (node 1 for example, srv0dbx01)
  2. su - oracle
  3. Source CRS
      • srv0dbx01 | ORA1020 | /export/home/oracle
        > .
        oraenv
        ORACLE_SID = [ORA1020] ?
        CRS
        srv0dbx01 | CRS | /export/home/oracle
        >
        cd $ORACLE_HOME
        srv0dbx01 | CRS | /u00/app/oracle/product/10.2.0/CRS
  4. Check Status of Instance
      • > srvctl status instance -d PWAKdb -i PWAKdb1
        Instance PWAKdb1 is running on node srv0dbx01
  5. Stop the Instance
      • srvctl stop instance -d PWAKdb -i PWAKdb1
  6. Check the status of the Instance again
      • > srvctl status instance -d PWAKdb -i PWAKdb1
        Instance PWAKdb1 is not running on node srv0dbx01
  7.  Run the command in number 8 to modify the database to specify the location of the spfile.
  8. srvctl modify database -d PWAKdb -p +PWAK_DATA_01/PWAKDB/spfilePWAKdb.ora
  9. Then I set trace on and ran :
Srvctl start instance -d PWAKdb -I PWAKdb1
  1. Wath the trace and it showed the spfile going to PWAK_data_01
  2. Test everything by running crs_stop -all and waited for everything to stop.
  3. Next, run crs_start -all and everything should start successfully.
  4. Run this command to view the settings of the db and you can see the spfile is now set to the correct location?
srvctl getenv database -d PWAKdb
[main] [12:22:42:700] [OCRTree.printParallelServerConfig:719] Printing content of database name=PWAKDB
[main] [12:22:42:700] [OCRTree.printParallelServerConfig:720] domain=WORLD
[main] [12:22:42:700] [OCRTree.printParallelServerConfig:721] oraclehome=/u00/app/oracle/product/10.2.0/DB
[main] [12:22:42:700] [OCRTree.printParallelServerConfig:722] spfile=+PWAK_DATA_01/PWAKDB/spfilePWAKdb.ora
[main] [12:22:42:700] [OCRTree.printParallelServerConfig:723] enabled=true
[main] [12:22:42:700] [OCRTree.printParallelServerConfig:727] envs: TNS_ADMIN=/u00/app/oracle/product/10.2.0/ASM/network/admin
[main] [12:22:42:701] [OCRTree.printParallelServerConfig:730] Finishing printing content of database name=PWAKDB