标题: 修改ocr及votedisk所在磁盘组位置 [打印本页] 作者: miss_puff 时间: 2017-6-30 17:47 标题: 修改ocr及votedisk所在磁盘组位置 1、查看当前OCR磁盘信息
[grid@rac01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3084
Available space (kbytes) : 259036
ID : 798935356
Device/File Name : +DATA
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
[grid@rac01 ~]$
2、查看votedisk磁盘信息
[grid@rac01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 486e881d6d4b4f89bf2fc61d08b12381 (/dev/raw/raw1) [DATA]
Located 1 voting disk(s).
[grid@rac01 ~]$
从上述信息可以看出,OCR和VOTE还有数据文件都存放在DATA磁盘组。这里我新建一个磁盘组单独用来保存OCR文件。
3、创建磁盘组OCRDATA
SQL> create diskgroup OCRDATA External Redundancy disk '/dev/asm-disk1' attribute 'compatible.asm'='11.2', 'compatible.rdbms'='11.2';
create diskgroup OCRDATA External Redundancy disk '/dev/asm-disk1' attribute 'compatible.asm'='11.2', 'compatible.rdbms'='11.2'
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification '/dev/asm-disk1' matches no disks
ORA-15014: path '/dev/asm-disk1' is not in the discovery set
SQL> alter system set asm_diskstring='/dev/as*','/dev/raw/raw*';
作者: miss_puff 时间: 2017-6-30 17:48
4、添加新的OCR磁盘组
[root@rac01 bin]# ./ocrconfig -add +OCRDATA
PROT-30: The Oracle Cluster Registry location to be added is not usable
PROC-50: The Oracle Cluster Registry location to be added is inaccessible on nodes rac02.
[root@rac01 bin]#
添加磁盘组报错了,检查节点2磁盘组信息发现OCRDATA磁盘组没有挂载。
SQL> select group_number,name,state from v$asm_diskgroup;
GROUP_NUMBER NAME STATE
------------ ------------------------------ -----------
1 DATA MOUNTED
2 FRA MOUNTED
0 OCRDATA DISMOUNTED
解决办法:挂载该磁盘组
SQL> alter diskgroup ocrdata mount;
Diskgroup altered.
SQL> select group_number,name,state from v$asm_diskgroup;
GROUP_NUMBER NAME STATE
------------ ------------------------------ -----------
1 DATA MOUNTED
2 FRA MOUNTED
3 OCRDATA MOUNTED
SQL>
再次添加成功:
[root@rac01 bin]# ./ocrconfig -add +OCRDATA作者: miss_puff 时间: 2017-6-30 17:48
5、检查添加的磁盘组
[root@rac01 bin]# ./ocrcheck -config
Oracle Cluster Registry configuration is :
Device/File Name : +DATA
Device/File Name : +OCRDATA
[root@rac01 bin]# more /etc/oracle/ocr.loc
#Device/file getting replaced by device +OCRDATA
ocrconfig_loc=+DATA
ocrmirrorconfig_loc=+OCRDATA
local_only=false
[root@rac01 bin]#
6、删除原来的磁盘组
[root@rac01 bin]# ./ocrconfig -delete +data
[root@rac01 bin]# more /etc/oracle/ocr.loc
#Device/file +DATA getting replaced by device +OCRDATA
ocrconfig_loc=+OCRDATA
local_only=false
[root@rac01 bin]#作者: miss_puff 时间: 2017-6-30 17:48
7、恢复VOTEDISK
[root@rac01 bin]# ./crsctl replace votedisk +OCRDATA
Successful addition of voting disk 0fea7027099c4f7cbf52350dbdd48020.
Successful deletion of voting disk 486e881d6d4b4f89bf2fc61d08b12381.
Successfully replaced voting disk group with +OCRDATA.
CRS-4266: Voting file(s) successfully replaced
[root@rac01 bin]#作者: miss_puff 时间: 2017-6-30 17:49
8、验证成功
[root@rac01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3100
Available space (kbytes) : 259020
ID : 798935356
Device/File Name : +OCRDATA
Device/File integrity check succeeded
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA/rac-cluster/asmparameter
file/registry.253.944210033
SQL> create spfile='+OCRDATA' from pfile='/home/grid/pfile.ora';
File created.
重新启动集群
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +OCRDATA/rac-cluster/asmparame
terfile/registry.253.945439863
SQL>