刪除使用者下的所有的object

netwant發表於2011-04-13
oracle drop schema[@more@]

1、建立一個刪除的指令碼

set heading off
set feedback off
set pagesize 0
spool c:1.sql
select 'drop table '||table_name|| ';' from user_tables;
select 'drop view '||view_name|| ';' from user_views;
select 'drop sequence '||sequence_name|| ';' from user_sequences;
select 'drop function '||object_name|| ';' from user_objects where object_type='FUNCTION';
select 'drop procedure '||object_name|| ';' from user_objects where object_type='PROCEDURE';
select 'drop package '||object_name|| ';' from user_objects where object_type='package';
select 'drop database link '||object_name|| ';' from user_objects where object_type='DATABASE LINK';
spool off;
set heading on;
set feedback on;

2、執行指令碼

sql>@1.sql

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/309902/viewspace-1048609/,如需轉載,請註明出處,否則將追究法律責任。

相關文章