本篇内容主要讲解“RAC11G恢复OCR的方法是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“RAC11G恢复OCR的方法是什么”吧!
1.检查ocr
[root@rac1 ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 3232 Available space (kbytes) : 258888 ID : 811139123 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 succeeded |
2.检查votedisk
[root@rac2 ~]# crsctl query css votedisk ## STATE File Universal Id File Name Disk group — —– —————– ——— ——— 1. ONLINE 4b031d63f88f4f0cbf5cc8688884d5f2 (/dev/asm-diskb) [OCR] 2. ONLINE 1acaf51067b94fcdbf62f9a4400050d2 (/dev/asm-diskc) [OCR] 3. ONLINE 8b7b21ad7d114f21bf5e703ec4ccc44e (/dev/asm-diskd) [OCR] Located 3 voting disk(s). |
3.导出ocr
[root@rac2 ~]# ocrconfig -export /tmp/ocr_20160202.dmp [root@rac2 ~]# ll tmp | grep 2016 ls: 无法访问tmp: 没有那个文件或目录 [root@rac2 ~]# ll /tmp | grep 2016 -rw——- 1 root root 114426 2月 2 11:06 ocr_20160202.dmp |
4.查看备份
[root@rac2 ~]# ocrconfig -showbackup
rac2 2016/02/01 17:30:53 /g01/11ggrid/app/11.2.3/grid/backup00.ocr rac2 2016/02/01 13:30:53 /g01/11ggrid/app/11.2.3/grid/backup01.ocr rac2 2016/02/01 09:30:52 /g01/11ggrid/app/11.2.3/grid/backup02.ocr rac2 2016/01/31 01:30:49 /g01/11ggrid/app/11.2.3/grid/day.ocr rac1 2016/01/26 20:52:17 /g01/11ggrid/app/11.2.3/grid/week.ocr |
5.
[grid@rac2 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on 星期二 2月 2 11:07:09 2016 Copyright (c) 1982, 2011, Oracle. All rights reserved. 连接到: SQL> create pfile='/home/grid/asm_pfile20160202.txt' from spfile; File created. SQL> quit |
[root@rac1 ~]# crsctl stop crs -f CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1' CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1' CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1' CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed CRS-4133: Oracle High Availability Services has been stopped. |
[root@rac1 ~]# crsctl start crs -excl -nocrs CRS-4123: Oracle High Availability Services has been started. CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded CRS-2679: Attempting to clean 'ora.cluster_interconnect.haip' on 'rac1' CRS-2672: Attempting to start 'ora.ctssd' on 'rac1' CRS-2681: Clean of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1' CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.asm' on 'rac1' succeeded |
[root@rac1 ~]# crsctl query css votedisk ## STATE File Universal Id File Name Disk group — —– —————– ——— ——— 1. ONLINE 4b031d63f88f4f0cbf5cc8688884d5f2 (/dev/asm-diskb) [OCR] 2. ONLINE 1acaf51067b94fcdbf62f9a4400050d2 (/dev/asm-diskc) [OCR] 3. ONLINE 8b7b21ad7d114f21bf5e703ec4ccc44e (/dev/asm-diskd) [OCR] Located 3 voting disk(s). [root@rac1 ~]# dd if=/dev/zero of=/dev/asm-diskb bs=1024 count=1000 记录了1000+0 的读入 记录了1000+0 的写出 1024000字节(1.0 MB)已复制,0.0754203 秒,13.6 MB/秒 [root@rac1 ~]# dd if=/dev/zero of=/dev/asm-diskc bs=1024 count=1000 记录了1000+0 的读入 记录了1000+0 的写出 1024000字节(1.0 MB)已复制,0.0656402 秒,15.6 MB/秒 [root@rac1 ~]# dd if=/dev/zero of=/dev/asm-diskd bs=1024 count=1000 记录了1000+0 的读入 记录了1000+0 的写出 1024000字节(1.0 MB)已复制,0.056022 秒,18.3 MB/秒 |
[grid@rac1 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on 星期二 2月 2 11:23:17 2016 Copyright (c) 1982, 2011, Oracle. All rights reserved. 连接到: SQL> shutdown immediate SQL> startup pfile='/home/grid/asm_pfile20160202.txt' ; Total System Global Area 283930624 bytes |
SQL> select group_number, disk_number, mount_status, header_status, path from v$asm_disk;
GROUP_NUMBER DISK_NUMBER MOUNT_STATUS HEADER_STATUS 0 4 CLOSED CANDIDATE 0 5 CLOSED CANDIDATE GROUP_NUMBER DISK_NUMBER MOUNT_STATUS HEADER_STATUS 1 1 CACHED MEMBER 1 0 CACHED MEMBER 6 rows selected. |
SQL> create diskgroup OCR normal redundancy disk '/dev/asm-diskb','/dev/asm-diskc','/dev/asm-diskd' attribute 'compatible.asm'='11.2.0.0.0', 'compatible.rdbms'='11.2.0.0.0';
Diskgroup created. SQL> create spfile='+OCR' from pfile='/home/grid/asm_pfile20160202.txt'; File created. SQL> quit |
[grid@rac1 ~]$ ocrconfig -showbackup PROT-26: 从本地副本中检索到了 Oracle 集群注册表备份位置 rac2 2016/02/01 13:30:53 /g01/11ggrid/app/11.2.3/grid/backup00.ocr rac2 2016/02/01 09:30:52 /g01/11ggrid/app/11.2.3/grid/backup01.ocr rac2 2016/02/01 05:30:52 /g01/11ggrid/app/11.2.3/grid/backup02.ocr rac2 2016/01/31 01:30:49 /g01/11ggrid/app/11.2.3/grid/day.ocr rac1 2016/01/26 20:52:17 /g01/11ggrid/app/11.2.3/grid/week.ocr [root@rac1 ~]# ocrconfig -restore /g01/11ggrid/app/11.2.3/grid/week.ocr |
[root@rac1 ~]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1' CRS-2673: Attempting to stop 'ora.asm' on 'rac1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1' CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1' CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac1' CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1' CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1' CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed CRS-4133: Oracle High Availability Services has been stopped. [root@rac1 ~]# crsctl start crs -excl -nocrs CRS-4123: Oracle High Availability Services has been started. CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded CRS-2679: Attempting to clean 'ora.cluster_interconnect.haip' on 'rac1' CRS-2672: Attempting to start 'ora.ctssd' on 'rac1' CRS-2681: Clean of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1' CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.asm' on 'rac1' succeeded [root@rac1 ~]# crsctl query css votedisk Located 0 voting disk(s). [root@rac1 ~]# su – grid [grid@rac1 ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 Production on 星期二 2月 2 11:38:47 2016 Copyright (c) 1982, 2011, Oracle. All rights reserved. 连接到: SQL> shutdown immediate Total System Global Area 283930624 bytes GROUP_NUMBER DISK_NUMBER MOUNT_STATUS HEADER_STATUS PATH 6 rows selected. SQL> create diskgroup OCR normal redundancy disk '/dev/asm-diskb','/dev/asm-diskc','/dev/asm-diskd' attribute 'compatible.asm'='11.2.0.0.0', 'compatible.rdbms'='11.2.0.0.0'; SQL> create spfile='+OCR' from pfile='/home/grid/asm_pfile20160202.txt' ; File created. SQL> quit 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@rac1 ~]# crsctl query css votedisk [root@rac1 ~]# crsctl start crs |
[grid@rac1 ~]$ crs_stat -v -t 名称 类型 R/RA F/FT 目标 状态 主机 ———————————————————————- ora.DATA.dg ora….up.type 0/5 0/ ONLINE ONLINE rac1 ora….ER.lsnr ora….er.type 0/5 0/ ONLINE ONLINE rac1 ora….N1.lsnr ora….er.type 0/5 0/0 ONLINE ONLINE rac1 ora.OCR.dg ora….up.type 0/5 0/ ONLINE ONLINE rac1 ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1 ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1 ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE ora.kingsql.db ora….se.type 0/2 0/1 ONLINE ONLINE rac1 ora….network ora….rk.type 0/5 0/ ONLINE ONLINE rac1 ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac1 ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1 ora….SM1.asm application 0/5 0/0 ONLINE ONLINE rac1 ora….C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1 ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1 ora.rac1.vip ora….t1.type 0/0 0/0 ONLINE ONLINE rac1 ora….SM2.asm application 0/5 0/0 ONLINE ONLINE rac2 ora….C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2 ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2 ora.rac2.vip ora….t1.type 0/0 0/0 ONLINE ONLINE rac2 ora.scan1.vip ora….ip.type 0/0 0/0 ONLINE ONLINE rac1 |
到此,相信大家对“RAC11G恢复OCR的方法是什么”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
原创文章,作者:306829225,如若转载,请注明出处:https://blog.ytso.com/205501.html