安装oracle11g ocr分配,oracle 11g rac 更换ocr磁盘

环境描述

操作系统:CentOS release 6.7 (Final)

Clusterware版本:Oracle Clusterware active version on the cluster is [11.2.0.4.0]

查看vote磁盘相关信息:

$ crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

1. ONLINE   a9c137005f334ff7bf56f8f2408ca179 (/dev/raw/raw1) [OCR]

2. ONLINE   6530356142514f56bf448324bd6b58e8 (/dev/raw/raw2) [OCR]

3. ONLINE   64eb22cead5d4fb7bf1964f7222b9351 (/dev/raw/raw3) [OCR]

# ./ocrcheck

Status of Oracle Cluster Registry is as follows :

Version                  :          3

Total space (kbytes)     :     262120

Used space (kbytes)      :       2600

Available space (kbytes) :     259520

ID                       : 1634961206

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

查看OCR备份情况

#  ./ocrconfig -showbackup

PROT-24: Auto backups for the Oracle Cluster Registry are not available

PROT-25: Manual backups for the Oracle Cluster Registry are not available

由于新安装还没有进行备份,手动进行备份

# ./ocrconfig -local -manualbackup

vincent1     2016/10/19 13:53:17     /u01/app/11.2/grid/cdata/vincent1/backup_20161019_135317.olr

vincent1     2016/10/19 13:35:56     /u01/app/11.2/grid/cdata/vincent1/backup_20161019_133556.olr

vincent1     2016/10/19 12:33:03     /u01/app/11.2/grid/cdata/vincent1/backup_20161019_123303.olr

也可以在asm里面进行备份

[grid@vincent1 ~]$ asmcmd -p

ASMCMD [+] > md_backup /home/grid/bakup1019.ocr -G OCR

Disk group metadata to be backed up: OCR

Current alias directory path: ncdb-cluster/OCRFILE

Current alias directory path: ncdb-cluster

Current alias directory path: ncdb-cluster/ASMPARAMETERFILE

手动导出ocr内容

[root@vincent1 bin]# pwd

/u01/app/11.2/grid/bi

[root@vincent1 bin]# ./ocrconfig -export /home/grid/ocrbak1019

底层ocr磁盘更换,然后进行恢复

开始进行恢复的时候报错

[root@vincent1 grid]# /u01/app/11.2/grid/bin/ocrconfig  -restore /home/grid/bakup1019.ocr

PROT-35: The configured OCR locations are not accessible.

强制关闭

[root@vincent2 bin]#  ./crsctl stop crs -f

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'vincent2'

CRS-2673: Attempting to stop 'ora.mdnsd' on 'vincent2'

CRS-2673: Attempting to stop 'ora.crf' on 'vincent2'

CRS-2677: Stop of 'ora.crf' on 'vincent2' succeeded

CRS-2673: Attempting to stop 'ora.gipcd' on 'vincent2'

CRS-2677: Stop of 'ora.mdnsd' on 'vincent2' succeeded

CRS-2677: Stop of 'ora.gipcd' on 'vincent2' succeeded

CRS-2673: Attempting to stop 'ora.gpnpd' on 'vincent2'

CRS-2677: Stop of 'ora.gpnpd' on 'vincent2' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'vincent2' has completed

CRS-4133: Oracle High Availability Services has been stopped.

以独占模式启用

[root@vincent2 bin]# ./crsctl start crs -excl -nocrs

CRS-4123: Oracle High Availability Services has been started.

CRS-2672: Attempting to start 'ora.mdnsd' on 'vincent2'

CRS-2676: Start of 'ora.mdnsd' on 'vincent2' succeeded

CRS-2672: Attempting to start 'ora.gpnpd' on 'vincent2'

CRS-2676: Start of 'ora.gpnpd' on 'vincent2' succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor' on 'vincent2'

CRS-2672: Attempting to start 'ora.gipcd' on 'vincent2'

CRS-2676: Start of 'ora.cssdmonitor' on 'vincent2' succeeded

CRS-2676: Start of 'ora.gipcd' on 'vincent2' succeeded

CRS-2672: Attempting to start 'ora.cssd' on 'vincent2'

CRS-2672: Attempting to start 'ora.diskmon' on 'vincent2'

CRS-2676: Start of 'ora.diskmon' on 'vincent2' succeeded

CRS-2676: Start of 'ora.cssd' on 'vincent2' succeeded

CRS-2679: Attempting to clean 'ora.cluster_interconnect.haip' on 'vincent2'

CRS-2672: Attempting to start 'ora.ctssd' on 'vincent2'

CRS-2681: Clean of 'ora.cluster_interconnect.haip' on 'vincent2' succeeded

CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'vincent2'

CRS-2676: Start of 'ora.ctssd' on 'vincent2' succeeded

CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'vincent2' succeeded

CRS-2672: Attempting to start 'ora.asm' on 'vincent2'

CRS-2676: Start of 'ora.asm' on 'vincent2' succeeded

创建ocr磁盘组

[root@vincent2 bin]# su - grid

