11G下OCR\VOTINGDISK存储位置迁移

原创 2016年05月30日 15:24:37

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迁移完毕。


版权声明:本文为博主原创文章,未经博主允许不得转载。

如何恢复,迁移,添加, 删除 Voting Disks

如何恢复,迁移,添加, 删除 Voting Disks 恢复流程 在11gR2 之前,我们可以直接直接使用dd命令对voting disk进行备份。 DD示例 备份vo...

迁移OCR、表决磁盘和asm spfile到其他磁盘组中

本文参考:https://levipereira.wordpress.com/2012/01/11/explaining-how-to-store-ocr-voting-disks-and-asm-s...

Voting Disk和OCR基础、管理、备份和恢复

Voting Disk和OCR基础、管理、备份和恢复 Voting Disk介绍 voting disk管理 OCR管理 voting disk备份 voting disk恢复 OCR备份 OCR恢复...

添加磁盘组存储OCR数据报错

[root@rac2 bin]# ./ocrconfig -add +OCR_DATA PROT-30: The Oracle Cluster Registry location to be adde...

Oracle 10g RAC OCR 和 VotingDisk 的备份与恢复

一.  Voting Disk Voting Disk 这个文件主要用于记录节点成员状态,在出现脑裂时,决定那个Partion获得控制权,其他的Partion必须从集群中剔除。Voting disk...
  • jolly10
  • jolly10
  • 2012年08月31日 14:45
  • 490

RAC ocr和votingdisk文件损坏恢复

rac+asm ocr文件和votingdisk文件损坏恢复 1、ocr自动备份与恢复方法 1) 自动备份 oracle会每小时备份一次ocr,自动备份的默认路径是:$CRS_HOME/cdat...
  • RuleV5
  • RuleV5
  • 2011年12月06日 10:33
  • 3491

Oracle:解析OCR与VotingDisk以及其管理

解析OCR与VotingDisk以及其管理 Voting Disk和OCR是Oracle Clusterware的2部分。Voting Disk里面记录着节点成员的信息。如RAC数据库中有哪些节...

解析OCR与VotingDisk以及其管理

解析OCR与VotingDisk以及其管理 http://tech.diannaodian.com/dw/data/oracle/2011/1112/142760.html Voting Di...

【oracle11g,18】存储结构:临时表,手工条带化,表/索引迁移表空间,删除表,外部表

【oracle11g,18】存储结构:临时表,手工条带化,表/索引迁移表空间,删除表,外部表...

Oracle 11g Rac Votedisk、OCR以及各种资源的管理

题:Oracle 11g Rac 维护相对与10g而言难度有些许的增加,命令也多了一些,下面对11g rac 的Votedisk、OCR以及各种资源维护时用到的一些命令进行总结,方便日后查看。   ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:11G下OCR\VOTINGDISK存储位置迁移
举报原因:
原因补充:

(最多只允许输入30个字)