How to Recreate OCR/Voting Disk Accidentally Deleted

How to Recreate OCR/Voting Disk Accidentally Deleted 

APPLIES TO:
Oracle Server – Enterprise Edition – Version 10.2.0.1 to 11.1.0.7 [Release 10.2 to 11.1] Generic UNIX Generic Linux

GOAL

The goal of this document is to help customers who have accidentally deleted the OCR, voting disk or the files that are required for the operation of Oracle clusterware. The note applies to 10gR2 and 11gR1, for 11gR2,

 Depending on the issue, it may or may not be good idea to execute the steps provided.

  • OCR 
    • If the OCR has been deleted, then check if the OCR mirror is OK and vice versa. It may be prudent to use the OCR mirror to create the OCR. For steps on this check the documentation:  Oracle Database   Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
    • If the OCR mirror and OCR have been deleted, then it may be faster to restore the OCR using the OCR backups. For steps on this check the documentation: Oracle Database   Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
  • Voting Disk
    • If there are multiple voting disks and one was accidentally deleted, then check if there are any backups of this voting disk. If there are no backups then we can add one using the crsctl add votedisk command. The complete steps are in the: Oracle Database   Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
  • SCLS directories
    • These are internal only directories which are created by root.sh, if this directory is accidentally removed then they can only be created by the steps documented below
  • Socket files in /tmp/.oracle or /var/tmp/.oracle
    • If these files are accidentally deleted, then stop the Oracle Clusterware on that node and restart it again. This will  recreate these socket files. If the socket files for cssd is deleted then the Oracle Clusterware stack may not come down in which case the node has to be bounced.

FIX

If none of the steps documented above can be used to restore the file that was accidentally deleted or is corrupted, then the following steps can be used to re-create/reinstantiate these files. The following steps require complete downtime on all the nodes.

  1. Shutdown the Oracle Clusterware stack on all the nodes using command crsctl stop crs as root user.
  2. Backup the entire Oracle Clusterware home.
  3. Execute <CRS_HOME>/install/rootdelete.sh on all nodes
  4. Execute <CRS_HOME>/install/rootdeinstall.sh on the node which is supposed to be the first node
  5. The following commands should return nothing
    • ps -e | grep -i ‘ocs[s]d’
    • ps -e | grep -i ‘cr[s]d.bin’
    • ps -e | grep -i ‘ev[m]d.bin’
  6. Execute <CRS_HOME>/root.sh on first node
  7. After successful root.sh execution on first node Execute root.sh on the rest of the nodes of the cluster
  8. For 10gR2, use racgons; for 11g use onsconfig command. Using onsconfig stops and starts ONS so the changes take effect, while racgons doesn’t do that so the changes won’t take effect until ONS is restarted on all nodes. Examples for each are provided below. For 10g Execute as owner (generally oracle) of CRS_HOME command <CRS_HOME>/bin/racgons add_config hostname1:port hostname2:port
    $/u01/crs/bin/racgons add_config halinux1:6251 halinux2:6251

    For 11g Execute as owner (generally oracle) of CRS_HOME command <CRS_HOME>/install/onsconfig add_config hostname1:port hostname2:port

    $/u01/crs/install/onsconfig add_config halinux1:6251 halinux2:6251
  9. Execute as owner of CRS_HOME (generally oracle)  <CRS_HOME>/bin/oifcfg setif -global. Please review Note 283684.1 for details.
    $/u01/crs/bin/oifcfg setif -global  eth0/192.168.0.0:cluster_interconnect eth1/10.35.140.0:public
  10. Add listener using netca. This may give errors if the listener.ora contains the entries already. If this is the case, move the listener.ora to /tmp from the $ORACLE_HOME/network/admin or from the $TNS_ADMIN directory if the TNS_ADMIN environmental is defined and then run netca. Add all the listeners that were added earlier.
  11. Add ASM & database resource to the OCR using the appropriate srvctl add database command as the user who owns the ASM & database resource. Please ensure that this is not run as root user
  12. Add  Instance, services using appropriate srvctl add commands. Please refer to the documentation for the exact commands.
  13. execute cluvfy stage -post crsinst -n node1,node2    ### Please ensure to replace node1,node2 with the node names of the cluster

REFERENCES

NOTE:557178.1 – CRS on Windows: How To Reinitialize (Accidentally Deleted) OCR and Vote Disk (without a full reinstall of Oracle Clusterware)

Advertisements

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in Oracle RAC. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s