遷移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和votingdisk磁碟組
- 遷移ASM磁碟組ASM
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- ASM重新命名包含OCR/vote file的磁碟組ASM
- ASM磁碟簡單維護,新增,刪除ASM
- 在ASM磁碟組中刪除歸檔日誌報ORA-15028ASM
- ASM磁碟組限制ASM
- ASM下遷移spfileASM
- oracle遷移OCR盤Oracle
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- ASM磁碟組更換磁碟的操作方法ASM
- ASM 磁碟組的建立及擴容ASM
- ORACLE ASM磁碟組空間溢位OracleASM
- 使用udev擴充套件ASM磁碟組dev套件ASM
- ASM磁碟組擴容操作文件ASM
- Oracle RAC 遷移替換 OCR 盤Oracle
- Oracle ASM磁碟組擴容(AIX7.1)OracleASMAI
- ASM磁碟組ORA-15042 ORA-15096ASM
- 一次ASM新增新的磁碟組ASM
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- RAC之grid叢集安裝及ASM磁碟組配置ASM
- Oracle RAC ASM磁碟組擴容時遇到的VIP漂移OracleASM
- 基於裸裝置的ASM磁碟組擴容方案ASM
- 資料檔案遷移至其他磁碟組
- win10系統如何刪除組_win10刪除組方法Win10
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- 刪除並獲得點數
- Hyperledger Fabric組織的動態新增和刪除
- 從定位資料塊所在ASM磁碟到ASM strippingASM
- (grid重灌後圖形介面報錯)ASM磁碟組字元介面配置ASM字元
- ASM磁碟頭資訊損壞和修復(kfed/dd)ASM
- WPF中的ListBox怎麼新增刪除按鈕並刪除所在行
- asm磁碟組依賴導致資料庫自啟動報錯ASM資料庫
- 【ARCH】Oracle 判斷asm磁碟組大小,超過閾值清理指令碼OracleASM指令碼
- 在Linux中,如何建立、移動和刪除檔案和資料夾?Linux
- 使用node中fs模組建立和刪除資料夾
- 原樣壓縮conda環境,並遷移環境至另一伺服器伺服器
- 找出倆個字串的相同並刪除字串