签到成功

知道了

CNDBA社区CNDBA社区

How to move ASM spfile to a different disk group

2016-11-25 15:50 1984 0 原创 Oracle 11g
作者: dave

 

       The goal is to move ASM spfile from one disk group to another.

       During initial ASM setup the spfile might have been created in a default disk group (e.g. DATA).  The requirement is now to move the ASM spfile to another disk group.

       According to Oracle ASM documentation it should be possible to use 'asmcmd spmove' command to move ASM spfile:
       Oracle Database Storage Administrator's Guide 11g Release 2 (11.2)
       Section ASMCMD Instance Management Commands
              spmove

      Purpose: Moves an Oracle ASM SPFILE from source to destination and automatically updates the GPnP profile.

But an attempt to move the ASM spfile fails as follows:

$ asmcmd spmove +DATA/asm/asmparameterfile/REGISTRY.253.715881237 +PLAY/spfileASM.ora
ORA-15032: not all alterations performed
ORA-15028: ASM file '+DATA/asm/asmparameterfile/REGISTRY.253.715881237' not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)

 

解决方法:

 

方法一:To move ASM spfile to another disk group, either make use of intermediate pfile:http://www.cndba.cn/Dave/article/803

1.        Create intermediate pfile from the current spfile

2.        Create spfile in a new disk group from the intermediate pfile

http://www.cndba.cn/Dave/article/803

3.        Restart the HA stack to verify that ASM starts up fine with moved spfile

4.        Remove the original spfile

 

方法二:or use 'asmcmd spcopy' command

1.        Copy spfile with -u option - to update GPnP profile in RAC environment

2.        Restart the HA stack to verify that ASM starts up fine with copiedspfile

3.        Remove the original spfile

 

 

方法一示例:

http://www.cndba.cn/Dave/article/803

       This is an example of moving ASM spfile in a single instance environment, by making use intermediate pfile

1. Create intermediate pfile from the current spfile

 

$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on <date>
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> show parameter spfile

NAME    TYPE    VALUE
------- ------- --------------------------------------------------
spfile  string  +DATA/asm/asmparameterfile/registry.253.715881237

SQL> create pfile='/tmp/pfile+ASM.ora' from spfile;

File created.



2. Create spfile in a new disk group from the intermediate pfile

SQL> create spfile='+PLAY' from pfile='/tmp/pfile+ASM.ora';

File created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option



3. Restart the HA stack to verify that ASM starts up fine with moved spfile

$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '<server>'
...
CRS-4133: Oracle High Availability Services has been stopped.

$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.



Verify that the new spfile is being used

$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on <date>
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option

SQL> show parameter spfile

NAME    TYPE    VALUE
------- ------- --------------------------------------------------
spfile  string  +PLAY/asm/asmparameterfile/registry.253.715963539

SQL> select name, state from v$asm_diskgroup;

NAME  STATE
----- -----------
DATA  MOUNTED
PLAY  MOUNTED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option


The use of new spfile can also be verified with asmcmd as follows:

$ asmcmd spget
+PLAY/asm/asmparameterfile/registry.253.715963539


4. Remove the original spfile

$ asmcmd rm +DATA/asm/asmparameterfile/registry.253.715881237



方法二示例:
And this is an example of moving ASM spfile with 'asmcmd spcopy'

1. Copy spfile with -u option - to update GPnP profile in RAC environment

 http://www.cndba.cn/Dave/article/803

$ asmcmd spget
+DATA/asm/asmparameterfile/registry.253.722601213

$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Votin g_files Name
MOUNTED EXTERN N 512 4096 1048576 14658 9814 0 9814 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 9772 8507 0 8507 0 N PLAY/
MOUNTED EXTERN N 512 4096 1048576 9772 9212 0 9212 0 N RECO/

$ asmcmd spcopy -u +DATA/asm/asmparameterfile/registry.253.722601213 +PLAY/spfileASM.ora


2. Restart the HA stack to verify that ASM starts up fine with copiedspfile

$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '<server>'
...
CRS-4133: Oracle High Availability Services has been stopped.

$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.

$ asmcmd spget
+PLAY/spfileASM.ora

http://www.cndba.cn/Dave/article/803


3. Remove the original spfile

$ asmcmd ls -l +DATA/asm/asmparameterfile
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE JUN 25 10:00:00 Y REGISTRY.253.722601213

$ asmcmd rm +DATA/asm/asmparameterfile/registry.253.722601213
http://www.cndba.cn/Dave/article/803


       NOTE: The disk group that holds ASM spfile has to have COMPATIBLE.ASM value of 11.2 or higher.

 

 

 

 

 http://www.cndba.cn/Dave/article/803

From Oracle

-------------------------------------------------------------------------------------------------------

Blog http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716();   DBA2 群:62697977()   DBA3 群:62697850()  

DBA 超级群:63306533();  DBA4 群: 83829929  DBA5群: 142216823   

聊天 群:40132017   聊天2群:69087192

http://www.cndba.cn/Dave/article/803

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请http://www.cndba.cn/Dave/article/803

http://www.cndba.cn/Dave/article/803

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle 11g

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2261
    原创
  • 3
    翻译
  • 578
    转载
  • 191
    评论
  • 访问:7983185次
  • 积分:4346
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