ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 11.2删除第一个ASM磁盘组

11.2删除第一个ASM磁盘组

原创 Linux操作系统 作者:yangtingkun 时间:2011-08-17 23:53:23 0 删除 编辑

在客户的11.2.0.2环境中,删除第一个磁盘组碰到了错误。

 

 

对于RAC环境而言,第一个创建的磁盘组中包含OCRVOTASM的启动参数文件SPFILE,因此先要删除第一个磁盘组,意味着需要迁移OCRVOTSPFILE文件。不过这里碰到的情况没有那么复杂,因为当前环境并非RAC,而是单机上启动的ASM实例。

当删除第一个磁盘组上所有的表空间后,尝试删除磁盘组报错:

[grid@dbserver1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 16 10:16:23 2011

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> set lines 120 pages 100
SQL> drop diskgroup DATA_AU1M;
drop diskgroup DATA_AU1M
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15053: diskgroup "DATA_AU1M" contains existing files


SQL> drop diskgroup DATA_AU4M;

Diskgroup dropped.

另一个磁盘组则在删掉所有的表空间后顺利删除。

检查发现ASM启动的SPFILE文件还保存在DATA_AU1M磁盘组中,如果强制删除,则会导致ASM实例无法启动。

SQL> show parameter spfile

NAME           TYPE      VALUE
-------------- --------- ------------------------------
spfile         string    +DATA_AU1M/asm/asmparameterfile/registry.253.758304963

利用CREATE PFILE FROM SPFILE创建一个文本的初始化参数:

SQL> create pfile from spfile;

File created.

SQL> host
[grid@dbserver1 ~]$ cd $ORACLE_HOME/dbs
[grid@dbserver1 dbs]$ ls
ab_+ASM.dat hc_+ASM.dat init+ASM.ora init.ora orapw+ASM
[grid@dbserver1 dbs]$ more init+ASM.ora
+ASM.__large_pool_size=25165824
+ASM.asm_diskgroups='DATA_AU2M','DATA','DATA_AU8M'#Manual Dismount
*.asm_diskstring='/dev/asm*'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/grid'
*.instance_type='asm'
*.large_pool_size=12M
*.local_listener='LISTENER_+ASM'
*.remote_login_passwordfile='EXCLUSIVE'

初始化参数中ASM_DISKGROUPS中并没有包含第一个磁盘组DATA_AU1M,而尝试利用这个PFILE启动也会发现,DATA_AU1M并没有加载:

[grid@dbserver1 dbs]$ exit
exit

SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup pfile=?/dbs/init+ASM.ora
ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2225792 bytes
Variable Size 256539008 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> select group_number, name from v$asm_diskgroup;

GROUP_NUMBER NAME
------------ ------------------------------
           1 DATA_AU2M
           2 DATA_AU8M
           3 DATA
           0 DATA_AU1M

SQL> show parameter spfile

NAME           TYPE      VALUE
-------------- --------- ------------------------------
spfile         string

下面编辑PFILE,添加DATA_AU1M磁盘组到初始化参数ASM_DISKGROUPS中,再次启动ASM实例:

SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup pfile=?/dbs/init+ASM.ora
ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2225792 bytes
Variable Size 256539008 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> select group_number, name from v$asm_diskgroup;

GROUP_NUMBER NAME
------------ ------------------------------
           1 DATA_AU1M
           2 DATA_AU2M
           3 DATA_AU8M
           4 DATA

下面创建SPFILE,指定其他的磁盘组存放:

SQL> create spfile='+DATA' from pfile='/u01/app/grid/product/11.2.0/gridhome_1/dbs/init+ASM.ora';

File created.

SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2225792 bytes
Variable Size 256539008 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> show parameter spfile

NAME           TYPE      VALUE
-------------- --------- ------------------------------
spfile         string    +DATA/asm/asmparameterfile/registry.253.759323107
SQL> select group_number, name from v$asm_diskgroup;

GROUP_NUMBER NAME
------------ ------------------------------
           1 DATA_AU1M
           2 DATA_AU2M
           3 DATA_AU8M
           4 DATA

对于ASM磁盘组而言,最后一个提供给它的SPFILE会自动作为ASM启动的SPFILE,不需要在文件系统中通过PFILE来指定,这是11.2ASM自启动的机制。

下面可以强制删除磁盘组了,不过最好的办法是先删除问题,通过ASMCMD可以轻松的实现,而在ASM实例中也可以通过DROP FILE的方式实现:

SQL> drop diskgroup data_au1m;
drop diskgroup data_au1m
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15053: diskgroup "DATA_AU1M" contains existing files

SQL> select a.name, type
2 from v$asm_alias a, v$asm_file b
3 where a.group_number = 1
4 and b.group_number = 1
5 and a.file_number = b.file_number;

NAME                           TYPE
------------------------------ --------------------
REGISTRY.253.758304963         ASMPARAMETERFILE

SQL> alter diskgroup data_au1m drop file '+DATA_AU1M/asm/asmparameterfile/registry.253.758304963';

Diskgroup altered.

SQL> drop diskgroup data_au1m;

Diskgroup dropped.

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4227/viewspace-705218/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 个人主页
请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2007-12-29

  • 博文量
    1955
  • 访问量
    10522575