home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / oracle / 1533 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.2 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!umn.edu!chaos.cs.umn.edu!bill
  2. From: bill@chaos.cs.umn.edu
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: Dropping All Tables
  5. Message-ID: <bill.715989021@chaos.cs.umn.edu>
  6. Date: 8 Sep 92 21:50:21 GMT
  7. References: <Bu11us.Fx0@well.sf.ca.us> <bill.715979790@chaos.cs.umn.edu>
  8. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  9. Distribution: usa
  10. Organization: University of Minnesota
  11. Lines: 31
  12. Nntp-Posting-Host: chaos.cs.umn.edu
  13.  
  14.  
  15. >In <Bu11us.Fx0@well.sf.ca.us> mharper@well.sf.ca.us (Michael J. Harper) writes:
  16.  
  17. >What is the easiest way to remove all tables, views, synonyms, etc. owned
  18. >by a particular user?
  19.  
  20. we grant ourself access and login as the user,
  21.  
  22. set paus off;
  23. set pages 999;
  24. set head off;
  25. spo spool_file_name.sql
  26. select 'drop table ', table_name, ';'
  27. from cat
  28. where table_type = 'TABLE';
  29. select 'drop view ', table_name, ';'
  30. from cat
  31. where table_type = 'VIEW';
  32. select 'drop synonym '', table_name, ';'
  33. from cat
  34. where table_type = 'SYNONYM';
  35. spo off;
  36.  
  37. then use your favorite edit method to clean up the spool file prior to
  38. running it, or just run it and ignore the error messages.
  39.  
  40. @spool_file_name
  41.  
  42. bill pociengel
  43. --
  44. bill@chaos.cs.umn.edu
  45.