这篇文章主要介绍“ocr的备份恢复方法是什么”,在日常操作中,相信很多人在ocr的备份恢复方法是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”ocr的备份恢复方法是什么”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
专注于为中小企业提供做网站、成都网站建设服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业环翠免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了近1000家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
操作系统版本: 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的备份恢复方法是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!
分享名称:ocr的备份恢复方法是什么
本文地址:/article44/jgcjee.html
成都网站建设公司_创新互联,为您提供标签优化、App开发、营销型网站建设、品牌网站制作、外贸建站、定制网站
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联