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

The method of changing name of oracle disk Group

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces "the method of changing the name of oracle disk group". In the daily operation, I believe that many people have doubts about the method of changing the name of oracle disk group. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "the method of changing the name of oracle disk group". Next, please follow the editor to study!

Change the name of oracle disk group

When creating a disk group, you accidentally named the OCR disk group incorrectly. Here is a simulation of how to change the name of the ocr disk group.

Reference documentation (documentation ID 1335975.1)

Test environment

Operating system version redhat 6.4

Database version 11203

Now the OCR is stored in the vote disk group. Now change the name of the VOTE disk group to OCRDG disk group. During the operation, you need to have a disk group to transfer the disk group. The disk group can be a block, oh, press external redundancy.

1. View cluster status

[root@rac1] # / oracle/app/grid/11.2.0/bin/crsctl stat res-t

NAME TARGET STATE SERVER STATE_DETAILS

Local Resources

Ora.ARC.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.DATADG01.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.DATADG02.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.LISTENER.lsnr

ONLINE OFFLINE rac1

ONLINE ONLINE rac2

Ora.VOTE.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.asm

ONLINE ONLINE rac1 Started

ONLINE ONLINE rac2 Started

Ora.gsd

OFFLINE OFFLINE rac1

OFFLINE OFFLINE rac2

Ora.net1.network

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.ons

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Cluster Resources

Ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE rac2

Ora.cvu

1 ONLINE ONLINE rac2

Ora.oc4j

1 ONLINE ONLINE rac1

Ora.orcl.db

1 ONLINE ONLINE rac1 Open

2 ONLINE ONLINE rac2 Open

Ora.rac1.vip

1 ONLINE ONLINE rac1

Ora.rac2.vip

1 ONLINE ONLINE rac2

Ora.scan1.vip

1 ONLINE ONLINE rac2

two。 Check the backup of ocr and manual backup. It doesn't matter if there is no backup of ocr in emergency.

There is an automatic backup of ocr in the cdata directory of $CRS_HOME, which is saved every day and every week by default, and is available as long as no schema changes have been made.

[root@rac1 cdata] # pwd

/ oracle/app/grid/11.2.0/cdata

[root@rac1 cdata] # ls-lrt

The total dosage is 2852

Drwxr-xr-x 2 grid oinstall 4096 January 17 2016 localhost

Drwxr-xr-x 2 grid oinstall 4096 January 17 2016 rac1

-rw- 1 root oinstall 272756736 September 5 07:36 rac1.olr

Drwxrwxr-x 2 grid oinstall 4096 September 5 07:37 rac-cluster

View the unknown ocr disk group and the location of the votingdisk.

[root@rac1 cdata] # / oracle/app/grid/11.2.0/bin/ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 2904

Available space (kbytes): 259216

ID: 635069277

Device/File Name: + VOTE

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

[root@rac1 cdata] # / oracle/app/grid/11.2.0/bin/crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE 956b16ceaff14f4ebf37414725a67350 (/ dev/asm-diskb) [VOTE]

2. ONLINE adb3a38f36514f2bbfcaa798303df4a1 (/ dev/asm-diskc) [VOTE]

3. ONLINE aa9bfeef2ddd4f01bf212f8e020cd040 (/ dev/asm-diskd) [VOTE]

View the location and status of OCR backups

View automatic backups:

Ocrconfig-showbackup auto

View manual backups:

Ocrconfig-showbackup manual

The backups shown are all ocr backups automatically backed up by the system, and there is no manual backup prompted by the bottom PROT-25.

[root@rac1 cdata] # / oracle/app/grid/11.2.0/bin/ocrconfig-showbackup

Rac1 2019-09-05 07:37:35 / oracle/app/grid/11.2.0/cdata/rac-cluster/backup00.ocr

Rac1 2019-09-05 03:37:34 / oracle/app/grid/11.2.0/cdata/rac-cluster/backup01.ocr

Rac1 2019-09-04 16:44:33 / oracle/app/grid/11.2.0/cdata/rac-cluster/backup02.ocr

Rac1 2019-09-04 16:44:33 / oracle/app/grid/11.2.0/cdata/rac-cluster/day.ocr

