首页 > Linux操作系统 > Linux操作系统 > 针对ocr的一些测试
RAC,两个节点
[root@rac1 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104216
Used space (kbytes) : 3840
Available space (kbytes) : 100376
ID : 1487269132
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw9
Device/File integrity check succeeded
ocr有两个location
/dev/raw/raw1
/dev/raw/raw9
node2关闭后,在node1做remove一个ocr location的动作
[root@rac1 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrconfig -replace ocr
[root@rac1 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104216
Used space (kbytes) : 3840
Available space (kbytes) : 100376
ID : 1487269132
Device/File Name : /dev/raw/raw9
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
启动node2后在node2执行ocrcheck
[root@rac2 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrcheck
PROT-602: Failed to retrieve data from the cluster registry
显示不能check。原因为在node2关闭的时候,对ocr做了位置的变动,node2并没有得知移动
可以通过查看ocr.loc确认
[root@rac2 ~]# cat /etc/oracle/ocr.loc
#Device/file getting replaced by device /dev/raw/raw9
ocrconfig_loc=/dev/raw/raw1
ocrmirrorconfig_loc=/dev/raw/raw9
local_only=false
可以看到这个文件中还是包含两个ocr location。
需要做repair动作。
[root@rac2 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrconfig -repair ocr
[root@rac2 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104216
Used space (kbytes) : 3840
Available space (kbytes) : 100376
ID : 1487269132
Device/File Name : /dev/raw/raw9
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[root@rac2 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.
[root@rac2 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@rac2 ~]#
如果是ocr的设定变化。需要以下步骤。
Repairing an Oracle Cluster Registry Configuration on a Local Node
You may need to repair an OCR configuration on a particular node if your OCR
configuration changes while that node is stopped. For example, you may need to
repair the OCR on a node that was not up while you were adding, replacing, or
removing an OCR. Use the following procedure to repair an OCR configuration:
1. Run the following command to stop Oracle Clusterware on all nodes:
crsctl stop crs
2. Run the following command on one node to take a backup of the OCR
configuration:
ocrconfig -export export_filename
Note: You must be root user to run ocrconfig commands.
Note: The OCR that you are replacing can be either online or offline.
In addition, if your OCR resides on a cluster file system file or if the
OCR is on an network file system, then create the target OCR file
before continuing with this procedure.
Administering the Oracle Cluster Registry in Oracle Real Application Clusters
Administering Oracle Clusterware Components 3-5
In the preceding command, export_filename is the name of the of the file to
which you backed up OCR. You import this file after you repair the OCR
configuration.
3. Run the following command on all nodes to repair the OCR configuration:
ocrconfig -repair
4. Run the following command to import the backup to the repaired OCR
configuration:
ocrconfig -import export_filename
5. Run the following command on one node to overwrite the OCR configuration on
disk:
ocrconfig -overwrite
6. Run the following command on one node to verify the OCR configuration:
ocrcheck
Note: You cannot perform. this operation on a node on which the
Oracle Clusterware daemon is running.
ocr导入导出测试
1.在每个节点关闭ocr服务
2导出ocr内容。
[root@rac1 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrconfig -export ~/ocr.exp
3模拟破坏ocr
[root@rac1 ~]# dd if=/dev/zero f=/dev/raw/raw9 bs=1024 count=102400
102400+0 records in
102400+0 records out
[root@rac1 ~]# [root@rac1 ~]# /opt/app/oracle/product/10.2.0/crs_1/bin/crsctl check
crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM
由于ocr被破坏,所以不能启动CRS。
导入备份的ocr
[root@rac1 rac1]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrconfig -import ~/ocr.exp
[root@rac1 rac1]# /opt/app/oracle/product/10.2.0/crs_1/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@rac1 rac1]# /opt/app/oracle/product/10.2.0/crs_1/bin/crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM
[root@rac1 rac1]# /opt/app/oracle/product/10.2.0/crs_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104216
Used space (kbytes) : 3840
Available space (kbytes) : 100376
ID : 133367052
Device/File Name : /dev/raw/raw9
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[root@rac1 rac1]# /opt/app/oracle/product/10.2.0/crs_1/bin/crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@rac1 rac1]#
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7958405/viewspace-708107/ ,如需转载,请注明出处,否则将追究法律责任。