某支付系统11g 11.2.0.4 RAC 安装时选择了3个2g的LUN,但OCR vote选择的外部冗余方式,由于单个ocrvote容易触发数据库bug
因此需要对其冗余方式进行修改
当前RAC现有的ASM DG ,均为外部冗余方式
+DATA01
+OCR
+FRA
首先用shudown immediate 方式关闭两个数据库实例,确保集群重启时不自动启动数据库
待OCR vote替换完成后再用SRVCTL命令重新启动数据库
1.首先查看ocr的备份
[root@zfrac01 bin]# ./ocrconfig -showbackup
PROT-24: Auto backups for the Oracle Cluster Registry are not available
zfrac01 2015/02/05 17:22:42 /u01/app/11.2/product/crs_1/cdata/zfrac-cluster/backup_20150205_172242.ocr
2.执行一次手动备份
[root@zfrac01 bin]# ./ocrconfig -manualbackup
zfrac01 2015/02/05 19:10:01 /u01/app/11.2/product/crs_1/cdata/zfrac-cluster/backup_20150205_191001.ocr
zfrac01 2015/02/05 17:22:42 /u01/app/11.2/product/crs_1/cdata/zfrac-cluster/backup_20150205_172242.ocr
3.移动OCR位置
[root@zfrac01 bin]# ./ocrconfig -replace +OCR -replacement +FRA
PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location
注:当OCR只有一份是是不允许移动的
4.给OCR添加新的DG,增加FRA至OCR组
[root@zfrac01 bin]# ./ocrconfig -add +FRA
5.检查现在OCR位置
[root@zfrac01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3148
Available space (kbytes) : 258972
ID : 114225306
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File Name : +FRA
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
6.删除的来的OCR dg
[root@zfrac01 bin]# ./ocrconfig -delete +ocr
7.再次检查OCR,现在只有一份FRA DG了
[root@zfrac01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3148
Available space (kbytes) : 258972
ID : 114225306
Device/File Name : +FRA
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
8.移动votedisk至FRA
[root@zfrac01 bin]# ./crsctl replace votedisk +fra
Successful addition of voting disk a43a8ffd01d04f04bf0cf646c7f3d98b.
Successful deletion of voting disk 5e8b9833ccc34febbf6632293bc0d5ac.
Successfully replaced voting disk group with +fra.
CRS-4266: Voting file(s) successfully replaced
9.查看votedisk现在位置
[root@zfrac01 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE a43a8ffd01d04f04bf0cf646c7f3d98b (/dev/mapper/fra01) [FRA]
Located 1 voting disk(s).
10.创建新的ASM实例pfile
[root@zfrac01 bin]# su - grid
[grid@zfrac01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 5 19:30:34 2015
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/zfrac-cluster/asmparamete
rfile/registry.253.870883851
SQL> create pfile=/home/grid/asminit.ora
2
SQL> create pfile='/home/grid/asminit.ora' from spfile='+OCR/zfrac-cluster/asmparameterfile/registry.253.870883851';
File created.
11.查看file内容
SQL> ! more /home/grid/asminit.ora
+ASM1.asm_diskgroups='DATA01','FRA'#Manual Mount
+ASM2.asm_diskgroups='DATA01','FRA'#Manual Mount
*.asm_diskstring='/dev/mapper/*'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
12.关闭实例,用新的pfile启动ASM
[grid@zfrac01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 5 19:34:36 2015
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> shutdown abort
ASM instance shutdown
SQL> startup pfile='/home/grid/asminit.ora';
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
13.查看asm disk状态
SQL> select name from v$asm_disk;
NAME
------------------------------
FRA_0000
DATA01_0001
DATA01_0000
6 rows selected.
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
DATA01
FRA
OCR
14.创建新的ASM spfile
SQL> create spfile='+FRA' from pfile='/home/grid/asminit.ora';
File created.
15.重新启动ASM实例
SQL> shutdown abort
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
16.查看新的spfile位置
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +FRA/zfrac-cluster/asmparamete
rfile/registry.253.870896209
17.以root用户重新启动两个节点的集群,确保集群重启后资源正常(节点1,2启动方法一样)
[root@zfrac01 bin]# ./crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'zfrac01'
CRS-2673: Attempting to stop 'ora.crsd' on 'zfrac01'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'zfrac01'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.DATA01.dg' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.oc4j' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.cvu' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'zfrac01'
CRS-2677: Stop of 'ora.cvu' on 'zfrac01' succeeded
CRS-2672: Attempting to start 'ora.cvu' on 'zfrac02'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'zfrac01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.zfrac01.vip' on 'zfrac01'
CRS-2676: Start of 'ora.cvu' on 'zfrac02' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.DATA01.dg' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.registry.acfs' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'zfrac01' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'zfrac02'
CRS-2677: Stop of 'ora.zfrac01.vip' on 'zfrac01' succeeded
CRS-2672: Attempting to start 'ora.zfrac01.vip' on 'zfrac02'
CRS-2676: Start of 'ora.scan1.vip' on 'zfrac02' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'zfrac02'
CRS-2677: Stop of 'ora.oc4j' on 'zfrac01' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'zfrac02'
CRS-2676: Start of 'ora.zfrac01.vip' on 'zfrac02' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'zfrac02' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'zfrac01'
CRS-2677: Stop of 'ora.asm' on 'zfrac01' succeeded
CRS-2676: Start of 'ora.oc4j' on 'zfrac02' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'zfrac01'
CRS-2677: Stop of 'ora.ons' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'zfrac01'
CRS-2677: Stop of 'ora.net1.network' on 'zfrac01' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'zfrac01' has completed
CRS-2677: Stop of 'ora.crsd' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.ctssd' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.evmd' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.asm' on 'zfrac01'
CRS-2677: Stop of 'ora.evmd' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.asm' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'zfrac01'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'zfrac01'
CRS-2677: Stop of 'ora.cssd' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'zfrac01'
CRS-2677: Stop of 'ora.crf' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'zfrac01'
CRS-2677: Stop of 'ora.gipcd' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'zfrac01'
CRS-2677: Stop of 'ora.gpnpd' on 'zfrac01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'zfrac01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@zfrac01 bin]# ./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
18.检查磁盘组状态
[root@zfrac01 bin]# ps -ef | grep smon
root 5835 1 0 19:45 ? 00:00:00 /u01/app/11.2/product/crs_1/bin/osysmond.bin
grid 6333 1 0 19:46 ? 00:00:00 asm_smon_+ASM1
root 6603 534 0 19:46 pts/6 00:00:00 grep smon
[root@zfrac01 bin]# su - grid
[grid@zfrac01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 5 19:46:34 2015
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> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA01 MOUNTED
FRA MOUNTED
OCR MOUNTED
19.卸载原有的OCR dg
SQL> alter diskgroup ocr dismount;
Diskgroup altered.
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA01 MOUNTED
FRA MOUNTED
OCR DISMOUNTED
可以尝试在节点1删除OCR 发现不能删除
SQL> drop diskgroup OCR including contents;
drop diskgroup OCR including contents
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "OCR" does not exist or is not mounted
20.在另外一个RAC节点执行删除命令
SQL> drop diskgroup OCR including contents;
在两节点查询DG
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA01 MOUNTED
FRA MOUNTED
21.ASMCA重新创建OCR,更改normal方式的冗余方式
22.创建好后查看新的OCR dg状态
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA01 MOUNTED
FRA MOUNTED
OCR MOUNTED
23.查看当前OCR位置
[root@zfrac01 bin]#
[root@zfrac01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3144
Available space (kbytes) : 258976
ID : 114225306
Device/File Name : +FRA
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
24.添加新创建的OCR dg
[root@zfrac01 bin]# ./ocrconfig -add +OCR
25.删除FRA DG
[root@zfrac01 bin]# ./ocrconfig -delete +fra
26.再次查看OCR
[root@zfrac01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3144
Available space (kbytes) : 258976
ID : 114225306
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
27.查询votedisk
[root@zfrac01 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE a43a8ffd01d04f04bf0cf646c7f3d98b (/dev/mapper/fra01) [FRA]
Located 1 voting disk(s).
28.移动votedisk至新的OCR dg
[root@zfrac01 bin]# ./crsctl replace votedisk +OCR
Successful addition of voting disk 5a47055f7f9a4f8ebf3bc4f1e66bc1e1.
Successful addition of voting disk 2f171ddcba8a4f9fbfb5151e2c70ae0f.
Successful addition of voting disk 25071dacb4094f43bfe78bf1e5034431.
Successful deletion of voting disk a43a8ffd01d04f04bf0cf646c7f3d98b.
Successfully replaced voting disk group with +OCR.
CRS-4266: Voting file(s) successfully replaced
[root@zfrac01 bin]#
29.再次查看votedisk
[root@zfrac01 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 5a47055f7f9a4f8ebf3bc4f1e66bc1e1 (/dev/mapper/ocr01) [OCR]
2. ONLINE 2f171ddcba8a4f9fbfb5151e2c70ae0f (/dev/mapper/ocr02) [OCR]
3. ONLINE 25071dacb4094f43bfe78bf1e5034431 (/dev/mapper/ocr03) [OCR]
Located 3 voting disk(s).
30.重新创建asm spfile
[root@zfrac01 bin]# su - grid
[grid@zfrac01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 5 19:51:59 2015
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 +FRA/zfrac-cluster/asmparamete
rfile/registry.253.870896209
SQL> shutdown abort
ASM instance shutdown
以pfile启动asm实例
SQL> startup pfile='/home/grid/asminit.ora';
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> select name ,state from v$asm_disk;
NAME STATE
------------------------------ --------
FRA_0000 NORMAL
DATA01_0001 NORMAL
DATA01_0000 NORMAL
OCR_0002 NORMAL
OCR_0001 NORMAL
OCR_0000 NORMAL
6 rows selected.
SQL> select name ,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA01 MOUNTED
FRA MOUNTED
OCR MOUNTED
31.创建新的spfile
SQL> create spfile='+OCR' from pfile='/home/grid/asminit.ora';
File created.
关闭asm实例
SQL> shutdown abort
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
32.重启两个节点crs
[root@zfrac01 bin]# ./crsctl stop crs -f (节点1,2方法一致)
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'zfrac01'
CRS-2673: Attempting to stop 'ora.crsd' on 'zfrac01'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'zfrac01'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.DATA01.dg' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.cvu' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.oc4j' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.zfrac01.vip' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'zfrac01'
CRS-2677: Stop of 'ora.DATA01.dg' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.cvu' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'zfrac01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.registry.acfs' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'zfrac01'
CRS-2677: Stop of 'ora.asm' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.zfrac01.vip' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.zfrac02.vip' on 'zfrac01'
CRS-2677: Stop of 'ora.scan1.vip' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.zfrac02.vip' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'zfrac01'
CRS-2677: Stop of 'ora.ons' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'zfrac01'
CRS-2677: Stop of 'ora.net1.network' on 'zfrac01' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'zfrac01' has completed
CRS-2677: Stop of 'ora.crsd' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.ctssd' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.evmd' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.asm' on 'zfrac01'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'zfrac01'
CRS-2677: Stop of 'ora.evmd' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'zfrac01' succeeded
CRS-2677: Stop of 'ora.asm' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'zfrac01'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'zfrac01'
CRS-2677: Stop of 'ora.cssd' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'zfrac01'
CRS-2677: Stop of 'ora.crf' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'zfrac01'
CRS-2677: Stop of 'ora.gipcd' on 'zfrac01' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'zfrac01'
CRS-2677: Stop of 'ora.gpnpd' on 'zfrac01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'zfrac01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@zfrac01 bin]# ./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.