用ASM的话在建表空间之类的操作时用OMF机制,删除的时候就会自动删文件了
备份相关的文件可以用rman进行删除
如果文件已经在数据库中没有记录,但是ASM里面还有,oracle提供了下面的办法
export ORACLE_SID=+ASM
sqlplus "/as sysdba"
跑下面的脚本
set pagesize 0
set linesize 200
col full_alias_path format a80
/*+ ----------------------------------------------------------------
Query will return all the files stored on ASM but not currenlty
opened by any database client of the diskgroups
ordered by group number, file type
---------------------------------------------------------------*/
select * from (
/*+ -----------------------------------------------------------------
1st branch returns all the files stored on ASM
-----------------------------------------------------------------*/
select x.gnum,x.filnum,x.full_alias_path,f.ftype from (