1.1 重新配置grid(ocr有备份,采用ocr备份进行恢复)
1.1.1 备份ocr
物理备份
手工备份,在其中一个节点上执行,我这里是在节点1上执行
[root@rac01 /]# /u01/grid/grid_home/11.2.0.4/bin/ocrconfig -manualbackup
查看备份
[root@rac01 ~]# /u01/grid/grid_home/11.2.0.4/bin/ocrconfig -showbackup
PROT-24: Auto backups for the Oracle Cluster Registry are not available
rac01 2020/12/14 04:42:03 /u01/grid/grid_home/11.2.0.4/cdata/rac-cluster/backup_20201214_044203.ocr
逻辑备份
在其中一个节点上执行即可,我这里在节点1上执行
[root@rac01 ~]#/u01/grid/grid_home/11.2.0.4/bin/ocrconfig -export /u01/ocrbak1215.exp
1.1.2 删除grid
第一个节点(root账号下执行)
/u01/grid/grid_home/11.2.0.4/crs/install/rootcrs.pl -deconfig -force -verbose
最后一个节点(root账号下执行)
/u01/grid/grid_home/11.2.0.4/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode
1.1.3 执行root.sh脚本重新配置
节点1
/u01/grid/grid_home/11.2.0.4/root.sh
节点2
/u01/grid/grid_home/11.2.0.4/root.sh
1.1.4 采用ocr备份恢复--nodone
1.关闭crs
节点1:
[root@rac01 bin]# cd /u01/grid/grid_home/11.2.0.4/bin
[root@rac01 bin]# ./crsctl stop crs
节点2:
[root@rac01 bin]# cd /u01/grid/grid_home/11.2.0.4/bin
[root@rac01 bin]# ./crsctl stop crs
2.在单节点使用排他和nocrs方式启动,我这里在节点1上操作
[root@rac01 bin]# cd /u01/grid/grid_home/11.2.0.4/bin
[root@rac01 bin]# ./crsctl start crs -excl -nocrs
3.恢复
备份文件在节点1上,下面的操作我们在节点1上执行
[root@rac01 bin]# /u01/grid/grid_home/11.2.0.4/bin/ocrconfig -restore /u01/grid/grid_home/11.2.0.4/cdata/rac-cluster/backup_20201214_044203.ocr
逻辑备份的采用如下方式导入:
逻辑导入:
/u01/grid/grid_home/11.2.0.4/bin/ocrconfig -import /u01/ocrbak1215.exp
4.检查
[grid@rac01 rac-cluster]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3336
Available space (kbytes) : 258784
ID : 158779444
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
[grid@rac01 rac-cluster]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 79459aac952a4f76bf159b904b1825b6 (/dev/asm-diskb) [OCR]
Located 1 voting disk(s).
[grid@rac01 rac-cluster]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 79459aac952a4f76bf159b904b1825b6 (/dev/asm-diskb) [OCR]
Located 1 voting disk(s).
4.关闭crs
[root@rac01 bin]# cd /u01/grid/grid_home/11.2.0.4/bin
[root@rac01 bin]# ./crsctl stop crs
5.启动crs
两个节点上进行启动
节点1:
[root@rac01 bin]# cd /u01/grid/grid_home/11.2.0.4/bin
[root@rac01 bin]# ./crsctl start crs
节点2:
[root@rac02 bin]# cd /u01/grid/grid_home/11.2.0.4/bin
[root@rac02 bin]# ./crsctl start crs
6.检查资源
[grid@rac01 rac-cluster]$ crsctl stat resource -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.LISTENER.lsnr
ONLINE ONLINE rac01
ONLINE INTERMEDIATE rac02 Not All Endpoints R
egistered
ora.OCR.dg
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.REDO.dg
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.asm
ONLINE ONLINE rac01 Started
ONLINE ONLINE rac02 Started
ora.gsd
OFFLINE OFFLINE rac01
OFFLINE OFFLINE rac02
ora.net1.network
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.ons
ONLINE ONLINE rac01
ONLINE ONLINE rac02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac01
ora.cvu
1 ONLINE ONLINE rac01
ora.oc4j
1 ONLINE ONLINE rac01
ora.rac01.vip
1 ONLINE ONLINE rac01
ora.rac02.vip
1 ONLINE ONLINE rac02
ora.scan1.vip
1 ONLINE ONLINE rac01
ora.slnngk.db
1 ONLINE ONLINE rac01 Open
2 ONLINE ONLINE rac02 Open
ora.slnngk.service_s1.svc
1 ONLINE ONLINE rac01
ora.slnngk.service_s2.svc
1 ONLINE ONLINE rac02
这里可以看到之前配置的监听器、数据库、实例资源都已经恢复了,也都启动了,若没有启动的可以尝试手工方式启动
7.启动相关资源
上面的节点2监听器,没有启动
ora.LISTENER.lsnr
ONLINE ONLINE rac01
ONLINE INTERMEDIATE rac02 Not All Endpoints Registered
解决办法:
删除后添加
[grid@rac01 admin]$srvctl stop listener
[grid@rac01 admin]$srvctl remove listener
[grid@rac01 admin]$srvctl add listener
[grid@rac01 admin]$srvctl start listener
-- The End --