转载

替换OCR磁盘组的步骤

替换OCR磁盘组的步骤


2. OCR卷组调整步骤 4

2.1. 添加新存储 4

2.2. 多路径绑定配置 4

2.3. ASMLib配置 4

2.4. 备份OCR 5

2.5. 新建OCR卷组 5

2.6. 替换VOTE 6

2.7. 替换OCR 6

2.8. 迁移ASM SPFILE 7

2.9. 确认老OCR磁盘组是否还有其他文件 8

2.10. 删除老OCR卷组 8

2.11. 删除磁盘 8





1. OCR卷组调整步骤

1.1. 添加新存储

建立Normal冗余级别的OCR卷组需要至少3LUN,每个LUN最少容量为1GB,需要在存储端配置3LUNRAC集群中的各个节点。


1.2. 多路径绑定配置

配置/etc/multipatch.conf,添加新磁盘的UUID,假设多路径绑定之后的路径为/dev/mapper/newocr1、/dev/mapper/newocr2、/dev/mapper/newocr3,并且重新加载Mutilpathd服务生效


1.3. ASMLib配置

节点1操作如下:

将新加的3LUN添加到ASMLIB

# /usr/sbin/oracleasm createdisk OCRNEW1 /dev/mapper/newocr1

# /usr/sbin/oracleasm createdisk OCRNEW2 /dev/mapper/newocr2

# /usr/sbin/oracleasm createdisk OCRNEW3 /dev/mapper/newocr3


节点2

扫描新加的3LUN

# /usr/sbin/oracleasm scandisks

# /usr/sbin/oracleasm listdisks


1.4. 备份OCR

--逻辑备份恢复

ocrconfig -export /oracle/app/11.2.0/grid/cdata/ZFTPCCDB-crs/export_asm.bak


--物理备份恢复

ocrconfig -manualbackup

ocrconfig -showbackup

ocrcheck


1.5. 新建OCR卷组

set line 9999

set pagesize 9999

col path format a60

SELECT a.group_number, disk_number,mount_status, a.name, path FROM v$asm_disk a order by a.disk_number;



set line 999

select name,state,free_mb,required_mirror_free_mb,usable_file_mb,a.group_number, disk_number,mount_status, path from v$asm_diskgroup a;

select a.group_number,name,TYPE,state,TOTAL_MB,free_mb from v$asm_diskgroup a;

select name,state,free_mb,required_mirror_free_mb,usable_file_mb,a.group_number from v$asm_diskgroup a;


节点1新建Normal冗余级别的ASM卷组

sqlplus / as sysasm

create diskgroup newocr normal redundancy disk

'/dev/oracleasm/disks/neworc1',

'/dev/oracleasm/disks/neworc2',

'/dev/oracleasm/disks/neworc3'

attribute 'compatible.asm'='11.2','compatible.rdbms'='11.2';


节点1执行mount磁盘组:

ALTER DISKGROUP NEWOCR MOUNT;


crsctl stat res -t

1.6. 替换VOTE

其中一个节点,root用户下执行:

替换VOTE

crsctl replace votedisk +newocr

确认

crsctl query css votedisk


[root@node1 ~]# crsctl replace votedisk +OCR

Successful addition of voting disk 83fc22d0d6164fd2bfc2c48c9edcd64d.

Successful deletion of voting disk afbe52656e124f8ebff3f7236ed85e32.

Successfully replaced voting disk group with +OCR.

CRS-4266: Voting file(s) successfully replaced

[root@node1 ~]# crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

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

 1. ONLINE   83fc22d0d6164fd2bfc2c48c9edcd64d (ORCL:OVDISK) [OCR]

Located 1 voting disk(s).

[root@node1 ~]#


1.7. 替换OCR

grid用户下执行

Node1:

ocrconfig -add +newocr

ocrconfig -delete +ocr


more /etc/oracle/ocr.loc


[root@node1 ~]# ocrconfig -add +OCR

[root@node1 ~]# more /etc/oracle/ocr.loc

#Device/file  getting replaced by device +OCR

ocrconfig_loc=+TEST

ocrmirrorconfig_loc=+OCR

local_only=false

[root@node1 ~]# ocrconfig -delete +TEST

[root@node1 ~]# more /etc/oracle/ocr.loc

