set
heading
off
;
set
feedback
off
;
spool f:\dropobj.sql;
prompt
select
'alter table '
||table_name||
' drop constraint '
||constraint_name||
' ;'
from
user_constraints
where
constraint_type=
'R'
;
prompt
select
'drop table '
||table_name ||
';'
from
user_tables;
prompt
select
'drop view '
||view_name||
';'
from
user_views;
prompt
select
'drop sequence '
||sequence_name||
';'
from
user_sequences;
prompt
select
'drop function '
||object_name||
';'
from
user_objects
where
object_type=
'FUNCTION'
;
prompt
select
'drop procedure '
||object_name||
';'
from
user_objects
where
object_type=
'PROCEDURE'
;
prompt
prompt
select
'drop package '
|| object_name||
';'
from
user_objects
where
object_type=
'PACKAGE'
;
prompt
select
'drop database link '
|| object_name||
';'
from
user_objects
where
object_type=
'DATABASE LINK'
;
spool
off
;
set
heading
on
;
set
feedback
on
;
@@f:\dropobj.sql;
host del f:\dropobj.sql;