设为首页 收藏本站
查看: 597|回复: 0

[经验分享] Moving OCR and Voting Disk to Oracle ASM Online

[复制链接]
YunVN网友  发表于 2016-8-17 06:12:40 |阅读模式
  Prior Oracle 11gR2, it was only possible to the OCR and Voting Disk files in multiple raw devices, shared between the nodes of a cluster.
From this version on, it’s very interesting to take the advantages and capabilities of ASM (striping and mirror) to store those files.
To store the OCR and Voting Disk files on a diskgroup, you must obey the following rules:
    If your diskgroup has “external” redundancy, it must have at least one disk associated.
    If your diskgroup has “normal” redundancy, it must have at least 3 disks associated, even though it can be create diskgroup with only 2 disks.
    If your diskgroup has “high” redundancy, it must have at least 5 disks associated, even though it can be create diskgroup with only 3 disks.
In this article, I will use the second option, normal redundancy. As in my server there are only 2 disks available for the diskgroup, I asked to the storage team to add another 1 GB disk:
[iyunv@orarac01 ~]# /etc/init.d/oracleasm listdisks
DATA01
OCRVOTE01
OCRVOTE02
The disk has already been available:
[iyunv@orarac01 ~]# multipath -ll
DATA01 (36000c29ab0accd959da8f1f78dd2de2f) dm-4 VMware,Virtual disk
size=300G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:2:0 sde 8:64 active ready running
OCRVOTE03 (36000c299550e110b041c9ab26acd33ac) dm-5 VMware,Virtual disk
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:3:0 sdf 8:80 active ready running
OCRVOTE02 (36000c29b67329567f6a6547d6fd3c769) dm-2 VMware,Virtual disk
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:0:0 sdc 8:32 active ready running
OCRVOTE01 (36000c29c1a57ee047d443991ef48894a) dm-3 VMware,Virtual disk
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:1:0 sdd 8:48 active ready running
Adding a new disk to oracleasm:
[iyunv@orarac01 ~]# /etc/init.d/oracleasm createdisk OCRVOTE03 /dev/dm-5
Marking disk "OCRVOTE03" as an ASM disk:                   [  OK  ]
[iyunv@orarac01 ~]# /etc/init.d/oracleasm listdisks
DATA01
OCRVOTE01
OCRVOTE02
OCRVOTE03
Enabling disk on another RAC node:
[iyunv@orarac02 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]
[iyunv@orarac02 ~]# /etc/init.d/oracleasm listdisks
DATA01
OCRVOTE01
OCRVOTE02
OCRVOTE03
[iyunv@orarac02 ~]#
The next step is to create the new ASM diskgroup
First, let’s try to put them as “High Redundancy” and see what happens.
CREATE DISKGROUP OCRVOTE HIGH REDUNDANCY
FAILGROUP OCRVOTE_FG01 DISK '/dev/oracleasm/disks/OCRVOTE01' NAME OCRVOTE01  SIZE 1024M
FAILGROUP OCRVOTE_FG02 DISK '/dev/oracleasm/disks/OCRVOTE02' NAME OCRVOTE02  SIZE 1024M
FAILGROUP OCRVOTE_FG03 DISK '/dev/oracleasm/disks/OCRVOTE03' NAME OCRVOTE03  SIZE 1024M
ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
[iyunv@orarac01 ~]# crsctl replace votedisk +OCRVOTE
Failed to create voting files on disk group OCRVOTE.
Change to configuration failed, but was successfully rolled back.
CRS-4000: Command Replace failed, or completed with errors.
[iyunv@orarac01 ~]# tail -n 200 $GRID_HOME/log/orarac01/client/crsctl_root.log
...
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: === clsssConfigLock ===
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: lock(0x2838a50), version(1), size(1088)
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: offsets(24), activever(186647296)
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: id(15), instantiation(5), incarn(1)
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: mapoff(28), configoff(548), mapsize(512)
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: state(10), holders(1), waiters(0)
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: committimestamp(0), commitstate(0)
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: === Map (of first 7 entries) ===
2013-06-18 11:46:13.220: [ CSSCLNT][278546160]clsssConfigLockTrace: 010 000 000 000 000 000 000
2013-06-18 11:46:13.221: [  CRSCTL][278546160]crsctl_replace_votedisk: calling kgfdvfPushDiskString
2013-06-18 11:46:13.397: [  CRSCTL][278546160]function crsctl_replace_votedisk, error 1 [clsuSlosFormatDiag called with non-error slos.]
.
 
2013-06-18 11:46:13.397: [  CRSCTL][278546160]crsctl_replace_votedisk: pushed the ASM DS to the profile 1
[   CLWAL][278546160]clsw_Initialize: OLR initlevel [30000]
2013-06-18 11:46:13.432: [  CRSCTL][278546160]crsctl_format_diskgroup: creating diskgroup OCRVOTE
2013-06-18 11:46:16.555: [  CRSCTL][278546160]function crsctl_format_diskgroup, error 1 SLOS: cat=-1, opn=(none), dep=(none), loc=ORA-01405: f
.
 
