Home » RDBMS Server » Server Administration » dropping a table
dropping a table [message #374983] Tue, 17 July 2001 08:15 Go to next message
Martin Davies
Messages: 5
Registered: July 2001
Junior Member
I want to drop all tables from a tablespace without getting rid of the tablespace itself, but I've got no idea how to do it...I know this is a really simple question, but if you don't know, you don't know...any help would be appreciated
Thanks
Re: dropping a table [message #374984 is a reply to message #374983] Tue, 17 July 2001 09:01 Go to previous messageGo to next message
kavithask
Messages: 34
Registered: March 2001
Location: London
Member
Hi,

When you drop all the tables under a tablespace, it does not drop the tablespace at all. The tablespace is linked to the user and not to the tables. So you can drop all the tables and still keep the tablespace intact.

HTH
Kavitha
Re: dropping a table [message #374987 is a reply to message #374984] Tue, 17 July 2001 09:12 Go to previous messageGo to next message
Martin Davies
Messages: 5
Registered: July 2001
Junior Member
Yep - I know that - its just that I don't even know how to drop a table...told you it was a really easy question...
Re: dropping a table [message #374991 is a reply to message #374984] Tue, 17 July 2001 09:27 Go to previous messageGo to next message
kavithask
Messages: 34
Registered: March 2001
Location: London
Member
Hi,

If you type in DROP TABLE "table_name" where you replace the "table_name" with the name of the table you want. This will drop the table.

If you have too many tables, then paste the following into the SQL*Plus prompt:

set pages 0

select 'drop table ' || tname || ';'
from tab
/

The above SQL will generate the drop commands. Just copy the commands and paste them into SQL*Plus prompt.

HTH
Kavitha
Re: dropping a table [message #374998 is a reply to message #374984] Tue, 17 July 2001 23:11 Go to previous messageGo to next message
Martin Davies
Messages: 5
Registered: July 2001
Junior Member
Thanks to both of you for your help - very much appreciated

Regards
Re: dropping a table [message #374999 is a reply to message #374984] Tue, 17 July 2001 23:16 Go to previous messageGo to next message
Martin Davies
Messages: 5
Registered: July 2001
Junior Member
Thanks to both of you for your help - very much appreciated

Regards
Re: dropping a table [message #375000 is a reply to message #374984] Tue, 17 July 2001 23:25 Go to previous message
Muhamad Sirajdin
Messages: 12
Registered: May 2001
Junior Member
i don't think u got what u wanted from these guys.

when u r going to dynamically drop the tables from shcema, it may not belong only to particular tablespace.

connect as a dba..
select 'drop table '||table_name||';' from dba_tables where tablespace_name='TS1';

this query helps u to achive what u want.

hope i am correct
Previous Topic: ora-03106 fatal two task communication error
Next Topic: How convert varchar2 to RAW in PL/SQL
Goto Forum:
  


Current Time: Sun Jul 07 16:48:23 CDT 2024