Re: Newbie Question

From: Daniel Murray <dmurray_at_gnncast.net>
Date: Tue, 22 Jun 1999 19:31:32 GMT
Message-ID: <376FE66E.74210DFA_at_gnncast.net>


First, spool a file in sql*plus with the following commands while you are logged in as DBA. BE WARNED, doing this will delete ALL of your tables. If you are logged in as SYS, it will do them also.

select 'drop table '||owner||'.'||table_name||' cascade constraints;' from dba_objects where object_type = 'TABLE'

select 'drop sequence '||owner||'.'||object_name||';' from dba_objects where object_type = 'SEQUENCE'

If you want to only delete the tables for the user you are logged in as replace the portion which says dba_objects with user_objects. It will only spool the tables which the user owns.

Make sure to
set headings off,
set pages 0
set feedback off
set echo off
before you run the following commands.

Once you spool the files, you can then run the spooled files via sql*plus.

Hope this helps.
Ghengis wrote:

> How do I delete ALL my tables or sequences in one go?
>
> Regards
>
> JK
Received on Tue Jun 22 1999 - 21:31:32 CEST

Original text of this message