oracle+账号密码管理Drop all from schema owner

Drop all from schema owner

 

Sql代码    www.2cto.com  

— To drop all user objects under a schemad  

set heading off;  

set feedback off;  

set echo on;  

set serveroutput off;  

set termout off;  

spool drop_all_objects.sql  

select CASE object_typoracle账号e   

    WHEN 'TABLE' then 'DROP ' || object_type || ' ' || object_name || ' CASCADE CONSTRAINTS PURGE;'  

    WHEN 'VIEW' then 'DROP ' || object_type || ' ' || object_name || ' CASCADE CONSTRAINTS;'  

    else 'DROP ' || object_type || ' ' || object_name || ';'  

    END as "–text"  

from user_objects  

where object_name not like '%BIN$%' and object_type not in ('PACKAGE BODY', 'TABLE PARTITION', 'INDEX', 'INDEX PARTITION')  

order by object_type, object_name;   

spool off;  

set echo on feedback on  

spool drop_all.log  

@drop_all_objects.sql  

spool off  

/  

purge recyclebin  

/  

CREATE OR REPLACE TYPE BULK_LOAD_OBJ   AS OBJECT  

 ( generic_key varchar2(200)    

  )  

/  

CREATE OR REPLACE TYPE bulk_load_ntt AS TABLE OF bulk_load_obj  

/  

create or replace TYPE  "RECORD_KEY_VARRAY"   AS VARRAY(1000) OF VARCHAR2(100);  

/  

quit  

 

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。