1.利用asmca创建新的+OCR_VOTING_NEW磁盘组:

 

2. 替换OCR

+ASM1:/home/grid@rac1>ocrcheck

Status of Oracle Cluster Registry is as follows :

Version                  :          3

Total space (kbytes)     :     262120

Used space (kbytes)      :       3084

Available space (kbytes) :     259036

ID                       :  759188825

Device/File Name         : +OCR_VOTING

                                    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 bypassed due to non-privileged user

[root@rac1 bin]# /u01/app/11.2.0/grid_1/bin/ocrconfig -add +OCR_VOTING_NEW

[root@rac1 bin]# /u01/app/11.2.0/grid_1/bin/ocrcheck

Status of oracle Cluster Registry is as follows :

Version                  :          3

Total space (kbytes)     :     262120

Used space (kbytes)      :       3084

Available space (kbytes) :     259036

ID                       :  759188825

Device/File Name         : +OCR_VOTING

                                    Device/File integrity check succeeded

Device/File Name         : +OCR_VOTING_NEW

                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

Cluster registry integrity check succeeded

 

Logical corruption check succeeded

注意这里查看crs日志,我们发现OCR已经替换,

2017-03-06 09:02:22.160: 

[crsd(8988)]CRS-1007:The OCR/OCR mirror location was replaced by +OCR_VOTING_NEW

 

 

4.迁移votdisk

+ASM1:/home/grid@rac1>crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

–  —–    —————–                ——— ———

 1. ONLINE   63f25efe70324f09bf4d4aec0127457b (/dev/asm-diskc) [OCR_VOTING]

 2. ONLINE   3906ddbefe474fe2bfa8799b293a30e1 (/dev/asm-diskd) [OCR_VOTING]

 3. ONLINE   94f1ff445b974f69bf4e81716289b9a4 (/dev/asm-diske) [OCR_VOTING]

Located 3 voting disk(s).

+ASM1:/home/grid@rac1>crsctl replace votedisk +OCR_VOTING_NEW

Successful addition of voting disk 96680444ba324f25bf80413000858038.

Successful addition of voting disk 1510c41101ec4fbebf1f94b50d054e5a.

Successful addition of voting disk 889cb38a2f7f4feebffab52c8ad77ec5.

Successful deletion of voting disk 63f25efe70324f09bf4d4aec0127457b.

Successful deletion of voting disk 3906ddbefe474fe2bfa8799b293a30e1.

Successful deletion of voting disk 94f1ff445b974f69bf4e81716289b9a4.

Successfully replaced voting disk group with +OCRVOT_NEW.

CRS-4266: Voting file(s) successfully replaced

查询votedisk 存放目录

+ASM1:/home/grid@rac1>crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group

–  —–    —————–                ——— ———

 1. ONLINE   96680444ba324f25bf80413000858038 (/dev/asm-diskh) [OCR_VOTING_NEW]

 2. ONLINE   1510c41101ec4fbebf1f94b50d054e5a (/dev/asm-diski) [OCR_VOTING_NEW]

 3. ONLINE   889cb38a2f7f4feebffab52c8ad77ec5 (/dev/asm-diskj) [OCR_VOTING_NEW]

Located 3 voting disk(s).

 

查看集群状态:

+ASM1:/home/grid@rac1>crsctl stat res -t

登陆asm查看asmdisk信息

SQL> select group_number,name,state,type from v$asm_diskgroup;

GROUP_NUMBER NAME    STATE TYPE

———— —————————— ———– ——

  1 DATA     MOUNTED EXTERN

  2 FRA_ARC     MOUNTED EXTERN

  3 OCR_VOTING     MOUNTED NORMAL

  4 OCR_VOTING_NEW    MOUNTED NORMAL

 

 

SQL> select group_number,name,path from v$asm_disk;

 

 

GROUP_NUMBER       NAME                                                   PATH