Rac1 2019-09-04 16:44:33 / oracle/app/grid/11.2.0/cdata/rac-cluster/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available

Su-grid

Sqlplus / as sysasm

SQL > set line 200 pages 999

SQL > col path for A40

SQL > col name for A40

SQL > select group_number,path,header_status,total_mb/1024 total_GB,free_mb/1024 free_GB,state from v$asm_disk order by 2

GROUP_NUMBER PATH HEADER_STATU TOTAL_GB FREE_GB STATE

1 / dev/asm-diskb MEMBER 1. 69921875 NORMAL

1 / dev/asm-diskc MEMBER 1. 69921875 NORMAL

1 / dev/asm-diskd MEMBER 1. 69921875 NORMAL

3 / dev/asm-diske MEMBER 5 2.4296875 NORMAL

4 / dev/asm-diskf MEMBER 5 4.90722656 NORMAL

2 / dev/asm-diskg MEMBER 5 4.23242188 NORMAL

3. Replace ocr with ARC disk group as temporary OCR disk group (ARC previously archived disk group has only 1 disk external redundancy, size 5G) root execution

[root@rac1] # / oracle/app/grid/11.2.0/bin/ocrconfig-add + ARC

[root@rac1] # / oracle/app/grid/11.2.0/bin/ocrconfig-delete + VOTE

[root@rac1] # / oracle/app/grid/11.2.0/bin/crsctl replace votedisk + ARC

Successful addition of voting disk a1133130973b4f80bfc9a6d917eee626.

Successful deletion of voting disk 6b91880919e64fe3bfc01701f29256d1.

Successful deletion of voting disk 2a0eef6d3ee64f10bfa2040621cef851.

Successful deletion of voting disk a063e70967dd4fdcbf3b32e675c3246a.

Successfully replaced voting disk group with + ARC.

CRS-4266: Voting file (s) successfully replaced

Check to see if the replacement was successful and the location of the new OCR

[root@rac1 ~] # / oracle/app/grid/11.2.0/bin/ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 2892

Available space (kbytes): 259228

ID: 1965781783

Device/File Name: + ARC

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

[root@rac1 ~] # / oracle/app/grid/11.2.0/bin/crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE a1133130973b4f80bfc9a6d917eee626 (/ dev/asm-diskg) [ARC]

4. Migrate spfile of ASM, migrate from VOTE to ARC diskgroup

[root@rac1 cdata] # su-grid

[grid@rac1 ~] $asmcmd

ASMCMD > spget

+ VOTE/rac-cluster/asmparameterfile/registry.253.901344197

Sqlplus / as sysasm

Create pfile='/home/grid/initasm.ora' from spfile

Create spfile='+ARC' from pfile='/home/grid/initasm.ora'

$ORACLE_HOME/bin/gpnptool get

5. Restart a 2-node cluster

# / oracle/app/grid/11.2.0/bin/crsctl stop crs

# / oracle/app/grid/11.2.0/bin/crsctl start crs

6. Unmount the original VOTE disk group, and skip the next step if the disk group does not have mount

# su-grid

$sqlplus / as sysasm

> alter diskgorup VOTE dismount

7. Rename disk group

Original command [grid@test ~] $renamedg phase=both dgname=DATA newdgname=CRS asm_diskstring='' verbose=true

Grid user executes command

[grid@rac1 ~] $renamedg phase=both dgname=VOTE newdgname=OCRDG asm_diskstring='/dev/asm*' verbose=true

NOTE: No asm libraries found in the system

Parsing parameters..

Parameters in effect:

Old DG name: VOTE

New DG name: OCRDG

Phases:

Phase 1

Phase 2

Discovery str: / dev/asm*

Clean: TRUE

Raw only: TRUE

Renamedg operation: phase=both dgname=VOTE newdgname=OCRDG asm_diskstring=/dev/asm* verbose=true

Executing phase 1

Discovering the group

Performing discovery with string:/dev/asm*

Identified disk UFS:/dev/asm-diskc with disk number:1 and timestamp (33088676-1089116160)

Identified disk UFS:/dev/asm-diskb with disk number:0 and timestamp (33088676-1089116160)

Identified disk UFS:/dev/asm-diskd with disk number:2 and timestamp (33088676-1089116160)

Checking for hearbeat...

Re-discovering the group

Performing discovery with string:/dev/asm*

Identified disk UFS:/dev/asm-diskc with disk number:1 and timestamp (33088676-1089116160)

Identified disk UFS:/dev/asm-diskb with disk number:0 and timestamp (33088676-1089116160)

Identified disk UFS:/dev/asm-diskd with disk number:2 and timestamp (33088676-1089116160)

Checking if the diskgroup is mounted or used by CSS

Checking disk number:1

Checking disk number:0

Checking disk number:2

Generating configuration file..

Completed phase 1

Executing phase 2

Looking for / dev/asm-diskc

Modifying the header

Looking for / dev/asm-diskb

Modifying the header

Looking for / dev/asm-diskd

Modifying the header

Completed phase 2

Terminating kgfd context 0x7f5dc77880a0

8. Query disk information

SQL > set line 1000

SQL > set pages 599

SQL > col path format A30

SQL > select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk

NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB

-

/ dev/asm-diskc 0 MEMBER 0 0

/ dev/asm-diskd 0 MEMBER 0 0

/ dev/asm-diskb 0 MEMBER 0 0

DATADG01_0000 / dev/asm-diske 2 MEMBER 5120 2488

DATADG02_0000 / dev/asm-diskf 3 MEMBER 5120 5025

ARC_0000 / dev/asm-diskg 1 MEMBER 5120 4011

6 rows selected.

SQL > select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup

NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB

-

ARC MOUNTED 4011 5120 4011 0

DATADG01 MOUNTED 2488 5120 2488 0

DATADG02 MOUNTED 5025 5120 5025 0

OCRDG DISMOUNTED 0 0 0

9. Mount the newly named OCRDG disk group

Alter diskgorup OCRDG mount

10 migrate OCR and vote file to the new disk CRS

[root@rac1] # / oracle/app/grid/11.2.0/bin/ocrconfig-add + OCRDG

[root@rac1] # / oracle/app/grid/11.2.0/bin/ocrconfig-delete + ARC

[root@rac1] # / oracle/app/grid/11.2.0/bin/crsctl replace votedisk + OCRDG

Successful addition of voting disk a109d7db3f9b4f92bf31f0496ccce75e.

Successful addition of voting disk 7423098d541f4f77bfc41c7672180af9.

Successful addition of voting disk b0a02397b8604f18bfca5319d03f9116.

Successful deletion of voting disk a1133130973b4f80bfc9a6d917eee626.

Successfully replaced voting disk group with + OCRDG.

CRS-4266: Voting file (s) successfully replaced

11. Modify SPFILE path

[root@rac1 ~] # su-grid

[grid@rac1 ~] $sqlplus / as sysasm

SQL > create spfile='+OCRDG' from pfile='/home/grid/initasm.ora'

File created.

twelve。 Restart a 2-node cluster

Crsctl stop crs

Crsctl start crs

13. If you need to delete a temporary disk group, execute the delete command

Drop diskgroup xxxxxx including contents

14. Update the cluster information because the name of the VOTE disk group originally recorded in the cluster has been changed to OCRDG

[grid@rac1] $crsctl stat res-t

NAME TARGET STATE SERVER STATE_DETAILS

Local Resources

Ora.ARC.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.DATADG01.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.DATADG02.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.LISTENER.lsnr

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.OCRDG.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.VOTE.dg

OFFLINE OFFLINE rac1

OFFLINE OFFLINE rac2

[grid@rac1] $srvctl remove diskgroup-g VOTE

15. Verify the cluster information. There is no VOTE disk group in the cluster resource.

[grid@rac1] $crsctl stat res-t

NAME TARGET STATE SERVER STATE_DETAILS

Local Resources

Ora.ARC.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.DATADG01.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.DATADG02.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.LISTENER.lsnr

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.OCRDG.dg

ONLINE ONLINE rac1

ONLINE ONLINE rac2

Ora.asm

ONLINE ONLINE rac1 Started

ONLINE ONLINE rac2 Started

At this point, the study on "the method of changing the name of oracle disk group" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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