删除用户下所有对象

SELECT DISTINCT(object_TYPE) from user_objects;


select 'drop table '||object_name||' cascade constraints PURGE;' from user_objects where object_TYPE='TABLE';

--select 'drop INDEX '||object_name ||' ;' from user_objects where object_TYPE='INDEX';

select 'drop VIEW '||object_name ||' ;' from user_objects where object_TYPE='VIEW';

select 'drop PACKAGE '||object_name ||' ;' from user_objects where object_TYPE='PACKAGE';


--select 'drop PACKAGE BODY '||object_name ||' ;' from user_objects where object_TYPE='PACKAGE BODY';

select 'drop SEQUENCE '||object_name ||' ;' from user_objects where object_TYPE='SEQUENCE';

你可能感兴趣的:(oracle,删除,对象,脚本)