签到成功

知道了

CNDBA社区CNDBA社区

How To Remove An Empty ASM System Directory

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

 

       Sometimes it can happen that the ASM contains empty system directories which cannot be removed. According to Note 3751057.8(ALTER DISKGROUP DROP DIRECTORY FORCE removes system aliases) the system generated directories should be removed automatically as soon as all it's files are removed. However this does not happen sometimes and a manual directory removal will fail :  

 

SQL> set pages 2000
SQL> SELECT level, dir, sys, substr(lpad(' ',2*level,' ')||CONCAT('+'||gname,
     SYS_CONNECT_BY_PATH(aname,'/')),1,60) full_path
     FROM ( SELECT g.name gname, a.parent_index pindex, a.name aname,
     a.reference_index rindex, a.ALIAS_DIRECTORY dir, a.SYSTEM_CREATED sys
                      FROM v$asm_alias a, v$asm_diskgroup g
                    WHERE a.group_number = g.group_number)
     START WITH (MOD(pindex, POWER(2, 24))) = 0
     CONNECT BY PRIOR rindex = pindex
     ORDER BY rtrim(ltrim(full_path))desc, level asc;

          3 N Y       +DATA/UDWH/DATAFILE/ADASTRA.376.624105133             
          2 Y Y     +DATA/UDWH/DATAFILE                                     
          3 N Y       +DATA/UDWH/CONTROLFILE/Current.486.624103637          
          3 N Y       +DATA/UDWH/CONTROLFILE/Current.479.624103637          
          3 N Y       +DATA/UDWH/CONTROLFILE/Current.434.624103637          
          2 Y Y     +DATA/UDWH/CONTROLFILE                                  
          1 Y Y   +DATA/UDWH                                               
          1 Y Y   +DATA/TDWH                                                
          2 N N     +DATA/IDWH/spfileIDWH.ora                               
          2 N N     +DATA/IDWH/control03.ctl                                
          2 N N     +DATA/IDWH/control02.ctl                                
          2 N N     +DATA/IDWH/control01.ctl  

 

The TDWH directory from the above list is empty but cannot be removed :

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

ASMCMD> cd tdwh
ASMCMD> ls
ASMCMD> cd ..
ASMCMD> rm -rf tdwh
ORA-15032: not all alterations performed
ORA-15177: cannot operate on system aliases (DBD ERROR: OCIStmtExecute)

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

 

alter diskgroup DATA drop directory  '+DATA/TDWH' FORCE; 
ORA-15032: not all alterations performed 
ORA-15177: cannot operate on system aliases (DBD ERROR: OCIStmtExecute)

  

A solution to remove these directories is to recreate the ASM diskgroups but this is not something one would do very often especially when the ASM is used by production databases.

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

Solution

Either:
       Create a new database with the DBCA having the same name as the old directory and subsequently drop the database with the DBCA.

Or:
       Create a dummy tablespace having a datafile within the directory to be dropped, drop the tablespace and then remove the datafile using the ASMCMD tool. The old directory will be removed automatically.
http://www.cndba.cn/Dave/article/798

 

       There is a scenario when there are left behind directories after the database is dropped using RMAN's command "drop database including backups [noprompt];". When one falls into this there is no way out but to recreate the diskgroups. This problem is being investigated in Bug 6606689. To avoid this issue one should run the following two commands instead of  "DROP DATABASE INCLUDING BACKUPS;":

RMAN> delete backupset;

RMAN> drop database;

 

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

 

 

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

From Oracle

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

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

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

Email: dvd.dba@gmail.comhttp://www.cndba.cn/Dave/article/798

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

DBA 超级群:63306533();  DBA4 群: 83829929  DBA5群: 142216823    http://www.cndba.cn/Dave/article/798

聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

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

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

oracle 11g

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

dave

关注

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

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

        QQ交流群

        注册联系QQ