Delete all table in the schema with a single command
Hi All,
I want to delete all the tables in my schema in a single command / function. I don't have DBA rights for this schema and I have only SQL Plus. I am working on :
Oracle9i Enterprise Edition Release 9.0.1.0.0 - Production
PL/SQL Release 9.0.1.0.0 - Production
CORE 9.0.1.0.0 Production
TNS for Solaris: Version 9.0.1.0.0 - Production
NLSRTL Version 9.0.1.0.0 - Production
I saw that he indeed wrote Tables, but what I guessed, seeing the way he posted, was he wants to flush all of the objects(Tables,Procs,Packages and so)...
Let him comment on it.
Abhay.
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
set termout on
set head off feedback off verify off termout off
spool /tmp/drop_all.sql
Select
Rtrim('drop '||object_type||' '||owner||'.'
||object_name||decode(object_type,'TABLE',' cascade constraints')
|| ';' )
from dba_objects
where owner = upper('&owner')
order by object_name
/
spool off
set head on feedback on verify on
spool /tmp/drop_all.log
set echo on
@/tmp/drop_all.sql
spool off
set echo off
set pagesize 14 termout on
Bookmarks