[root@testdb1 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 4a4d2ebc4ab64fa5bfb9c2ad51df2f06 (/dev/asm-diskm) [OCR_VOTE]
2. ONLINE 4098f6aa168a4f93bf1f6364273fe911 (/dev/asm-diski) [OCR_VOTE]
3. ONLINE 2a2c91ae30374fa0bfc8cb65feae7cf8 (/dev/asm-diskg) [OCR_VOTE]
4. ONLINE a808cd9fc5664f73bf1873c948f35fa6 (/dev/asm-diskf) [OCR_VOTE]
5. ONLINE 445d6133f4714fadbfd653f09ddca99c (/dev/asm-diskd) [OCR_VOTE]
Located 5 voting disk(s).
[root@testdb1 ~]#
root@testdb1[+ASM1]/odc/xx$crsctl replace votedisk /odc/xx/xx
Now formatting voting disk: /odc/xx/xx.
CRS-4256: Updating the profile
Successful addition of voting disk ab9c20eb088e4f3dbfc0a241a06e2f37.
Successful deletion of voting disk 4a4d2ebc4ab64fa5bfb9c2ad51df2f06.
Successful deletion of voting disk 4098f6aa168a4f93bf1f6364273fe911.
Successful deletion of voting disk 2a2c91ae30374fa0bfc8cb65feae7cf8.
Successful deletion of voting disk a808cd9fc5664f73bf1873c948f35fa6.
Successful deletion of voting disk 445d6133f4714fadbfd653f09ddca99c.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
root@testdb1[+ASM1]/odc/xx$ll
total 20520
-rw-r----- 1 grid oinstall 21004800 May 25 08:21 xx
root@testdb1[+ASM1]/odc/xx$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE ab9c20eb088e4f3dbfc0a241a06e2f37 (/odc/xx/xx) []
Located 1 voting disk(s).
root@testdb1[+ASM1]/odc/xx$crsctl replace votedisk /odc/xx/xx
Now formatting voting disk: /odc/xx/xx.
CRS-4256: Updating the profile
Successful addition of voting disk ab9c20eb088e4f3dbfc0a241a06e2f37.
Successful deletion of voting disk 4a4d2ebc4ab64fa5bfb9c2ad51df2f06.
Successful deletion of voting disk 4098f6aa168a4f93bf1f6364273fe911.
Successful deletion of voting disk 2a2c91ae30374fa0bfc8cb65feae7cf8.
Successful deletion of voting disk a808cd9fc5664f73bf1873c948f35fa6.
Successful deletion of voting disk 445d6133f4714fadbfd653f09ddca99c.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
root@testdb1[+ASM1]/odc/xx$ll
total 20520
-rw-r----- 1 grid oinstall 21004800 May 25 08:21 xx
root@testdb1[+ASM1]/odc/xx$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE ab9c20eb088e4f3dbfc0a241a06e2f37 (/odc/xx/xx) []
Located 1 voting disk(s).
root@testdb1[+ASM1]/odc/xx$ cd
root@testdb1[+ASM1]/root$crsctl replace votedisk +OCR_VOTE
CRS-4256: Updating the profile
Successful addition of voting disk 575a6470237b4f7dbf16048d82229fcc.
Successful addition of voting disk 2f9dab1fb1164f3bbf3365b37e3e887b.
Successful addition of voting disk 8944dca8fb0e4f82bff80f0527a15cec.
Successful addition of voting disk 2074a36da5154f25bf0ff4b83fabfe84.
Successful addition of voting disk 56e7bbc906e04f08bfb554a99afd87db.
Successful deletion of voting disk ab9c20eb088e4f3dbfc0a241a06e2f37.
Successfully replaced voting disk group with +OCR_VOTE.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
root@testdb1[+ASM1]/root$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 575a6470237b4f7dbf16048d82229fcc (/dev/asm-diskm) [OCR_VOTE]
2. ONLINE 2f9dab1fb1164f3bbf3365b37e3e887b (/dev/asm-diski) [OCR_VOTE]
3. ONLINE 8944dca8fb0e4f82bff80f0527a15cec (/dev/asm-diskg) [OCR_VOTE]
4. ONLINE 2074a36da5154f25bf0ff4b83fabfe84 (/dev/asm-diskf) [OCR_VOTE]
5. ONLINE 56e7bbc906e04f08bfb554a99afd87db (/dev/asm-diskd) [OCR_VOTE]
Located 5 voting disk(s).
root@testdb1[+ASM1]/root$
root@testdb1[+ASM1]/root$crsctl replace votedisk /odc/xx/test1
Now formatting voting disk: /odc/xx/test1.
CRS-4256: Updating the profile
Successful addition of voting disk 7f8f22c602384f17bf1dfd4822308d44.
Successful deletion of voting disk 575a6470237b4f7dbf16048d82229fcc.
Successful deletion of voting disk 2f9dab1fb1164f3bbf3365b37e3e887b.
Successful deletion of voting disk 8944dca8fb0e4f82bff80f0527a15cec.
Successful deletion of voting disk 2074a36da5154f25bf0ff4b83fabfe84.
Successful deletion of voting disk 56e7bbc906e04f08bfb554a99afd87db.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
root@testdb1[+ASM1]/root$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7f8f22c602384f17bf1dfd4822308d44 (/odc/xx/test1) []
Located 1 voting disk(s).
root@testdb1[+ASM1]/root$crsctl add css votedisk /odc/xx/test2
Now formatting voting disk: /odc/xx/test2.
CRS-4603: Successful addition of voting disk /odc/xx/test2.
root@testdb1[+ASM1]/root$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7f8f22c602384f17bf1dfd4822308d44 (/odc/xx/test1) []
2. ONLINE 4fc48fe3b68f4f74bff440fed7b3ab4e (/odc/xx/test2) []
Located 2 voting disk(s).
root@testdb1[+ASM1]/root$
注意事项:表决盘存在ASM注意事项
* 如果表决盘存放在ASM中,则表决文件的镜像,由磁盘组完成,不在需要另外一个磁盘组做镜像
* 不允许表决盘同时存在ASM和集群文件系统中。
root@testdb1[+ASM1]/root$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7f8f22c602384f17bf1dfd4822308d44 (/odc/xx/test1) []
2. ONLINE 4fc48fe3b68f4f74bff440fed7b3ab4e (/odc/xx/test2) []
Located 2 voting disk(s).
root@testdb1[+ASM1]/root$crsctl delete css votedisk /odc/xx/test2
CRS-4611: Successful deletion of voting disk /odc/xx/test2.
root@testdb1[+ASM1]/root$
root@testdb1[+ASM1]/root$crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7f8f22c602384f17bf1dfd4822308d44 (/odc/xx/test1) []
Located 1 voting disk(s).
root@testdb1[+ASM1]/root$
恢复原状
root@testdb1[+ASM1]/root$crsctl replace votedisk +OCR_VOTE
CRS-4256: Updating the profile
Successful addition of voting disk 531089329c6e4fd7bf55527321648aeb.
Successful addition of voting disk 228bc2cc1a624f2bbff2ed7ed24d3a36.
Successful addition of voting disk 2ddb39eaa1a54ff0bf38c48b12a7315c.
Successful addition of voting disk 735db22d36d14f31bf446493c25cf1bc.
Successful addition of voting disk 5cc9d45f6ade4f98bf16c78be12fa786.
Successful deletion of voting disk 7f8f22c602384f17bf1dfd4822308d44.
Successfully replaced voting disk group with +OCR_VOTE.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
root@testdb1[+ASM1]/root$
root@testdb1[+ASM1]/root$ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3216
Available space (kbytes) : 258904
ID : 545177980
Device/File Name : +OCR_VOTE
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 succeeded
只存在一个存放OCR的路径是+OCR_VOTE
touch /odc/ocrmirr/ocr_mirror1
chown root.oinstall /odc/ocrmirr/ocr_mirror1
chomd 640 /odc/ocrmirr/ocr_mirror1
touch /odc/ocrmirr
chown root.oinstall /odc/ocrmirr
chmod 640 /odc/ocrmirr
现有只存在一个存放OCR的路径是+OCR_VOTE
root@testdb1[+ASM1]/root$ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3232
Available space (kbytes) : 258888
ID : 545177980
Device/File Name : +OCR_VOTE
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 succeeded
root@testdb1[+ASM1]/root$ocrconfig -add +OCR_VOTE2
root@testdb1[+ASM1]/root$ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3232
Available space (kbytes) : 258888
ID : 545177980
Device/File Name : +OCR_VOTE
Device/File integrity check succeeded
Device/File Name : +OCR_VOTE2
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
root@testdb1[+ASM1]/root$ocrconfig -delete +OCR_VOTE2
root@testdb1[+ASM1]/root$ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3232
Available space (kbytes) : 258888
ID : 545177980
Device/File Name : +OCR_VOTE
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
Oracle会自动备份,每隔4个小时。
root@testdb1[+ASM1]/odc$ocrconfig -manualbackup
testdb1 2021/05/25 09:13:58 /grid/grid_home/cdata/testdb-cluster/backup_20210525_091358.ocr
root@testdb1[+ASM1]/odc$ocrconfig -showbackup
testdb1 2021/05/16 13:40:02 /grid/grid_home/cdata/testdb-cluster/backup00.ocr
testdb2 2021/05/15 17:47:50 /grid/grid_home/cdata/testdb-cluster/backup01.ocr
testdb2 2018/12/11 02:05:36 /grid/grid_home/cdata/testdb-cluster/backup02.ocr
testdb2 2021/05/15 17:47:50 /grid/grid_home/cdata/testdb-cluster/day.ocr
testdb2 2021/05/15 17:47:50 /grid/grid_home/cdata/testdb-cluster/week.ocr
testdb1 2021/05/25 09:13:58 /grid/grid_home/cdata/testdb-cluster/backup_20210525_091358.ocr
root@testdb1[+ASM1]/odc$
ocrdump -backupfile /grid/grid_home/cdata/testdb-cluster/backup_20210525_091358.ocr
root@testdb1[+ASM1]/root$ocrdump -backupfile /grid/grid_home/cdata/testdb-cluster/backup_20210525_091358.ocr
root@testdb1[+ASM1]/root$ll
total 352
-rw-------. 1 root root 2153 Mar 24 2018 anaconda-ks.cfg
drwxr-xr-x 3 root root 4096 Mar 25 2018 Desktop
drwxr-xr-x 2 root root 4096 Mar 24 2018 Documents
drwxr-xr-x 2 root root 4096 Mar 24 2018 Downloads
-rw-r--r--. 1 root root 64378 Mar 24 2018 install.log
-rw-r--r--. 1 root root 19598 Mar 24 2018 install.log.syslog
drwxr-xr-x 2 root root 4096 Mar 24 2018 Music
-rw------- 1 root root 225959 May 25 09:17 OCRDUMPFILE
drwxr-xr-x 2 root root 4096 Mar 24 2018 Pictures
drwxr-xr-x 2 root root 4096 Mar 24 2018 Public
drwxr-xr-x 2 root root 4096 Mar 24 2018 Templates
drwxr-xr-x 2 root root 4096 Mar 24 2018 Videos
暂时先不写
导出ocr文件,文件名ocrEXP
ocrconfig -export ocrEXP
root@testdb1[+ASM1]/root$ocrconfig -export ocrEXP
root@testdb1[+ASM1]/root$ll -lrt
total 480
-rw-r--r--. 1 root root 19598 Mar 24 2018 install.log.syslog
-rw-r--r--. 1 root root 64378 Mar 24 2018 install.log
-rw-------. 1 root root 2153 Mar 24 2018 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 Mar 24 2018 Videos
drwxr-xr-x 2 root root 4096 Mar 24 2018 Templates
drwxr-xr-x 2 root root 4096 Mar 24 2018 Public
drwxr-xr-x 2 root root 4096 Mar 24 2018 Pictures
drwxr-xr-x 2 root root 4096 Mar 24 2018 Music
drwxr-xr-x 2 root root 4096 Mar 24 2018 Downloads
drwxr-xr-x 2 root root 4096 Mar 24 2018 Documents
drwxr-xr-x 3 root root 4096 Mar 25 2018 Desktop
-rw------- 1 root root 225959 May 25 09:17 OCRDUMPFILE
-rw------- 1 root root 127862 May 25 09:19 ocrEXP
root@testdb1[+ASM1]/root$
当集群出现问题的时候我们可以通过Import进行导入
但是需要很小心,有可能导致集群无法启动。如果要得到一个完整集群备份,需要全部关机采用导出导入。
ocrconfig -import ocrEXP
方式一、
ocrconfig -manualbackup and ocrconfig -restore
方式二、
ocrconfig -export and ocrconfig -import
注意:方式一是完全备份,方式二是不完全的。我们用方式一。注意方式一不能用方式二的导入。
表决盘备份作为OCR备份的一部分,表决盘自动备份自动恢复,表决盘全部丢失,需要人工干预。
原文:https://blog.51cto.com/lishiyan/2820392