Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to migrate OCR and VotingDisk and delete the original ASM disk group

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to migrate OCR and VotingDisk and delete the original ASM disk group. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Due to storage problems, the system needs to be migrated to other storage for hosting. OCR and VotingDisk have been migrated several times before, but no actual record has been found. Record it again here.

The migration of OCR and VotingDisk can be done online, which is good, but it is a pity that the migration of ASM's spfile requires restarting the ASM instance, which is troublesome. I wonder if there is any way to migrate ASM's spfile online.

# 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

-next, put the disk mount on another node.

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.

-the above operation is to create a disk group, and the following is to perform OCR migration

[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

Add an ocr disk group

$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).

-- replace OCR

-delete the old OCR and specify the old disk group directly at this time, and there is no need to replace it.

-the deletion here only means that OCR is not using the disk group, but Voting is still in use and needs to be migrated.

#. / ocrconfig-replace + OCRDG-replacement + NOCRDG

PROT-29: The Oracle Cluster Registry location is already configured

-delete the old disk group

#. / 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

-migrate Voting Disk, which only needs to be replaced by grid users and does not require root user action

[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/

-migrate 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 >

-- you need to restart the ASM instance to take effect. After restart:

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

After reboot, the disk group does not mount automatically and needs to be mount and deleted on one of the nodes.

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).

At this point, the migration operation is complete, and you can delete the old disk group.

This is the end of the article on "how to migrate OCR and VotingDisk and delete the original ASM disk group". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report