11G的时候已经不支持裸设备的使用了(OUI已经没有裸设备相关选项,但是仍然可以通过手动方式间接使用),而推荐使用ASM。到12C的时候已经是完全不支持了。
注:Oracle Clusterware 12c does not support the use of raw or block devices. To upgrade to Oracle Clusterware 12c from a previous Oracle Clusterware release on which you were using raw or block devices, you must migrate OCR and voting files to Oracle ASM or a shared file system before you upgrade.
11G RAC默认安装的时候,OCR、VOTEDISK默认存放到DATA磁盘组中了,为了独立出来,考虑新建2个磁盘组,DATAVOTE和DATAOCR。下面是从默认位置迁移到相应位置的过程,记录备用。
[root@node1 bin]# ./ocrconfig -replace +DATA -replacement +DATAOCR
PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location
[root@node1 bin]# ./oerr prot 28
00028, 0, "Cannot delete or replace the only configured Oracle Cluster Registry location"
// *Cause: A delete or replace operation was performed when there was only 1
// configured Oracle Cluster Registry location. The above listed
// operation can only be performed when there are at least 2 configured
// Oracle Cluster Registry locations.
// *Action: Execute 'ocrconfig -add <new location>' to add the new Oracle
// Cluster Registry location followed by
// 'ocrconfig -delete <existing location>' command.
[root@node1 bin]# ./ocrconfig -add +DATAOCR
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 node2.
从上述信息来看应该添加失败。
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2856
Available space (kbytes) : 259264
ID : 387273031
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 succeeded
果然只有DATA
[root@node1 bin]# ./oerr proc 50
00050,1, "The Oracle Cluster Registry location to be added is inaccessible on nodes %s."
// *Cause: The Oracle Cluster Registry location to be added did not exist,
// was not mounted correctly or did not have the required permissions
// on the above listed nodes.
// *Action: Ensure that the location exists with appropriate permissions on the
// above listed nodes. If the location is an ASM disk group, the
// disk group must be mounted correctly; also check the entries in the
// ASM alert log file for more details.
节点2果然没有mount
[grid@node2 bin]$ ./sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 30 14:32: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> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
DATAVOTE DISMOUNTED
DATAOCR DISMOUNTED
SQL> alter diskgroup dataocr mount;
Diskgroup altered.
SQL> alter diskgroup datavote mount;
Diskgroup altered.
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
DATAVOTE MOUNTED
DATAOCR MOUNTED
重新添加一次:
[root@node1 bin]# ./ocrconfig -add +dataocr
PROT-30: The Oracle Cluster Registry location to be added is not usable
PROC-8: Cannot perform cluster registry operation because one of the parameters is invalid.
ORA-15056: additional error message
ORA-17502: ksfdcre:4 Failed to create file +DATAOCR.255.1
ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher
ORA-06512: at line 4
居然还报错,这里应该是说创建ocr配置文件的时候,所使用的asm磁盘组的兼容性属性的版本太旧。
眼见为实:
1* SELECT group_number, name, compatibility, database_compatibility FROM v$asm_diskgroup
SQL> /
GROUP_NUMBER NAME COMPATIBILITYDATABASE_COMPAT
------------ -------------------------------------------------- --------------- ---------------
1 DATA
11.2.0.0.0 10.1.0.0.0
2 DATAVOTE
10.1.0.0.0 10.1.0.0.0
3 DATAOCR
10.1.0.0.0 10.1.0.0.0
果然低于最低要求的11.1.0.0.0。修改之。
SQL> ALTER DISKGROUP DATAOCR SET ATTRIBUTE 'compatible.asm' = '11.2';
ALTER DISKGROUP DATAOCR SET ATTRIBUTE 'compatible.rdbms' = '10.1';
Diskgroup altered.
SQL>
Diskgroup altered.
SQL> SQL>
ALTER DISKGROUP datavote SET ATTRIBUTE 'compatible.asm' = '11.2';
ALTER DISKGROUP datavote SET ATTRIBUTE 'compatible.rdbms' = '10.1';SQL>
Diskgroup altered.
SQL>
Diskgroup altered.
SQL> SQL>
SQL> SELECT group_number, name, compatibility, database_compatibility FROM v$asm_diskgroup;
GROUP_NUMBER NAME COMPATIBILITYDATABASE_COMPAT
------------ -------------------------------------------------- --------------- ---------------
1 DATA
11.2.0.0.0 10.1.0.0.0
2 DATAVOTE
11.2.0.0.0 10.1.0.0.0
3 DATAOCR
11.2.0.0.0 10.1.0.0.0
再次添加:
[root@node1 bin]# ./ocrconfig -add +dataocr
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2848
Available space (kbytes) : 259272
ID : 387273031
Device/File Name : +DATA
Device/File integrity check succeeded
Device/File Name : +dataocr
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
再次迁移ocr的现有位置
[root@node1 bin]# ./ocrconfig -replace +DATA -replacement +DATAOCR
PROT-29: The Oracle Cluster Registry location is already configured
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2848
Available space (kbytes) : 259272
ID : 387273031
Device/File Name : +DATA
Device/File integrity check succeeded
Device/File Name : +dataocr
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
[root@node1 bin]# ./ocrconfig -delete +DATA
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2848
Available space (kbytes) : 259272
ID : 387273031
Device/File Name : +dataocr
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迁移完毕。
[root@node1 bin]# ./crsctl replace votedisk +datavote
Successful addition of voting disk a3f5c0a489374f17bf9abc0bc862e985.
Successful deletion of voting disk 4be6cc3ea3cf4f60bf5b05cbe662a3ee.
Successfully replaced voting disk group with +datavote.
CRS-4266: Voting file(s) successfully replaced
[root@node1 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE a3f5c0a489374f17bf9abc0bc862e985 (/dev/asm-vote) [DATAVOTE]
Located 1 voting disk(s).
至此VOTEDISK迁移完毕。