How To Remove An Empty ASM System Directory
来源:互联网 发布:凯文 斯科特纳 知乎 编辑:程序博客网 时间:2024/05/21 12:49
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
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.
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;
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
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
- How To Remove An Empty ASM System Directory
- How to remove an ASM instance and its corresponding database(s) on WINDOWS
- How to remove an ASM instance and its corresponding database(s) on UNIX
- How to remove Duplicates from an Array
- How to pass an empty string to Value Prompt
- How to judge whether an array is empty?
- How to write an operating system
- How to write an operating system
- How to create an RMI system
- How To Create manually an ASM Instance From Scratch
- How to display an empty row when the underlying dataset is empty
- How to Copy an Entire Directory in VB6?
- How to manually remove an infected file from your computer
- how to unzip a file in a system directory
- remove a directory which is not empty
- How to Remove Windows Inviolability System Rogue Virus
- How to deal ERROR: JAVA_HOME is set to an invalid directory.
- How to move a datafile from a file system to ASM
- 预防数据库攻击的PHP函数一例子 mysql_real_escape_string()
- 表达式计算器(MFC)
- 海龟画图(Windows API及C++)
- AVL树的描绘(Java)
- 《Java语言》练习题
- How To Remove An Empty ASM System Directory
- 深入Hadoop HDFS
- 统计图(Java)
- 汉诺塔算法仿真(Java)
- SQL Server 2005里设置自增字段
- RIP网络仿真(Java)
- 陈华惠求职简历
- ubuntu配置java jdk
- XXTEA 加密算法的 JavaScript 和 PHP 实现