Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to drop all of a user's data?
<andrew.fabbro_at_gmail.com> a écrit dans le message de news: 1153514221.715473.214990_at_s13g2000cwa.googlegroups.com...
|I have user joeschmo in a 10g database. I have a script that creates a
| bunch of tables, sequences, packages, etc. under that user (called
| joeschmo.table1, etc.)
|
| How can I delete all the tables, sequences, packages, etc. for user
| joeschmo - without deleting the user? I can do a lot of drop table x,
| drop sequence y, but I was hoping for something in a single statement.
|
| I'm probably missing something obvious...
|
set heading off
set pagesize 0
set feedback off
set timing off
set time off
set trimspool on
set trimout on
set linesize 100
set echo off
spool t
select 'drop '||object_type||' '||object_name||
decode(object_type,'CLUSTER',' including tables cascade constraints', 'TABLE',' cascade constraints', '')||';'
where object_type in ('CLUSTER','CONTEXT','DATABASE LINK','DIMENSION', 'DIRECTORY','FUNCTION','INDEX TYPE', 'JAVA','LIBRARY','MATERIALIZED VIEW','OPERATOR', 'OUTLINE','PACKAGE','PROCEDURE','SEQUENCE', 'SYNONYM','TABLE','TYPE','VIEW')order by object_type, object_name
Regards
Michel Cadot
Received on Sat Jul 22 2006 - 00:21:40 CDT