您好,登錄后才能下訂單哦!
這篇文章主要講解了“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鏡像盤和鏡像磁盤組的方法是什么這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。