您好,登錄后才能下訂單哦!
這篇文章主要介紹“ocr的備份恢復方法是什么”,在日常操作中,相信很多人在ocr的備份恢復方法是什么問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”ocr的備份恢復方法是什么”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
操作系統版本: readhat 6.4
數據庫版本: 11203
1.查看集群狀態
[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARC.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATADG01.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATADG02.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE OFFLINE rac1
ONLINE ONLINE rac2
ora.VOTE.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac1
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
2.查看ocr的備份,和手工備份,緊急情況下沒有ocr的備份也不要緊,
在$CRS_HOME的cdata目錄下有ocr的自動備份,默認每天和每周都會保存的,只要沒做過架構變更,都一直可用。
[root@rac1 cdata]# pwd
/oracle/app/grid/11.2.0/cdata
[root@rac1 cdata]# ls -lrt
總用量 2852
drwxr-xr-x 2 grid oinstall 4096 1月 17 2016 localhost
drwxr-xr-x 2 grid oinstall 4096 1月 17 2016 rac1
-rw------- 1 root oinstall 272756736 9月 5 07:36 rac1.olr
drwxrwxr-x 2 grid oinstall 4096 9月 5 07:37 rac-cluster
查看ocr磁盤組的未知和votingdisk的位置。
[root@rac1 cdata]# /oracle/app/grid/11.2.0/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2904
Available space (kbytes) : 259216
ID : 635069277
Device/File Name : +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@rac1 cdata]# /oracle/app/grid/11.2.0/bin/crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 956b16ceaff14f4ebf37414725a67350 (/dev/asm-diskb) [VOTE]
2. ONLINE adb3a38f36514f2bbfcaa798303df4a1 (/dev/asm-diskc) [VOTE]
3. ONLINE aa9bfeef2ddd4f01bf212f8e020cd040 (/dev/asm-diskd) [VOTE]
查看OCR備份的位置和情況
查看自動備份:
ocrconfig -showbackup auto
查看手工備份:
ocrconfig -showbackup manual
顯示的備份全是系統自動備份ocr的備份,最下面的PROT-25提示沒有手動的備份
[root@rac1 cdata]# /oracle/app/grid/11.2.0/bin/ocrconfig -showbackup
rac1 2019/09/05 07:37:35 /oracle/app/grid/11.2.0/cdata/rac-cluster/backup00.ocr
rac1 2019/09/05 03:37:34 /oracle/app/grid/11.2.0/cdata/rac-cluster/backup01.ocr
rac1 2019/09/04 16:44:33 /oracle/app/grid/11.2.0/cdata/rac-cluster/backup02.ocr
rac1 2019/09/04 16:44:33 /oracle/app/grid/11.2.0/cdata/rac-cluster/day.ocr
rac1 2019/09/04 16:44:33 /oracle/app/grid/11.2.0/cdata/rac-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
查看ASM SPFILE的存儲位置:
[root@rac1 cdata]# su - grid
[grid@rac1 ~]$ asmcmd
ASMCMD> spget
+VOTE/rac-cluster/asmparameterfile/registry.253.901344197
開始操作
1.做好ocr的手工備份
[root@rac1 rac-cluster]# /oracle/app/grid/11.2.0/bin/ocrconfig -export /home/oracle/ocr.bak
2.備份ASM的參數文件
su - grid
sqlplus / as sysasm
create pfile='/home/grid/initasm.ora' from spfile;
3.dd原來的OCR磁盤組中的磁盤,重建OCR磁盤組
[root@rac1 oracle]# dd if=/dev/zero of=/dev/asm-diskb bs=1024 count=1000
[root@rac1 oracle]# dd if=/dev/zero of=/dev/asm-diskc bs=1024 count=1000
[root@rac1 oracle]# dd if=/dev/zero of=/dev/asm-diskd bs=1024 count=1000
4. 2個節點關閉數據庫和集群
節點1
[root@rac1 oracle]# /oracle/app/grid/11.2.0/bin/crsctl stop crs
節點2
[root@rac2 ~]# /oracle/app/grid/11.2.0/bin/crsctl stop crs
5.以獨占模式(NOCRS模式)啟動節點1 GRID組件--只在節點1執行
[root@rac1 oracle]# /oracle/app/grid/11.2.0/bin/crsctl start crs -excl -nocrs
6.查看日志
集群alert日志
[cssd(3150)]CRS-1601:CSSD Reconfiguration complete. Active nodes are rac1 .
2019-09-05 04:15:10.314
[ctssd(3192)]CRS-2407:The new Cluster Time Synchronization Service reference node is host rac1.
2019-09-05 04:15:10.315
[ctssd(3192)]CRS-2401:The Cluster Time Synchronization Service started on host rac1.
2019-09-05 04:15:19.173
[/oracle/app/grid/11.2.0/bin/oraagent.bin(3071)]CRS-5011:Check of resource "+ASM" failed: details at "(:CLSN00006:)" in "/oracle/app/grid/11.2.0/log/rac1/agent/ohasd/oraagent_grid/oraagent_grid.log"
2019-09-05 04:15:21.828
[/oracle/app/grid/11.2.0/bin/oraagent.bin(3071)]CRS-5011:Check of resource "+ASM" failed: details at "(:CLSN00006:)" in "/oracle/app/grid/11.2.0/log/rac1/agent/ohasd/oraagent_grid/oraagent_grid.log"
2019-09-05 04:15:31.212
[/oracle/app/grid/11.2.0/bin/oraagent.bin(3071)]CRS-5019:All OCR locations are on ASM disk groups [VOTE], and none of these disk groups are mounted. Details are at "(:CLSN00100:)" in "/oracle/app/grid/11.2.0/log/rac1/agent/ohasd/oraagent_grid/oraagent_grid.log".
[grid@rac1 rac1]$ crsctl stat res -t -init
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.asm
1 ONLINE INTERMEDIATE rac1 OCR not started
ora.cluster_interconnect.haip
1 ONLINE ONLINE rac1
ora.crf
1 OFFLINE OFFLINE
ora.crsd
1 OFFLINE OFFLINE
ora.cssd
1 ONLINE ONLINE rac1
ora.cssdmonitor
1 ONLINE ONLINE rac1
ora.ctssd
1 ONLINE ONLINE rac1 ACTIVE:0
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 OFFLINE OFFLINE
ora.gipcd
1 ONLINE ONLINE rac1
ora.gpnpd
1 ONLINE ONLINE rac1
ora.mdnsd
1 ONLINE ONLINE rac1
7. 創建新的磁盤組節點1操作
su - grid
sqlplus / as sysasm
set line 200 pages 999
col name for a15
col compatibility for a15
select inst_id,group_number,name,allocation_unit_size/1024/1024 au_mb,type,state,compatibility,database_compatibility from gv$asm_diskgroup order by 3,1;
create diskgroup VOTE
normal redundancy
disk
'/dev/asm-diskb',
'/dev/asm-diskc',
'/dev/asm-diskd'
attribute 'compatible.asm'='11.2.0.0.0';
8.恢復OCR文件并設置votedisk --節點1操作
root執行
[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrconfig -import /home/oracle/ocr.bak --如果使用的是自動備份,則這里需要使用-restore來替換-import
[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrcheck
[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl replace votedisk +VOTE
Successful addition of voting disk 6b91880919e64fe3bfc01701f29256d1.
Successful addition of voting disk 2a0eef6d3ee64f10bfa2040621cef851.
Successful addition of voting disk a063e70967dd4fdcbf3b32e675c3246a.
Successfully replaced voting disk group with +VOTE.
CRS-4266: Voting file(s) successfully replaced
9.重啟集群
節點1
[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl stop crs -f
[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl start crs
節點2
[root@rac2 ~]# /oracle/app/grid/11.2.0/bin/crsctl start crs
到此,關于“ocr的備份恢復方法是什么”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。