dropping a table [message #374983] |
Tue, 17 July 2001 08:15 |
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 |
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 #374991 is a reply to message #374984] |
Tue, 17 July 2001 09:27 |
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 #375000 is a reply to message #374984] |
Tue, 17 July 2001 23:25 |
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
|
|
|