遷移OCR和VotingDisk並刪除原ASM磁碟組
近期由於儲存問題,需要將系統遷移到別的儲存上承載,OCR和VotingDisk遷移之前也做過幾次,但是沒有找到實操記錄,這裡重新記一次。
本身OCR和VotingDisk遷移是可以線上完成的,這個很好,可惜的是ASM的spfile的遷移需要重啟ASM例項,這個比較麻煩;不知道有沒有辦法線上遷移ASM的spfile的。
# oracleasm listdisks
DATADG1
OCR1
OCR2
OCR3
/etc/init.d/oracleasm createdisk NOCR1 /dev/sde1
/etc/init.d/oracleasm createdisk NOCR2 /dev/sdf1
/etc/init.d/oracleasm createdisk NOCR3 /dev/sdg1
# oracleasm listdisks
DATADG1
NOCR1
NOCR2
NOCR3
OCR1
OCR2
OCR3
SQL> col name for a10
SQL> col path for a40
SQL> select name ,path from v$asm_disk;
NAME PATH
---------- ----------------------------------------
ORCL:NOCR1
ORCL:NOCR2
ORCL:NOCR3
DATADG1 ORCL:DATADG1
OCR1 ORCL:OCR1
OCR2 ORCL:OCR2
OCR3 ORCL:OCR3
7 rows selected.
SQL> set linesize 200
SQL> col name for a20
SQL> select inst_id,name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb from gv$asm_diskgroup;
INST_ID NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB
---------- -------------------- -------------------- ---------------------- ---------- ---------- --------------
2 DATADG 1048576 MOUNTED 8189 6484 6484
2 OCRDG 1048576 MOUNTED 6141 5215 1584
1 DATADG 1048576 MOUNTED 8189 6484 6484
1 OCRDG 1048576 MOUNTED 6141 5215 1584
SQL> select name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb,type from v$asm_diskgroup;
NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB TYPE
-------------------- -------------------- ---------------------- ---------- ---------- -------------- ------------
DATADG 1048576 MOUNTED 8189 6484 6484 EXTERN
OCRDG 1048576 MOUNTED 6141 5215 1584 NORMAL
SQL> select failgroup, name from v$asm_disk where group_number=(select group_number from v$asm_diskgroup where name = 'OCRDG');
FAILGROUP NAME
------------------------------------------------------------ --------------------
OCR1 OCR1
OCR2 OCR2
OCR3 OCR3
create diskgroup NOCRDG normal redundancy
FAILGROUP fgocr1 disk 'ORCL:NOCR1'
FAILGROUP fgocr2 disk 'ORCL:NOCR2'
FAILGROUP fgocr3 disk 'ORCL:NOCR3' ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
SQL> create diskgroup NOCRDG normal redundancy
2 FAILGROUP fgocr1 disk 'NOCR1'
3 FAILGROUP fgocr2 disk 'NOCR2'
4 FAILGROUP fgocr3 disk 'NOCR3' ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
create diskgroup NOCRDG normal redundancy
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification 'NOCR3' matches no disks
ORA-15031: disk specification 'NOCR2' matches no disks
ORA-15031: disk specification 'NOCR1' matches no disks
SQL>
SQL> create diskgroup NOCRDG normal redundancy
2 FAILGROUP fgocr1 disk 'ORCL:NOCR1'
3 FAILGROUP fgocr2 disk 'ORCL:NOCR2'
4 FAILGROUP fgocr3 disk 'ORCL:NOCR3' ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
Diskgroup created.
SQL> select inst_id,name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb from gv$asm_diskgroup;
INST_ID NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB
---------- -------------------- -------------------- ---------------------- ---------- ---------- --------------
2 DATADG 1048576 MOUNTED 8189 6484 6484
2 OCRDG 1048576 MOUNTED 6141 5215 1584
2 NOCRDG 0 DISMOUNTED 0 0 0
1 DATADG 1048576 MOUNTED 8189 6484 6484
1 OCRDG 1048576 MOUNTED 6141 5215 1584
1 NOCRDG 1048576 MOUNTED 6141 5988 1970
6 rows selected.
SQL> alter diskgroup NOCRDG mount;
alter diskgroup NOCRDG mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "NOCRDG" cannot be mounted
ORA-15013: diskgroup "NOCRDG" is already mounted
---下面在另外一個節點將磁碟mount上。
SQL> alter diskgroup NOCRDG mount;
Diskgroup altered.
SQL> select inst_id,name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb from gv$asm_diskgroup;
INST_ID NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB
---------- -------------------- -------------------- ---------------------- ---------- ---------- --------------
1 DATADG 1048576 MOUNTED 8189 6484 6484
1 OCRDG 1048576 MOUNTED 6141 5215 1584
1 NOCRDG 1048576 MOUNTED 6141 5862 1907
2 DATADG 1048576 MOUNTED 8189 6484 6484
2 OCRDG 1048576 MOUNTED 6141 5215 1584
2 NOCRDG 1048576 MOUNTED 6141 5862 1907
6 rows selected.
SQL> select name,compatibility from gv$asm_diskgroup;
NAME COMPATIBILITY
-------------------- ---------------------------------------------
DATADG 11.2.0.0.0
OCRDG 11.2.0.0.0
NOCRDG 11.2.0.0.0
DATADG 11.2.0.0.0
OCRDG 11.2.0.0.0
NOCRDG 11.2.0.0.0
6 rows selected.
SQL> select name,state from v$asm_disk;
NAME STATE
-------------------- ----------------
DATADG1 NORMAL
NOCR1 NORMAL
NOCR2 NORMAL
NOCR3 NORMAL
OCR1 NORMAL
OCR2 NORMAL
OCR3 NORMAL
7 rows selected.
----上面是建立磁碟組操作,下面進行OCR遷移---
[grid@rac11g01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2952
Available space (kbytes) : 259168
ID : 869504304
Device/File Name : +OCRDG
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 bypassed due to non-privileged user
新增ocr磁碟組
$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 66d6304135f94f2ebf810423579f56f5 (ORCL:OCR1) [OCRDG]
2. ONLINE 7686f167dfe84fe6bfac809a732a3216 (ORCL:OCR2) [OCRDG]
3. ONLINE 0d1bd4c060464f5cbf4d0ae08855db33 (ORCL:OCR3) [OCRDG]
# /u01/app/11.2/grid/bin/ocrconfig -manualbackup
rac11g01 2018/04/13 16:43:00 /u01/app/11.2/grid/cdata/backup_20180413_164300.ocr
rac11g01 2018/04/13 16:36:01 /u01/app/11.2/grid/cdata/backup_20180413_163601.ocr
rac11g01 2018/04/13 16:31:53 /u01/app/11.2/grid/cdata/backup_20180413_163153.ocr
rac11g01 2018/04/13 16:30:56 /u01/app/11.2/grid/cdata/backup_20180413_163056.ocr
rac11g01 2018/04/13 16:30:40 /u01/app/11.2/grid/cdata/backup_20180413_163040.ocr
# /u01/app/11.2/grid/bin/ocrconfig -showbackup
[root@rac11g01 bin]# ./ocrconfig -add +NOCRDG
[root@rac11g01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3064
Available space (kbytes) : 259056
ID : 869504304
Device/File Name : +OCRDG
Device/File integrity check succeeded
Device/File Name : +NOCRDG
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@rac11g01 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 66d6304135f94f2ebf810423579f56f5 (ORCL:OCR1) [OCRDG]
2. ONLINE 7686f167dfe84fe6bfac809a732a3216 (ORCL:OCR2) [OCRDG]
3. ONLINE 0d1bd4c060464f5cbf4d0ae08855db33 (ORCL:OCR3) [OCRDG]
Located 3 voting disk(s).
--替換OCR
---這個時候直接刪除舊的OCR指定舊的磁碟組即可,不需要再替換。
---這裡的刪除只代表OCR不在使用該磁碟組,但是Voting還在使用,還需遷移。
# ./ocrconfig -replace +OCRDG -replacement +NOCRDG
PROT-29: The Oracle Cluster Registry location is already configured
---刪除舊的磁碟組
# ./ocrconfig -delete +OCRDG
[root@rac11g01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3064
Available space (kbytes) : 259056
ID : 869504304
Device/File Name : +NOCRDG
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
---遷移Voting Disk,只需要grid使用者替換即可,無需root使用者操作
[grid@rac11g01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 66d6304135f94f2ebf810423579f56f5 (ORCL:OCR1) [OCRDG]
2. ONLINE 7686f167dfe84fe6bfac809a732a3216 (ORCL:OCR2) [OCRDG]
3. ONLINE 0d1bd4c060464f5cbf4d0ae08855db33 (ORCL:OCR3) [OCRDG]
Located 3 voting disk(s).
[grid@rac11g01 ~]$ crsctl replace votedisk +NOCRDG
Successful addition of voting disk 7d7aa071dcb44f18bfdc26f87f04462d.
Successful addition of voting disk 1063860a39224ff4bf667d5d1e31b765.
Successful addition of voting disk 65056f3f96494fc4bfa7214b3265cbd3.
Successful deletion of voting disk 66d6304135f94f2ebf810423579f56f5.
Successful deletion of voting disk 7686f167dfe84fe6bfac809a732a3216.
Successful deletion of voting disk 0d1bd4c060464f5cbf4d0ae08855db33.
Successfully replaced voting disk group with +NOCRDG.
CRS-4266: Voting file(s) successfully replaced
[grid@rac11g01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7d7aa071dcb44f18bfdc26f87f04462d (ORCL:NOCR1) [NOCRDG]
2. ONLINE 1063860a39224ff4bf667d5d1e31b765 (ORCL:NOCR2) [NOCRDG]
3. ONLINE 65056f3f96494fc4bfa7214b3265cbd3 (ORCL:NOCR3) [NOCRDG]
Located 3 voting disk(s).
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 8189 6454 0 6454 0 N DATADG/
MOUNTED NORMAL N 512 4096 1048576 6141 5217 2047 1585 0 Y NOCRDG/
MOUNTED NORMAL N 512 4096 1048576 6141 5311 2047 1632 0 N OCRDG/
---遷移ASM spfile
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string +OCRDG/rac11g-scan/asmparamete
rfile/registry.253.973341853
SQL> create pfile='/tmp/asmpfile.ora' from spfile;
File created.
SQL> create spfile='+NOCRDG' from pfile='/tmp/asmpfile.ora';
File created.
SQL>
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string +OCRDG/rac11g-scan/asmparamete
rfile/registry.253.973341853
SQL>
--這裡需要重啟ASM例項才生效,重啟後:
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string +NOCRDG/rac11g-scan/asmparamet
erfile/registry.253.973596011
SQL> select group_number,name,state,path,total_mb,free_mb,redundancy from v$asm_disk order by 1;
GROUP_NUMBER NAME STATE PATH TOTAL_MB FREE_MB REDUNDANCY
------------ ---------- ---------- -------------------- ---------- ---------- --------------
0 NORMAL ORCL:OCR1 0 0 UNKNOWN
0 NORMAL ORCL:OCR2 0 0 UNKNOWN
0 NORMAL ORCL:OCR3 0 0 UNKNOWN
1 DATADG1 NORMAL ORCL:DATADG1 8189 6444 UNKNOWN
2 NOCR1 NORMAL ORCL:NOCR1 2047 1738 UNKNOWN
2 NOCR2 NORMAL ORCL:NOCR2 2047 1738 UNKNOWN
2 NOCR3 NORMAL ORCL:NOCR3 2047 1739 UNKNOWN
7 rows selected.
SQL> col name for a10
SQL> select name ,free_mb,total_mb from v$asm_diskgroup;
NAME FREE_MB TOTAL_MB
---------- ---------- ----------
DATADG 6444 8189
NOCRDG 5215 6141
OCRDG 0 0
重啟以後,磁碟組並未自動mount,需要在其中一個節點mount並刪除。
SQL> alter diskgroup OCRDG mount;
Diskgroup altered.
SQL> drop diskgroup OCRDG including contents;
Diskgroup dropped.
SQL> col name for a10
SQL> select name ,free_mb,total_mb from v$asm_diskgroup;
NAME FREE_MB TOTAL_MB
---------- ---------- ----------
DATADG 6444 8189
NOCRDG 5215 6141
SQL> select name ,free_mb,total_mb from gv$asm_diskgroup;
NAME FREE_MB TOTAL_MB
---------- ---------- ----------
DATADG 6444 8189
NOCRDG 5215 6141
DATADG 6444 8189
NOCRDG 5215 6141
[grid@rac11g01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATADG.dg ora....up.type ONLINE ONLINE rac11g01
ora....ER.lsnr ora....er.type ONLINE ONLINE rac11g01
ora....N1.lsnr ora....er.type ONLINE ONLINE rac11g01
ora.NOCRDG.dg ora....up.type ONLINE ONLINE rac11g01
ora.asm ora.asm.type ONLINE ONLINE rac11g01
ora.cvu ora.cvu.type ONLINE ONLINE rac11g02
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac11g01
ora.oc4j ora.oc4j.type ONLINE ONLINE rac11g02
ora.ons ora.ons.type ONLINE ONLINE rac11g01
ora....SM1.asm application ONLINE ONLINE rac11g01
ora....01.lsnr application ONLINE ONLINE rac11g01
ora....g01.gsd application OFFLINE OFFLINE
ora....g01.ons application ONLINE ONLINE rac11g01
ora....g01.vip ora....t1.type ONLINE ONLINE rac11g01
ora....SM2.asm application ONLINE ONLINE rac11g02
ora....02.lsnr application ONLINE ONLINE rac11g02
ora....g02.gsd application OFFLINE OFFLINE
ora....g02.ons application ONLINE ONLINE rac11g02
ora....g02.vip ora....t1.type ONLINE ONLINE rac11g02
ora.scan1.vip ora....ip.type ONLINE ONLINE rac11g01
ora.ty11g.db ora....se.type ONLINE ONLINE rac11g01
[grid@rac11g01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3056
Available space (kbytes) : 259064
ID : 869504304
Device/File Name : +NOCRDG
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 bypassed due to non-privileged user
[grid@rac11g01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7d7aa071dcb44f18bfdc26f87f04462d (ORCL:NOCR1) [NOCRDG]
2. ONLINE 1063860a39224ff4bf667d5d1e31b765 (ORCL:NOCR2) [NOCRDG]
3. ONLINE 65056f3f96494fc4bfa7214b3265cbd3 (ORCL:NOCR3) [NOCRDG]
Located 3 voting disk(s).
至此,遷移操作已經完成,刪除舊的磁碟組即可。
--------------------------End-----------------------------------
本身OCR和VotingDisk遷移是可以線上完成的,這個很好,可惜的是ASM的spfile的遷移需要重啟ASM例項,這個比較麻煩;不知道有沒有辦法線上遷移ASM的spfile的。
# oracleasm listdisks
DATADG1
OCR1
OCR2
OCR3
/etc/init.d/oracleasm createdisk NOCR1 /dev/sde1
/etc/init.d/oracleasm createdisk NOCR2 /dev/sdf1
/etc/init.d/oracleasm createdisk NOCR3 /dev/sdg1
# oracleasm listdisks
DATADG1
NOCR1
NOCR2
NOCR3
OCR1
OCR2
OCR3
SQL> col name for a10
SQL> col path for a40
SQL> select name ,path from v$asm_disk;
NAME PATH
---------- ----------------------------------------
ORCL:NOCR1
ORCL:NOCR2
ORCL:NOCR3
DATADG1 ORCL:DATADG1
OCR1 ORCL:OCR1
OCR2 ORCL:OCR2
OCR3 ORCL:OCR3
7 rows selected.
SQL> set linesize 200
SQL> col name for a20
SQL> select inst_id,name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb from gv$asm_diskgroup;
INST_ID NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB
---------- -------------------- -------------------- ---------------------- ---------- ---------- --------------
2 DATADG 1048576 MOUNTED 8189 6484 6484
2 OCRDG 1048576 MOUNTED 6141 5215 1584
1 DATADG 1048576 MOUNTED 8189 6484 6484
1 OCRDG 1048576 MOUNTED 6141 5215 1584
SQL> select name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb,type from v$asm_diskgroup;
NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB TYPE
-------------------- -------------------- ---------------------- ---------- ---------- -------------- ------------
DATADG 1048576 MOUNTED 8189 6484 6484 EXTERN
OCRDG 1048576 MOUNTED 6141 5215 1584 NORMAL
SQL> select failgroup, name from v$asm_disk where group_number=(select group_number from v$asm_diskgroup where name = 'OCRDG');
FAILGROUP NAME
------------------------------------------------------------ --------------------
OCR1 OCR1
OCR2 OCR2
OCR3 OCR3
create diskgroup NOCRDG normal redundancy
FAILGROUP fgocr1 disk 'ORCL:NOCR1'
FAILGROUP fgocr2 disk 'ORCL:NOCR2'
FAILGROUP fgocr3 disk 'ORCL:NOCR3' ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
SQL> create diskgroup NOCRDG normal redundancy
2 FAILGROUP fgocr1 disk 'NOCR1'
3 FAILGROUP fgocr2 disk 'NOCR2'
4 FAILGROUP fgocr3 disk 'NOCR3' ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
create diskgroup NOCRDG normal redundancy
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification 'NOCR3' matches no disks
ORA-15031: disk specification 'NOCR2' matches no disks
ORA-15031: disk specification 'NOCR1' matches no disks
SQL>
SQL> create diskgroup NOCRDG normal redundancy
2 FAILGROUP fgocr1 disk 'ORCL:NOCR1'
3 FAILGROUP fgocr2 disk 'ORCL:NOCR2'
4 FAILGROUP fgocr3 disk 'ORCL:NOCR3' ATTRIBUTE 'compatible.asm'='11.2.0.0.0','au_size'='1M';
Diskgroup created.
SQL> select inst_id,name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb from gv$asm_diskgroup;
INST_ID NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB
---------- -------------------- -------------------- ---------------------- ---------- ---------- --------------
2 DATADG 1048576 MOUNTED 8189 6484 6484
2 OCRDG 1048576 MOUNTED 6141 5215 1584
2 NOCRDG 0 DISMOUNTED 0 0 0
1 DATADG 1048576 MOUNTED 8189 6484 6484
1 OCRDG 1048576 MOUNTED 6141 5215 1584
1 NOCRDG 1048576 MOUNTED 6141 5988 1970
6 rows selected.
SQL> alter diskgroup NOCRDG mount;
alter diskgroup NOCRDG mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "NOCRDG" cannot be mounted
ORA-15013: diskgroup "NOCRDG" is already mounted
---下面在另外一個節點將磁碟mount上。
SQL> alter diskgroup NOCRDG mount;
Diskgroup altered.
SQL> select inst_id,name,allocation_unit_size,state,total_mb,free_mb,usable_file_mb from gv$asm_diskgroup;
INST_ID NAME ALLOCATION_UNIT_SIZE STATE TOTAL_MB FREE_MB USABLE_FILE_MB
---------- -------------------- -------------------- ---------------------- ---------- ---------- --------------
1 DATADG 1048576 MOUNTED 8189 6484 6484
1 OCRDG 1048576 MOUNTED 6141 5215 1584
1 NOCRDG 1048576 MOUNTED 6141 5862 1907
2 DATADG 1048576 MOUNTED 8189 6484 6484
2 OCRDG 1048576 MOUNTED 6141 5215 1584
2 NOCRDG 1048576 MOUNTED 6141 5862 1907
6 rows selected.
SQL> select name,compatibility from gv$asm_diskgroup;
NAME COMPATIBILITY
-------------------- ---------------------------------------------
DATADG 11.2.0.0.0
OCRDG 11.2.0.0.0
NOCRDG 11.2.0.0.0
DATADG 11.2.0.0.0
OCRDG 11.2.0.0.0
NOCRDG 11.2.0.0.0
6 rows selected.
SQL> select name,state from v$asm_disk;
NAME STATE
-------------------- ----------------
DATADG1 NORMAL
NOCR1 NORMAL
NOCR2 NORMAL
NOCR3 NORMAL
OCR1 NORMAL
OCR2 NORMAL
OCR3 NORMAL
7 rows selected.
----上面是建立磁碟組操作,下面進行OCR遷移---
[grid@rac11g01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2952
Available space (kbytes) : 259168
ID : 869504304
Device/File Name : +OCRDG
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 bypassed due to non-privileged user
新增ocr磁碟組
$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 66d6304135f94f2ebf810423579f56f5 (ORCL:OCR1) [OCRDG]
2. ONLINE 7686f167dfe84fe6bfac809a732a3216 (ORCL:OCR2) [OCRDG]
3. ONLINE 0d1bd4c060464f5cbf4d0ae08855db33 (ORCL:OCR3) [OCRDG]
# /u01/app/11.2/grid/bin/ocrconfig -manualbackup
rac11g01 2018/04/13 16:43:00 /u01/app/11.2/grid/cdata/backup_20180413_164300.ocr
rac11g01 2018/04/13 16:36:01 /u01/app/11.2/grid/cdata/backup_20180413_163601.ocr
rac11g01 2018/04/13 16:31:53 /u01/app/11.2/grid/cdata/backup_20180413_163153.ocr
rac11g01 2018/04/13 16:30:56 /u01/app/11.2/grid/cdata/backup_20180413_163056.ocr
rac11g01 2018/04/13 16:30:40 /u01/app/11.2/grid/cdata/backup_20180413_163040.ocr
# /u01/app/11.2/grid/bin/ocrconfig -showbackup
[root@rac11g01 bin]# ./ocrconfig -add +NOCRDG
[root@rac11g01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3064
Available space (kbytes) : 259056
ID : 869504304
Device/File Name : +OCRDG
Device/File integrity check succeeded
Device/File Name : +NOCRDG
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@rac11g01 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 66d6304135f94f2ebf810423579f56f5 (ORCL:OCR1) [OCRDG]
2. ONLINE 7686f167dfe84fe6bfac809a732a3216 (ORCL:OCR2) [OCRDG]
3. ONLINE 0d1bd4c060464f5cbf4d0ae08855db33 (ORCL:OCR3) [OCRDG]
Located 3 voting disk(s).
--替換OCR
---這個時候直接刪除舊的OCR指定舊的磁碟組即可,不需要再替換。
---這裡的刪除只代表OCR不在使用該磁碟組,但是Voting還在使用,還需遷移。
# ./ocrconfig -replace +OCRDG -replacement +NOCRDG
PROT-29: The Oracle Cluster Registry location is already configured
---刪除舊的磁碟組
# ./ocrconfig -delete +OCRDG
[root@rac11g01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3064
Available space (kbytes) : 259056
ID : 869504304
Device/File Name : +NOCRDG
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
---遷移Voting Disk,只需要grid使用者替換即可,無需root使用者操作
[grid@rac11g01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 66d6304135f94f2ebf810423579f56f5 (ORCL:OCR1) [OCRDG]
2. ONLINE 7686f167dfe84fe6bfac809a732a3216 (ORCL:OCR2) [OCRDG]
3. ONLINE 0d1bd4c060464f5cbf4d0ae08855db33 (ORCL:OCR3) [OCRDG]
Located 3 voting disk(s).
[grid@rac11g01 ~]$ crsctl replace votedisk +NOCRDG
Successful addition of voting disk 7d7aa071dcb44f18bfdc26f87f04462d.
Successful addition of voting disk 1063860a39224ff4bf667d5d1e31b765.
Successful addition of voting disk 65056f3f96494fc4bfa7214b3265cbd3.
Successful deletion of voting disk 66d6304135f94f2ebf810423579f56f5.
Successful deletion of voting disk 7686f167dfe84fe6bfac809a732a3216.
Successful deletion of voting disk 0d1bd4c060464f5cbf4d0ae08855db33.
Successfully replaced voting disk group with +NOCRDG.
CRS-4266: Voting file(s) successfully replaced
[grid@rac11g01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7d7aa071dcb44f18bfdc26f87f04462d (ORCL:NOCR1) [NOCRDG]
2. ONLINE 1063860a39224ff4bf667d5d1e31b765 (ORCL:NOCR2) [NOCRDG]
3. ONLINE 65056f3f96494fc4bfa7214b3265cbd3 (ORCL:NOCR3) [NOCRDG]
Located 3 voting disk(s).
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 8189 6454 0 6454 0 N DATADG/
MOUNTED NORMAL N 512 4096 1048576 6141 5217 2047 1585 0 Y NOCRDG/
MOUNTED NORMAL N 512 4096 1048576 6141 5311 2047 1632 0 N OCRDG/
---遷移ASM spfile
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string +OCRDG/rac11g-scan/asmparamete
rfile/registry.253.973341853
SQL> create pfile='/tmp/asmpfile.ora' from spfile;
File created.
SQL> create spfile='+NOCRDG' from pfile='/tmp/asmpfile.ora';
File created.
SQL>
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string +OCRDG/rac11g-scan/asmparamete
rfile/registry.253.973341853
SQL>
--這裡需要重啟ASM例項才生效,重啟後:
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string +NOCRDG/rac11g-scan/asmparamet
erfile/registry.253.973596011
SQL> select group_number,name,state,path,total_mb,free_mb,redundancy from v$asm_disk order by 1;
GROUP_NUMBER NAME STATE PATH TOTAL_MB FREE_MB REDUNDANCY
------------ ---------- ---------- -------------------- ---------- ---------- --------------
0 NORMAL ORCL:OCR1 0 0 UNKNOWN
0 NORMAL ORCL:OCR2 0 0 UNKNOWN
0 NORMAL ORCL:OCR3 0 0 UNKNOWN
1 DATADG1 NORMAL ORCL:DATADG1 8189 6444 UNKNOWN
2 NOCR1 NORMAL ORCL:NOCR1 2047 1738 UNKNOWN
2 NOCR2 NORMAL ORCL:NOCR2 2047 1738 UNKNOWN
2 NOCR3 NORMAL ORCL:NOCR3 2047 1739 UNKNOWN
7 rows selected.
SQL> col name for a10
SQL> select name ,free_mb,total_mb from v$asm_diskgroup;
NAME FREE_MB TOTAL_MB
---------- ---------- ----------
DATADG 6444 8189
NOCRDG 5215 6141
OCRDG 0 0
重啟以後,磁碟組並未自動mount,需要在其中一個節點mount並刪除。
SQL> alter diskgroup OCRDG mount;
Diskgroup altered.
SQL> drop diskgroup OCRDG including contents;
Diskgroup dropped.
SQL> col name for a10
SQL> select name ,free_mb,total_mb from v$asm_diskgroup;
NAME FREE_MB TOTAL_MB
---------- ---------- ----------
DATADG 6444 8189
NOCRDG 5215 6141
SQL> select name ,free_mb,total_mb from gv$asm_diskgroup;
NAME FREE_MB TOTAL_MB
---------- ---------- ----------
DATADG 6444 8189
NOCRDG 5215 6141
DATADG 6444 8189
NOCRDG 5215 6141
[grid@rac11g01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATADG.dg ora....up.type ONLINE ONLINE rac11g01
ora....ER.lsnr ora....er.type ONLINE ONLINE rac11g01
ora....N1.lsnr ora....er.type ONLINE ONLINE rac11g01
ora.NOCRDG.dg ora....up.type ONLINE ONLINE rac11g01
ora.asm ora.asm.type ONLINE ONLINE rac11g01
ora.cvu ora.cvu.type ONLINE ONLINE rac11g02
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac11g01
ora.oc4j ora.oc4j.type ONLINE ONLINE rac11g02
ora.ons ora.ons.type ONLINE ONLINE rac11g01
ora....SM1.asm application ONLINE ONLINE rac11g01
ora....01.lsnr application ONLINE ONLINE rac11g01
ora....g01.gsd application OFFLINE OFFLINE
ora....g01.ons application ONLINE ONLINE rac11g01
ora....g01.vip ora....t1.type ONLINE ONLINE rac11g01
ora....SM2.asm application ONLINE ONLINE rac11g02
ora....02.lsnr application ONLINE ONLINE rac11g02
ora....g02.gsd application OFFLINE OFFLINE
ora....g02.ons application ONLINE ONLINE rac11g02
ora....g02.vip ora....t1.type ONLINE ONLINE rac11g02
ora.scan1.vip ora....ip.type ONLINE ONLINE rac11g01
ora.ty11g.db ora....se.type ONLINE ONLINE rac11g01
[grid@rac11g01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3056
Available space (kbytes) : 259064
ID : 869504304
Device/File Name : +NOCRDG
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 bypassed due to non-privileged user
[grid@rac11g01 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7d7aa071dcb44f18bfdc26f87f04462d (ORCL:NOCR1) [NOCRDG]
2. ONLINE 1063860a39224ff4bf667d5d1e31b765 (ORCL:NOCR2) [NOCRDG]
3. ONLINE 65056f3f96494fc4bfa7214b3265cbd3 (ORCL:NOCR3) [NOCRDG]
Located 3 voting disk(s).
至此,遷移操作已經完成,刪除舊的磁碟組即可。
--------------------------End-----------------------------------
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24930246/viewspace-2152973/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 遷移ocr/votedisk/asm spfile所在磁碟組ASM
- 遷移ASM磁碟組ASM
- ASM的管理----刪除和新增磁碟組ASM
- ASM磁碟組刪除DISK操作ASM
- 在ASM磁碟組中刪除一個磁碟ASM
- asm 磁碟組 增刪磁碟組ASM
- 【資料遷移】RMAN遷移資料庫到ASM(一)建立ASM磁碟組資料庫ASM
- 11.2刪除第一個ASM磁碟組ASM
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- ASM重新命名包含OCR/vote file的磁碟組ASM
- 【ASM學習】手工刪除ASM磁碟組時提示錯誤ORA-15039ASM
- 通過遷移的方式修改ASM磁碟組的冗餘屬性ASM
- asm新增和刪除磁碟ASM
- ASM之OCR所在磁碟組損壞後的恢復ASM
- ASM磁碟簡單維護,新增,刪除ASM
- Votingdisk, OCR, ASM 相關資訊及備份與恢復ASM
- 存貯在asm中的ocr/votedisk/asm磁碟組損害的恢復ASM
- 在ASM磁碟組之間移動檔案ASM
- 在ASM磁碟組中刪除歸檔日誌報ORA-15028ASM
- oracle遷移OCR盤Oracle
- ASM磁碟組限制ASM
- OracleRAC新增asm磁碟組並設定歸檔位置OracleASM
- Oracle Rac Ocr VotingDisk 備份Oracle
- asm新增刪除磁碟ASM
- 如何移動asm磁碟組內的資料檔案到另外一個磁碟組ASM
- ASM下資料檔案遷移至不同磁碟組小記ASM
- 零當機時間遷移 ASM 磁碟組到另一個 SAN/磁碟陣列/DAS 的準確步驟ASM陣列
- ORACLE 10.2.0.5 RAC OCR&vote disk 磁碟遷移 DG Rebalance測試Oracle
- Oracle RAC OCR 和 VotingDisk 的備份與恢復Oracle
- oracle asm 儲存 a磁碟組中的資料檔案 遷移到b磁碟組實施步驟OracleASM
- RAC共享磁碟物理路徑故障導致OCR、Votedisk所在ASM磁碟組不可訪問的案例分析ASM
- RAC線上替換OCR、DATA、FRA等ASM磁碟ASM
- ASM下遷移spfileASM
- Oracle 12c 遷移MGMTDB 到其他的磁碟組Oracle
- ORACLE RAC重建ASM磁碟組OracleASM
- ASM磁碟組修改重建操作ASM
- ASM磁碟組空間不足ASM
- 全面學習和應用ORACLE ASM特性--(3)新增和修改asm磁碟組OracleASM