[grid@vincent2 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Wed Oct 19 19:57:18 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Real Application Clusters and Automatic Storage Management options

SQL> create diskgroup ocr normal redundancy disk '/dev/raw/raw1', '/dev/raw/raw2', '/dev/raw/raw3' attribute 'au_size'='1M','compatible.asm'='11.2.0.0.0','compatible.rdbms'='11.2.0.0.0';

Diskgroup created.

使用备份的文件进行恢复

[root@vincent2 ~]# /u01/app/11.2/grid/bin/ocrconfig  -restore /u01/app/11.2/grid/cdata/ncdb-cluster/backup_20161019_173806.ocr

查看状态

[root@vincent2 ~]# /u01/app/11.2/grid/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :

Version                  :          3

Total space (kbytes)     :     262120

Used space (kbytes)      :       2600

Available space (kbytes) :     259520

ID                       : 1634961206

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

已经恢复完成

下面一个步骤必须做,不然不会成功

[root@vincent2 ~]# /u01/app/11.2/grid/bin/crsctl replace votedisk +ocr

Successful addition of voting disk 09d04232d0eb4fb7bf944a21f1dd5ff0.

Successful addition of voting disk 69e5a5b7a9d94febbf63198c693966ea.

Successful addition of voting disk a3d2fdcf7ec44f63bfddc18c5bcd2cfc.

Successfully replaced voting disk group with +ocr.

CRS-4266: Voting file(s) successfully replaced

[root@vincent2 ~]# /u01/app/11.2/grid/bin/crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

1. ONLINE   09d04232d0eb4fb7bf944a21f1dd5ff0 (/dev/raw/raw1) [OCR]

2. ONLINE   69e5a5b7a9d94febbf63198c693966ea (/dev/raw/raw2) [OCR]

3. ONLINE   a3d2fdcf7ec44f63bfddc18c5bcd2cfc (/dev/raw/raw3) [OCR]

vote也恢复正常

Located 3 voting disk(s).

强制关闭

[root@vincent2 ~]# /u01/app/11.2/grid/bin/crsctl stop crs -f

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'vincent2'

CRS-2673: Attempting to stop 'ora.mdnsd' on 'vincent2'

CRS-2673: Attempting to stop 'ora.ctssd' on 'vincent2'

CRS-2673: Attempting to stop 'ora.asm' on 'vincent2'

CRS-2677: Stop of 'ora.mdnsd' on 'vincent2' succeeded

CRS-2677: Stop of 'ora.asm' on 'vincent2' succeeded

CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'vincent2'

CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'vincent2' succeeded

CRS-2677: Stop of 'ora.ctssd' on 'vincent2' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on 'vincent2'

CRS-2677: Stop of 'ora.cssd' on 'vincent2' succeeded

CRS-2673: Attempting to stop 'ora.gipcd' on 'vincent2'

CRS-2677: Stop of 'ora.gipcd' on 'vincent2' succeeded

CRS-2673: Attempting to stop 'ora.gpnpd' on 'vincent2'

CRS-2677: Stop of 'ora.gpnpd' on 'vincent2' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'vincent2' has completed

CRS-4133: Oracle High Availability Services has been stopped.

起服务

[root@vincent2 ~]# /u01/app/11.2/grid/bin/crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

查看状态

[grid@vincent1 ~]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora.ARCH.dg    ora....up.type ONLINE    ONLINE    vincent1

ora.DATA.dg    ora....up.type ONLINE    ONLINE    vincent1

ora....ER.lsnr ora....er.type ONLINE    ONLINE    vincent1

ora....N1.lsnr ora....er.type ONLINE    ONLINE    vincent2

ora.OCR.dg     ora....up.type ONLINE    ONLINE    vincent1

ora.asm        ora.asm.type   ONLINE    ONLINE    vincent1

ora.cvu        ora.cvu.type   ONLINE    ONLINE    vincent1

ora.gsd        ora.gsd.type   OFFLINE   OFFLINE

ora....SM1.asm application    ONLINE    ONLINE    vincent1

ora....R1.lsnr application    ONLINE    ONLINE    vincent1

ora....er1.gsd application    OFFLINE   OFFLINE

ora....er1.ons application    ONLINE    ONLINE    vincent1

ora....er1.vip ora....t1.type ONLINE    ONLINE    vincent1

ora....SM2.asm application    ONLINE    ONLINE    vincent2

ora....R2.lsnr application    ONLINE    ONLINE    vincent2

ora....er2.gsd application    OFFLINE   OFFLINE

ora....er2.ons application    ONLINE    ONLINE    vincent2

ora....er2.vip ora....t1.type ONLINE    ONLINE    vincent2

ora....network ora....rk.type ONLINE    ONLINE    vincent1

ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    vincent1

ora.ons        ora.ons.type   ONLINE    ONLINE    vincent1

ora.orcl.db    ora....se.type OFFLINE   OFFLINE

ora.scan1.vip  ora....ip.type ONLINE    ONLINE    vincent2

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值