———————-          ———————————————-        ——————————————————

  0                                                                            /dev/asm-diskk

  0                                                                            /dev/asm-diskl

  4                                   OCR_VOTING_NEW_0001                /dev/asm-diski

  4                                   OCR_VOTING_NEW_0002                /dev/asm-diskj

  4                                   OCR_VOTING_NEW_0000                /dev/asm-diskh

  1                                   DATA_0000                              /dev/asm-diskf

  2                                   FRA_ARC_0000                          /dev/asm-diskg

  3                                   OCR_VOTING_0001                      /dev/asm-diskd

  3                                   OCR_VOTING_0002                      /dev/asm-diske

  3                                   OCR_VOTING_0000                      /dev/asm-diskc

10 rows selected.

5.重建ASM spfile

SQL> show parameter spfile;

NAME     TYPE       VALUE

———————-    ——————————————————-

spfile     string         +OCR_VOTING/rac-cluster/asmparameterfile/registry.253.937566

111

SQL> create pfile='/u01/app/11.2.0/grid_1/dbs/asmpfile.ora' from spfile;

 

File created.

 SQL> create spfile='+OCRVOT_NEW' from pfile='/u01/app/11.2.0/grid_1/dbs/asmpfile.ora';

 

File created.

重启crs即可

[root@rac1 bin]# ./crsctl stop cluster -all

[root@rac1 bin]# ./crsctl start cluster -all

 

[root@rac1 bin]# su – grid

+ASM1:/home/grid@rac1>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 6 09:27:24 2017

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> show parameter spfile;

NAME     TYPE  VALUE

———————————— ———– ——————————

spfile     string OCR_VOTING_NEW /rac-cluster/as

mparameterfile/registry.253.93

7905815

 

查看ocr.loc(在集群重启后生效)

+ASM1:/home/grid@rac1>more /etc/oracle/ocr.loc

#Device/file +OCR_VOTING getting replaced by device +OCRVOT_NEW 

ocrconfig_loc=+ OCR_VOTING_NEW

local_only=false

6.删除旧的OCR+OCR_VOTING)

 切换root用户

[root@rac1 bin]# ./ocrconfig -delete +OCR_VOTING

删除磁盘组+OCR_VOTING//这里要注意一下,先要在rac2上先执行alter diskgroup OCR_VOTING dismount,然后再rac1上执行:

drop diskgroup  OCR_VOTING including contents; 还有执行以上的命令要用sysasm 用户登陆,不然没权限执行,具体如下:

rac2

sqlplus / as sysasm

SQL> alter diskgroup OCR_VOTING dismount;

Diskgroup altered.

SQL> select group_number,name,state,type from v$asm_diskgroup;

GROUP_NUMBER NAME    STATE TYPE

———— —————————— ———– ——

  1 DATA     MOUNTED EXTERN

  2 FRA_ARC     MOUNTED EXTERN

  3 OCR_VOTING_NEW    MOUNTED NORMAL

  0 OCR_VOTING     DISMOUNTED

SQL> /

rac1上:

sqlplus / as sysasm

SQL> select group_number,name,state,type from v$asm_diskgroup;

GROUP_NUMBER NAME    STATE TYPE

———— —————————— ———– ——

  1 DATA     MOUNTED EXTERN

  2 FRA_ARC     MOUNTED EXTERN

  3 OCR_VOTING_NEW    MOUNTED NORMAL

  4 OCR_VOTING     MOUNTED NORMAL

SQL> drop diskgroup  OCR_VOTING including contents;

Diskgroup dropped.

SQL> select group_number,name,state,type from v$asm_diskgroup;

 

 

GROUP_NUMBER NAME    STATE TYPE

———— —————————— ———– ——

  1 DATA     MOUNTED EXTERN

  2 FRA_ARC     MOUNTED EXTERN

  3 OCR_VOTING_NEW    MOUNTED NORMAL

 

 

 至此ocr 迁移(替换)已完成。这里在做每一步操作的时候建议都要看一下crs的日志。




Related posts

coded by nessus
分享:  DeliciousGReader鲜果豆瓣CSDN网摘
Trackback

no comment untill now

Add your comment now

无觅相关文章插件