Applies to: Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.4 - Release: 10.2 to 10.2 Information in this document applies to any platform. Goal ocrconfig -repair is used to repair inconsistent Oracle Cluster Registry (OCR) configuration information.The OCR configuration information is stored in: - File /etc/oracle/ocr.loc on Linux and AIX; - File /var/opt/oracle/ocr.loc on Solaris and HP-UX; One case when the repair the OCR configuration information would be required, is in a cluster where the OCR configuration was changed on one node while other node(s) were down. Please note that this command only modifies the OCR configuration information. Solution The problem with an inconsistent OCR configuration (ocr.loc file) on two node Linux cluster, will be demonstrated by shutting down node2.While that node is down, we would remove the OCR mirror file from node 1.Please note that these commands need to be run by a privileged user. 1. We start with mirrored Oracle Cluster Registry node1 # ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 200692 Used space (kbytes) : 3756 Available space (kbytes) : 196936 ID :495185602 Device/File Name : /ora10g/app/oracle/oradata/V10/OracleClusterRegistry Device/File integrity check succeeded Device/File Name : /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 Device/File integrity check succeeded Cluster registry integrity check succeeded 2. Now we shut the node2 down and remove the mirror file OracleClusterRegistry2 from node1: node1 # ocrconfig -replace ocrmirror node1 # ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 200692 Used space (kbytes) : 3752 Available space (kbytes) : 196940 ID :495185602 Device/File Name : /ora10g/app/oracle/oradata/V10/OracleClusterRegistry Device/File integrity check succeeded Device/File not configured Cluster registry integrity check succeeded The contents of the OCR configuration file on node1, would now be: node1 # cat /etc/oracle/ocr.loc #Device/file /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 being deleted ocrconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry local_only=false 3. We now bring the node2 back up and check the OCR status: node2 # ocrcheck PROT-602: Failed to retrieve data from the cluster registry While the error makes sense, as the mirror copy of the OCR doesn't exist any more (but the reference to that file is still in ocr.loc), it is not telling us what the problem might be. To debug this we might use strace (strace -f -o /tmp/ocrcheck.trcocrcheck) that would reveal an attempt to access non existent OCR mirror file.In thiscase we do know that the problem is indeed due to the missing OCR mirror file, so we can proceed with the repair of the OCR configuration on node 2: node2 # ocrconfig -repair ocr node2 # cat /etc/oracle/ocr.loc #Device/file /ora10g/app/oracle/oradata/V10/OracleClusterRegistry being deleted ocrconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 local_only=false 3.1. Because we did not specify the OCR file, that command actually removed the original reference to the OCR file OracleClusterRegistry and instead replaced it with the reference to the OCR mirror file OracleClusterRegistry2.In effect we ended up with different contents of the config files (ocr.loc) on our RAC nodes. On node 1 ocr.loc has: node1 # cat ocr.loc #Device/file /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 being deleted ocrconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry local_only=false And on node 2 we have: node2 # cat /etc/oracle/ocr.loc #Device/file /ora10g/app/oracle/oradata/V10/OracleClusterRegistry being deleted ocrconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 local_only=false 3.2. To fix this, we need to run 'ocrconfig -repair' on node2 again, this time specifying the correct OCR file: node2 # ocrconfig -repair ocr /ora10g/app/oracle/oradata/V10/OracleClusterRegistry PROT-19: Cannot proceed while clusterware is running. Shutdown clusterware first Try again node2 # crsctl stop crs Stopping resources. Successfully stopped CRS resources Stopping CSSD. Shutting down CSS daemon. Shutdown request successfully issued. node2 # ocrconfig -repair ocr /ora10g/app/oracle/oradata/V10/OracleClusterRegistry node2 # cat /etc/oracle/ocr.loc #Device/file /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 getting replaced by device /ora10g/app/oracle/oradata/V10/OracleClusterRegistry ocrconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry local_only=false 4. Now we have the same OCR configuration information on both nodes: node2 # ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 200692 Used space (kbytes) : 3756 Available space (kbytes) : 196936 ID :495185602 Device/File Name : /ora10g/app/oracle/oradata/V10/OracleClusterRegistry Device/File integrity check succeeded Device/File not configured 5. Finally, to mirror the OCR file, we run 'ocrconfig -replace ocrmirror' from any node: node2 # ocrconfig -replace ocrmirror /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 And check for the configuration and OCR integrity: node2 # cat /etc/oracle/ocr.loc #Device/filegetting replaced by device /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 ocrconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry ocrmirrorconfig_loc=/ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 local_only=false node2 # ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 200692 Used space (kbytes) : 3756 Available space (kbytes) : 196936 ID :495185602 Device/File Name : /ora10g/app/oracle/oradata/V10/OracleClusterRegistry Device/File integrity check succeeded Device/File Name : /ora10g/app/oracle/oradata/V10/OracleClusterRegistry2 Device/File integrity check succeeded Cluster registry integrity check succeeded Conclusion ocrconfig -repair is used to repair inconsistent Oracle Cluster Registry configuration information. ocrconfig -replace ocrmirror <file> is used to mirror Oracle Cluster Registry.The mirroring functionality was introduced in Oracle10gR2. References Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide 10g Release 2 (10.2) Related -------------------------------------------------------------------------------- Products -------------------------------------------------------------------------------- •Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition Errors -------------------------------------------------------------------------------- PROT-19; PROT-602 |
CSS(Cluster Synchronization Services) Internals (INTERNAL ONLY)