欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

利用Oracle RAC 11gR2 新特性renamedg来更改diskgroup name

程序员文章站 2024-02-09 09:40:58
...

AIX7.1 + 双节点Oracle Rac 11.2.0.3,由于此套Rac并非自己部门安装,是开发部安装,现交由运维部分来管理,客户需要要将asm di

交代环境:
AIX7.1 + 双节点Oracle Rac 11.2.0.3

由于此套Rac并非自己部门安装,是开发部安装,现交由运维部分来管理,客户需要要将asm diskgroup name 安装部门规范来命令。遂需要将oasmdgdata1更改为datadg。
幸好Oracle的版本是11gR2,在11gR2中,Oracle有一项新特性,可以直接使用renamedg命令更改diskgroup的名称。

下面是具体的操作步骤。


grid@sundb01:/home/grid>asmcmd
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 358400 358192 0 179096 0 N OASMDGDATA01/
MOUNTED NORMAL N 512 4096 1048576 15360 14434 5120 4657 0 Y OCRDG/
ASMCMD> umount oasmdgdata01
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 15360 14434 5120 4657 0 Y OCRDG/


grid@sundb01:/home/grid>renamedg -help
NOTE: No asm libraries found in the system


Parsing parameters..
phase Phase to execute,
(phase=ONE|TWO|BOTH), default BOTH


dgname Diskgroup to be renamed


newdgname New name for the diskgroup


config intermediate config file


check just check-do not perform actual operation,
(check=TRUE/FALSE), default FALSE


confirm confirm before committing changes to disks,
(confirm=TRUE/FALSE), default FALSE


clean ignore errors,
(clean=TRUE/FALSE), default TRUE


asm_diskstring ASM Diskstring (asm_diskstring='discoverystring',
'discoverystring1' ...)


verbose verbose execution,
(verbose=TRUE|FALSE), default FALSE


keep_voting_files Voting file attribute,
(keep_voting_files=TRUE|FALSE), default FALSE


利用renamedg来更改diskgroup的名称:
grid@sundb01:/home/grid>renamedg phase=both dgname=oasmdgdata01 newdgname=datadg verbose=true
NOTE: No asm libraries found in the system


Parsing parameters..


Parameters in effect:


Old DG name : OASMDGDATA01
New DG name : DATADG
Phases :
Phase 1
Phase 2
Discovery str :
Clean : TRUE
Raw only : TRUE
renamedg operation: phase=both dgname=oasmdgdata01 newdgname=datadg verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rhdisk2 with disk number:1 and timestamp (33002374 -296274944)
Identified disk UFS:/dev/rhdisk1 with disk number:0 and timestamp (33002374 -296274944)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk UFS:/dev/rhdisk2 with disk number:1 and timestamp (33002374 -296274944)
Identified disk UFS:/dev/rhdisk1 with disk number:0 and timestamp (33002374 -296274944)
Checking if the diskgroup is mounted or used by CSS
Checking disk number:1
Checking disk number:0
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/rhdisk2
Modifying the header
Looking for /dev/rhdisk1
Modifying the header
Completed phase 2
Terminating kgfd context 110285ba0
grid@sundb01:/home/grid>
grid@sundb01:/home/grid>sqlplus / as sysasm


SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 10 12:33:31 2014


Copyright (c) 1982, 2011, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options


SQL> select name,state from v$asm_diskgroup;

上一篇: ZF 表模型创建有关问题

下一篇: