删除用户下所有对象

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lovedieya/article/details/48317581

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';
 

猜你喜欢

转载自blog.csdn.net/lovedieya/article/details/48317581