rem $DBA/dbdelete.sql ttitle off spool dbdelete.tmp set termout off set feedback off set heading off set pagesize 999 set verify off column seq format 99 noprint select 1 seq, 'find '|| nvl(ltrim(substr(value,1,instr(value||',',',',1,1)-1)),'foobar')|| ' -print -exec rm {} \;' from v$parameter where name = 'control_files' union select 2 seq, 'find '||nvl(ltrim(substr(value,instr(value||',',',',1,1)+1, instr(value||',',',',1,2)-instr(value||',',',',1,1)-1)),'foobar')|| ' -print -exec rm {} \;' from v$parameter where name = 'control_files' union select 3 seq, 'find '||nvl(ltrim(substr(value,instr(value||',',',',1,2)+1, instr(value||',',',',1,3)-instr(value||',',',',1,2)-1)),'foobar')|| ' -print -exec rm {} \;' from v$parameter where name = 'control_files' union select 4 seq, 'find '||nvl(ltrim(substr(value,instr(value||',',',',1,3)+1, instr(value||',',',',1,4)-instr(value||',',',',1,3)-1)),'foobar')|| ' -print -exec rm {} \;' from v$parameter where name = 'control_files' union select 5 seq, 'find '||rtrim(member)|| ' -print -exec rm {} \;' from v$logfile a, v$log b where a.group# = b.group# union select 6 seq, 'find '||rtrim(file_name)|| ' -print -exec rm {} \;' from dba_data_files order by 1; spool off set termout on #prompt Created dbdelete.tmp which can be used to delete database &1 exit