#Device/file +TEST getting replaced by device +OCR

ocrconfig_loc=+OCR

local_only=false

[root@node1 ~]#



Node2不用执行:

ocrconfig -repair -add +newocr

ocrconfig -repair -delete +ocr


[root@node2 ~]# crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

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

 1. ONLINE   afbe52656e124f8ebff3f7236ed85e32 (/dev/asm-diskb) [TEST]

Located 1 voting disk(s).

[root@node2 ~]# crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

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

 1. ONLINE   83fc22d0d6164fd2bfc2c48c9edcd64d (ORCL:OVDISK) [OCR]

Located 1 voting disk(s).

[root@node2 ~]# more /etc/oracle/ocr.loc

#Device/file +OVDISK getting replaced by device +TEST

ocrconfig_loc=+TEST

local_only=false

[root@node2 ~]# more /etc/oracle/ocr.loc

#Device/file  getting replaced by device +OCR

ocrconfig_loc=+TEST

ocrmirrorconfig_loc=+OCR

local_only=false

[root@node2 ~]# more /etc/oracle/ocr.loc

#Device/file +TEST getting replaced by device +OCR

ocrconfig_loc=+OCR

local_only=false

[root@node2 ~]#

1.8. 迁移ASM SPFILE

GRID用户下任一节点执行

$ asmcmd


查看当前的ASMSPFILE

ASMCMD> spget


复制SPFILE至新卷组

ASMCMD> spcopy -u +CRSDG/xx/asmparameterfile/registry.xx +newocr/spfileASM.ora


查看新SPFILE绝对路径

ASMCMD> ls -l +newocr/spfileASM.ora

+NEWOCR/XX/ASMPARAMETERFILE/REGISTRY.253.833623103

ASMCMD>spset +NEWOCR/XX/ASMPARAMETERFILE/REGISTRY.253.833623103


修改两个节点ORACLE用户下$ORACLE_HOME/dbs/init.ora文件内容

SPFILE='+newocr/spfileASM.ora'

[grid@node1 ~]$ asmcmd

ASMCMD> spget

+TEST/node-cluster/ASMPARAMETERFILE/REGISTRY.253.936725677

ASMCMD> spcopy -u +TEST/node-cluster/ASMPARAMETERFILE/REGISTRY.253.936725677 +OCR/spfileASM.ora

ASMCMD> ls -l +ocr/spfileASM.ora

Type              Redund  Striped  Time             Sys  Name

                                                    N    spfileASM.ora => +OCR/node-cluster/ASMPARAMETERFILE/REGISTRY.253.936729105

ASMCMD> spset +OCR/node-cluster/ASMPARAMETERFILE/REGISTRY.253.936729105

ASMCMD> spget

+OCR/node-cluster/ASMPARAMETERFILE/REGISTRY.253.936729105

ASMCMD>


1.9. 确认老OCR磁盘组是否还有其他文件


1.10. 删除老OCR卷组

重启集群后:

节点2

su - grid

sqlplus / as sysasm

alter diskgroup OCR dismount;

exit


节点1

su - grid

sqlplus / as sysasm

drop diskgroup ocr;


drop diskgroup OVDISK  INCLUDING CONTENTS;  

drop diskgroup OVDISK FORCE INCLUDING CONTENTS;  



1.11. 删除磁盘

任一节点ROOT用户下操作:

# /usr/sbin/oracleasm dropdisk OCR

删除多路径绑定配置,删除配置/etc/multipatch.conf中原有OCR盘内容。

最后从存储上删除到2个节点的映射。



About Me

...............................................................................................................................

● 本文整理自网络

● 小麦苗云盘地址:http://blog.itpub.net/26736162/viewspace-1624453/

● QQ群:230161599     微信群:私聊

● 联系我请加QQ好友(642808185),注明添加缘由

● 版权所有,欢迎分享本文,转载请保留出处

...............................................................................................................................

拿起手机使用微信客户端扫描下边的左边图片来关注小麦苗的微信公众号:xiaomaimiaolhr,扫描右边的二维码加入小麦苗的QQ群,学习最实用的数据库技术。

替换OCR磁盘组的步骤替换OCR磁盘组的步骤



替换OCR磁盘组的步骤  替换OCR磁盘组的步骤











正文到此结束
Loading...