******************************DROP ALL OBJECTS**************************
set pagesize 0
set verify off
set feedback off
spool drop_objects.sql
select 'drop '||object_type||' '|| object_name|| DECODE(OBJECT_TYPE,'TABLE',' CASCADE CONSTRAINTS;',';') from user_objects;
spool off;
******************************DROP ALL TABLES******************************
SELECT 'DROP TABLE &owner..' || TABLE_NAME || ' CASCADE CONSTRAINTS;' FROM DBA_TABLES WHERE OWNER=UPPER('&owner');
******************************DROP ALL INDEXES******************************
SELECT 'DROP INDEX &owner..' || INDEX_NAME || ' CASCADE CONSTRAINTS;' FROM ALL_INDEXES WHERE OWNER=UPPER('&owner');
******************************DROP ALL SYNONYMS******************************
SELECT 'DROP synonym &owner..' || SYNONYM_NAME || ' ;' FROM ALL_SYNONYMS WHERE OWNER=UPPER('&owner');
******************************REVOKE ALL GRANTS**********************************
SELECT 'revoke .' || grant || ' ;' FROM ALL_SYNONYMS WHERE OWNER=UPPER('&owner');
No comments:
Post a Comment