How To Remove An Empty ASM System Directory (Doc ID 444812.1)

Last updated on JANUARY 17, 2015

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.1.0 [Release 10.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 18-Jul-2013***

Goal

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 :

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)

 

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.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms