My Oracle Support Banner

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

Last updated on FEBRUARY 18, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.1.0 [Release 10.2 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.

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/TEST/DATAFILE/ADASTRA.376.624105133                
   
          2 Y Y     +DATA/TEST/DATAFILE                                        
   
          3 N Y       +DATA/TEST/CONTROLFILE/Current.486.624103637             
   
          3 N Y       +DATA/TEST/CONTROLFILE/Current.479.624103637             
   
          3 N Y       +DATA/TEST/CONTROLFILE/Current.434.624103637             
   
          2 Y Y     +DATA/TEST/CONTROLFILE                                     
   
          1 Y Y   +DATA/TEST                                                   
   
          1 Y Y   +DATA/TDWH                                                   
   
          2 N N     +DATA/TEST/spfileTEST.ora                                  
   
          2 N N     +DATA/TEST/control03.ctl                                   
   
          2 N N     +DATA/TEST/control02.ctl                                   
   
          2 N N     +DATA/TEST/control01.ctl 

 

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

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

 

alter diskgroup DATA drop directory  '+DATA/TEST' 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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Goal
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.