暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

如何通过 renamedg 在Oracle 11g中重命名磁盘组

原创 Oracle 2022-02-16
1067

适用版本

Oracle Database - Enterprise Edition - Version 11.2.0.0 to 11.2.0.2 [Release 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.

目标

The present document provides a clear example about how to rename an ASM diskgroup on release 11gR2.

Please avoid renaming OCR/VOTE diskgroup using renamedg

解决方案

  1. First of all, the desired diskgroup needs to be dismounted (from each node if this is a RAC configuration):
# asmcmd umount <OLD_DG_NAME>
  1. Verify that the desired diskgroup was dismounted:
# 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 NORMAL N 512 4096 1048576 32756 31828 244 15792 0 N <OLD_DG_NAME>_OCR/

MOUNTED EXTERN N 512 4096 1048576 16378 10134 0 10134 0 N LOB<OLD_DG_NAME>/
  1. Then execute the rename statement:
# renamedg phase=both dgname=<OLD_DG_NAME> newdgname=<NEW_DG_NAME> verbose=true

Parsing parameters..

Parameters in effect:

Old DG name : <OLD_DG_NAME>

New DG name : <NEW_DG_NAME>

Phases :

Phase 1

Phase 2

Discovery str : (null)

Clean : TRUE

Raw only : TRUE

renamedg operation: phase=both dgname=<OLD_DG_NAME> newdgname=<NEW_DG_NAME> verbose=true

Executing phase 1

Discovering the group

Performing discovery with string:

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:<DISK_NAME>1 with disk number:0 and timestamp (32925601 -972709888)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:<DISK_NAME>2 with disk number:1 and timestamp (32925601 -972709888)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:<DISK_NAME>3 with disk number:2 and timestamp (32925601 -972709888)

Checking for hearbeat...

Re-discovering the group

Performing discovery with string:

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:<DISK_NAME>1 with disk number:0 and timestamp (32925601 -972709888)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:<DISK_NAME>2 with disk number:1 and timestamp (32925601 -972709888)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:<DISK_NAME>3 with disk number:2 and timestamp (32925601 -972709888)

Checking if the diskgroup is mounted

Checking disk number:0

Checking disk number:1

Checking disk number:2

Checking if diskgroup is used by CSS

Generating configuration file..

Completed phase 1

Executing phase 2

Looking for ORCL:<DISK_NAME>1

Modifying the header

Looking for ORCL:<DISK_NAME>2

Modifying the header

Looking for ORCL:<DISK_NAME>3

Modifying the header

Completed phase 2

Terminating kgfd context 0x2af21517e0a0

If the above command fails, searching for disks, then we need to include the diskstring and then you need to use

renamedg phase=both dgname=<OLD_DG_NAME> newdgname=<NEW_DG_NAME> verbose=true asm_diskstring='<discoverystring1>','<discoverystring2>'
  1. Finally, mount the renamed diskgroup and validate that it was mounted (on each node if this is a RAC configuration):
# asmcmd mount <NEW_DG_NAME>
 

# 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 NORMAL N 512 4096 1048576 32756 31828 244 15792 0 N <OLD_DG_NAME>_OCR/

MOUNTED EXTERN N 512 4096 1048576 24567 14267 0 14267 0 N <NEW_DG_NAME>/
MOUNTED EXTERN N 512 4096 1048576 16378 10134 0 10134 0 N LOB<OLD_DG_NAME>/

<renamedg tool cannot rename the associated ASM disk(s) name(s). >>>

IMPORTANT : With renamedg the diskgroup name changes. As the ASM File names ( like <OLD_DG_NAME>files / controlfiles etc ), include the diskgroups name, you need to take care ( update pfile or rename <OLD_DG_NAME>files ) from the RDBMS instance, after renamedg.

最后修改时间:2022-02-16 09:02:34
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论