Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Drop table in sql
Cuong Quyen Truong wrote:
>
> Does anyone know how to drop all the tables with one sql sttement.
Hi,
If they are all in one tablespace you can drop the tablespace including
contents. The best way is to create a sql script that drops each table.
Example:
set echo off head off pagesize 0 verify off feedback off
spool drop_table.sql
select 'drop '||owner||'.'||object_name||';'
from dba_objects
where owner in ('owner1','owner2',.....)
order by 1
/
spool off
start drop_table.sql
exit
be sure NOT to include system or sys in the list of owners.
Hope this helps
Regards, Dick
Received on Thu Sep 18 1997 - 00:00:00 CDT
![]() |
![]() |