Oracle添加OCR镜像盘和镜像磁盘组的方法是什么
这篇文章主要讲解了“Oracle添加OCR镜像盘和镜像磁盘组的方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Oracle添加OCR镜像盘和镜像磁盘组的方法是什么”吧!
创新互联公司服务项目包括盘锦网站建设、盘锦网站制作、盘锦网页制作以及盘锦网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,盘锦网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到盘锦省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
添加OCR镜像盘/镜像磁盘组:
查看当前信息:
[grid
@rac1 rac1]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3288
Available space (kbytes) : 258832
ID : 785902757
Device/File Name : +OCR
[root @rac1 ~]# /oracle/grid/crs_1/bin/crsctl query css votedisk
## STATE File Universal Id File Name Disk group
\1. ONLINE 5d0d201e0ab24f66bf24bfd4a88f2f30 (/dev/asm-disk2) [OCR]
\2. ONLINE 9520d9d3ab8d4fefbfe5d05b62dac9cf (/dev/asm-disk3) [OCR]
\3. ONLINE 361f26ddd0b34feabfeba6a1123533d7 (/dev/asm-disk4) [OCR]
Located 3 voting disk(s).
添加镜像盘:
[root
@rac1 ~]# /oracle/grid/crs_1/bin/ocrconfig -add /dev/asm-disk5
[root
@rac1 ~]# /oracle/grid/crs_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3288
Available space (kbytes) : 258832
ID : 785902757
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File Name : /dev/asm-disk5
Device/File integrity check succeeded
删除镜像盘:
[root @rac1 ~]# /oracle/grid/crs_1/bin/ocrconfig -delete /dev/asm-disk5
单独镜像盘的意义在于使用裸设备存放OCR/VF时,可以镜像单个裸设备磁盘。
添加OCR镜像磁盘组:
(1)创建磁盘组:
create diskgroup OCR2 normal redundancy disk ‘/dev/asm-disk6’,’/dev/asm-disk7’ ,’/dev/asm-disk8’ ATTRIBUTE ‘compatible.asm’=’11.2.0.0.0’;
//在两节点检查该OCR2磁盘组是否都处于mount状态。
(2)添加OCR镜像磁盘组:
[root @rac1 ~]# /oracle/grid/crs_1/bin/ocrconfig -add +OCR2
(3)ocrcheck查看OCR设备
[grid
@rac1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3304
Available space (kbytes) : 258816
ID : 785902757
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File Name : +OCR2
Device/File integrity check succeeded
在镜像的磁盘和磁盘组中是没有Voting File信息的,也是无法添加的,VF只能使用replace替换掉当前VF磁盘组。
替换演示:
当前:
[grid @rac1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
\1. ONLINE 5d0d201e0ab24f66bf24bfd4a88f2f30 (/dev/asm-disk2) [OCR]
\2. ONLINE 9520d9d3ab8d4fefbfe5d05b62dac9cf (/dev/asm-disk3) [OCR]
\3. ONLINE 361f26ddd0b34feabfeba6a1123533d7 (/dev/asm-disk4) [OCR]
replace替换:
[root
@rac1 ~]# /oracle/grid/crs_1/bin/crsctl replace votedisk +OCR2
Successful addition of voting disk 3a6ec9fdcf4b4f3ebf8efebcbd5b748c.
Successful addition of voting disk 06963edca0eb4f3ebf78a5695cea1bc1.
Successful addition of voting disk 90dab584c1a24fc0bffa1c20b0aaf1d0.
Successful deletion of voting disk 5d0d201e0ab24f66bf24bfd4a88f2f30.
Successful deletion of voting disk 9520d9d3ab8d4fefbfe5d05b62dac9cf.
Successful deletion of voting disk 361f26ddd0b34feabfeba6a1123533d7.
Successfully replaced voting disk group with +OCR2.
CRS-4266: Voting file(s) successfully replaced
//从显示中可以看出deletion
查看已经发生变化:
[grid @rac1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
\1. ONLINE 3a6ec9fdcf4b4f3ebf8efebcbd5b748c (/dev/asm-disk6) [OCR2]
\2. ONLINE 06963edca0eb4f3ebf78a5695cea1bc1 (/dev/asm-disk7) [OCR2]
\3. ONLINE 90dab584c1a24fc0bffa1c20b0aaf1d0 (/dev/asm-disk8) [OCR2]
Located 3 voting disk(s).
如果我们在OCR/VF的磁盘组中添加一块磁盘,那么VF以及OCR会自动同步到这块新添加的磁盘嘛。
测试:
在OCR2磁盘组中添加一块磁盘
SQL> alter diskgroup ocr2 add disk ‘/dev/asm-disk5’;
crsctl查看无变化:
[grid @rac1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
\1. ONLINE 3a6ec9fdcf4b4f3ebf8efebcbd5b748c (/dev/asm-disk6) [OCR2]
\2. ONLINE 06963edca0eb4f3ebf78a5695cea1bc1 (/dev/asm-disk7) [OCR2]
\3. ONLINE 90dab584c1a24fc0bffa1c20b0aaf1d0 (/dev/asm-disk8) [OCR2]
视图查询:
SQL> select name,path,voting_file from v$asm_disk;
NAME PATH V
OCR2_0000 /dev/asm-disk6 Y
OCR_0000 /dev/asm-disk2 N
OCR_0001 /dev/asm-disk3 N
OCR_0002 /dev/asm-disk4 N
OCR2_0001 /dev/asm-disk7 Y
OCR2_0002 /dev/asm-disk8 Y
OCR2_0003 /dev/asm-disk5 N
DATA_0000 /dev/asm-disk1 N
从视图中看出新添加的盘并不是具有voting file,如果此时我踢掉一块盘,踢掉/dev/asm-disk6呢
删除/dev/asm-disk6
SQL> alter diskgroup ocr2 drop disk OCR2_0000;
注意这里需要写/dev/asm-disk6在ASM中对应的name 磁盘的别名。
Diskgroup altered.
再次查看(它来了!!!)
[grid @rac1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
\1. ONLINE 6b0b1252344a4f5fbf56d18ba7b4b49f (/dev/asm-disk7) [OCR2]
\2. ONLINE 78057d6e288c4f73bf4df35b12bc0686 (/dev/asm-disk8) [OCR2]
\3. ONLINE 30dbcc684e724ff5bf2e2e5e8279c2ab (/dev/asm-disk5)[OCR2]
通过视图查询:
select name,path,voting_file from v$asm_disk where path=’/dev/asm-disk5’;
NAME PATH V
OCR2_0003 /dev/asm-disk5 Y
感谢各位的阅读,以上就是“Oracle添加OCR镜像盘和镜像磁盘组的方法是什么”的内容了,经过本文的学习后,相信大家对Oracle添加OCR镜像盘和镜像磁盘组的方法是什么这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!
新闻名称:Oracle添加OCR镜像盘和镜像磁盘组的方法是什么
分享链接:http://cdiso.cn/article/ggojeg.html