Repair option of the ocrconfig command [ID 330234.1]

Repair option of the ocrconfig command [ID 330234.1]

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 this  case 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/file  getting 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)

请教关于CSSD后台守护进程的一些TRACE文件中的一些问题

RAC监听注册时的一个错误

crs_stat文档

RAC里的resource的权限

要一眼看出的问题

scls_scr是干嘛的

Oracle10g下手工重建CRS和RAC数据库

升级CRS,运行root102.sn成功,GSD却无法启动

RAC CRS启动不了, 各位大侠帮忙看一下.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

inthirties

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值