2013-06-18 11:46:16.555: [  CRSCTL][278546160]crsctl_format_diskgroup: diskgroup OCRVOTE creation with status 1. Please check the alert log file for ASM
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: === clsssConfigUnlock ===
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: lock(0x2837b50), version(1), size(1088)
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: offsets(24), activever(186647296)
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: id(15), instantiation(5), incarn(3)
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: mapoff(28), configoff(548), mapsize(512)
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: state(0), holders(0), waiters(0)
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: committimestamp(0), commitstate(0)
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: === Map (of first 7 entries) ===
2013-06-18 11:46:16.568: [ CSSCLNT][278546160]clsssConfigLockTrace: 000 000 000 000 000 000 000
...
[iyunv@orarac01 ~]# tail -n 500 /u01/app/grid/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log
...
Tue Jun 18 11:46:13 2013
NOTE: Creating voting files in diskgroup OCRVOTE
Tue Jun 18 11:46:13 2013
NOTE: Voting File refresh pending for group 2/0x7f386577 (OCRVOTE)
NOTE: Attempting voting file creation in diskgroup OCRVOTE
NOTE: voting file allocation on grp 2 disk OCRVOTE_0000
NOTE: voting file allocation on grp 2 disk OCRVOTE_0001
NOTE: voting file allocation on grp 2 disk OCRVOTE_0002
ERROR: Voting file allocation failed for group OCRVOTE
Errors in file /u01/app/grid/diag/asm/+asm/+ASM1/trace/+ASM1_ora_6301.trc:
ORA-15274: Not enough failgroups (5) to create voting files
NOTE: Attempting voting file refresh on diskgroup OCRVOTE
NOTE: Voting file relocation is required in diskgroup OCRVOTE
NOTE: Attempting voting file relocation on diskgroup OCRVOTE
NOTE: voting file deletion on grp 2 disk OCRVOTE_0000
NOTE: voting file deletion on grp 2 disk OCRVOTE_0001
NOTE: voting file deletion on grp 2 disk OCRVOTE_0002
...
The error is that it is necessary at least 5 failgroups to create the Voting Disk.
We will then recreate them with the correct redundancy:
CREATE DISKGROUP OCRVOTE NORMAL REDUNDANCY
FAILGROUP OCRVOTE_FG01 DISK '/dev/oracleasm/disks/OCRVOTE01' NAME OCRVOTE01  SIZE 1024M
FAILGROUP OCRVOTE_FG02 DISK '/dev/oracleasm/disks/OCRVOTE02' NAME OCRVOTE02  SIZE 1024M
FAILGROUP OCRVOTE_FG03 DISK '/dev/oracleasm/disks/OCRVOTE03' NAME OCRVOTE03  SIZE 1024M
ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
   
[iyunv@orarac01 ~]# crsctl replace votedisk +OCRVOTE
Successful addition of voting disk 05ca1320e3244f70bf45d1fc37d325d5.
Successful addition of voting disk 1affc0b6da314fe8bfd8dec18af4923b.
Successful addition of voting disk 3d87bf2793e04fe4bfd6764f24ffafb1.
Successful deletion of voting disk 4c9ddcb1acd14f27bf77652370a1a5b1.
Successfully replaced voting disk group with +OCRVOTE.
CRS-4266: Voting file(s) successfully replaced
[iyunv@orarac01 ~]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
1. ONLINE   05ca1320e3244f70bf45d1fc37d325d5 (/dev/oracleasm/disks/OCRVOTE01) [OCRVOTE]
2. ONLINE   1affc0b6da314fe8bfd8dec18af4923b (/dev/oracleasm/disks/OCRVOTE02) [OCRVOTE]
3. ONLINE   3d87bf2793e04fe4bfd6764f24ffafb1 (/dev/oracleasm/disks/OCRVOTE03) [OCRVOTE]
Located 3 voting disk(s).
The Voting Disk step is done.
The next step is the CRS. Note that we are transferring him from another diskgroup (+DATA), which is used to store datafiles, to this another diskgroup recently created:
[iyunv@orarac01 ~]# ocrconfig -replace +DATA -replacement +OCRVOTE
PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location
As we have only one OCR location configured, the “replace” command doesn’t work. We’ll need to add another one and delete the old:
[iyunv@orarac01 ~]# ocrconfig -add +OCRVOTE
[iyunv@orarac01 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2836
         Available space (kbytes) :     259284
         ID                       : 1089167638
         Device/File Name         :      +DATA
                                    Device/File integrity check succeeded
         Device/File Name         :   +OCRVOTE
                                    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
Now erase the old:
   
[iyunv@orarac01 ~]# ocrconfig -delete +DATA
[iyunv@orarac01 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2836
         Available space (kbytes) :     259284
         ID                       : 1089167638
         Device/File Name         :   +OCRVOTE
                                    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
 
[iyunv@orarac01 ~]# cat /etc/oracle/ocr.loc
#Device/file +DATA getting replaced by device +OCRVOTE
ocrconfig_loc=+OCRVOTE
local_only=false

Done!

参考至:http://www.dbarj.com.br/en/2013/06/moving-ocr-voting-disk-to-oracle-asm-online/
如有错误,欢迎指正
邮箱:czmcj@163.com

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-258672-1-1.html 上篇帖子: jdbc实现篇-源码(Oracle、MySQL)之Connection创建过程 下篇帖子: Oracle数据库的连接(OCI方式、thin方式和JdbcOdbc桥方式)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表