home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!umn.edu!chaos.cs.umn.edu!bill
- From: bill@chaos.cs.umn.edu
- Newsgroups: comp.databases.oracle
- Subject: Re: Dropping All Tables
- Message-ID: <bill.715989021@chaos.cs.umn.edu>
- Date: 8 Sep 92 21:50:21 GMT
- References: <Bu11us.Fx0@well.sf.ca.us> <bill.715979790@chaos.cs.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Distribution: usa
- Organization: University of Minnesota
- Lines: 31
- Nntp-Posting-Host: chaos.cs.umn.edu
-
-
- >In <Bu11us.Fx0@well.sf.ca.us> mharper@well.sf.ca.us (Michael J. Harper) writes:
-
- >What is the easiest way to remove all tables, views, synonyms, etc. owned
- >by a particular user?
-
- we grant ourself access and login as the user,
-
- set paus off;
- set pages 999;
- set head off;
- spo spool_file_name.sql
- select 'drop table ', table_name, ';'
- from cat
- where table_type = 'TABLE';
- select 'drop view ', table_name, ';'
- from cat
- where table_type = 'VIEW';
- select 'drop synonym '', table_name, ';'
- from cat
- where table_type = 'SYNONYM';
- spo off;
-
- then use your favorite edit method to clean up the spool file prior to
- running it, or just run it and ignore the error messages.
-
- @spool_file_name
-
- bill pociengel
- --
- bill@chaos.cs.umn.edu
-