Cannt drop tablespace (please, urgent) [message #287382] |
Wed, 12 December 2007 02:16  |
irremediable
Messages: 38 Registered: December 2007
|
Member |
|
|
Hello!
I have a tablespace that has about 2000 tables.
The only owner of tables in this TS is a user DWH.
I was trying to drop it,
"DROP TABLESPACE DWH INCLUDING CONTENTS AND DATAFILES"
but it says
"unique/primary keys in table referenced by foreign keys"
I retrieved the list of all constraints of tables that are not in this TS like this
SELECT * FROM all_constraints
WHERE (r_owner, r_constraint_name) IN (SELECT owner
,constraint_name
FROM user_constraints F
WHERE constraint_type IN ('P', 'U')
AND table_name IN (SELECT TABLE_NAME FROM USER_TABLES WHERE TABLESPACE_NAME = 'DWH')
)
and disabled them (staus is shown as DISABLED).
But when trying do drop it again it again says
"unique/primary keys in table referenced by foreign keys"
Could you please tell what I'm doing wrong?
Thank you!
|
|
|
|
|
Re: Cannt drop tablespace (please, urgent) [message #287385 is a reply to message #287383] |
Wed, 12 December 2007 02:28   |
irremediable
Messages: 38 Registered: December 2007
|
Member |
|
|
Exsume me for using the "URGENT" word.
But the link-docs say that using the CASCADE word when dropping a tablespace it drops foreign key constraints that reference tables' unique or primary constraints in the dropped
tablespace.
That means I'll lose those foreign keys.
Am I right?
|
|
|
|
Re: Cannt drop tablespace (please, urgent) [message #287389 is a reply to message #287387] |
Wed, 12 December 2007 02:34   |
irremediable
Messages: 38 Registered: December 2007
|
Member |
|
|
What I'm trying to do is to recreate the tablespace.
It contained only one big file.
I'm going to split the tablespace into 5 datafiles.
I've exported it's data into a dmup file.
This is why I want to drop it, recreate with 5 datafiles
and then import the data back.
Is there any other solution?
Thank you.
|
|
|
|
|
|
|
Re: Cannt drop tablespace (please, urgent) [message #287401 is a reply to message #287400] |
Wed, 12 December 2007 02:56   |
Mohammad Taj
Messages: 2412 Registered: September 2006 Location: Dubai, UAE
|
Senior Member |

|
|
Can the following be a solution
1.To create a new TS, named DWH_TEMP.
2.Move the objects (alter table....move) from DWH to DWH_TEMP.
also rebuild all indexes and if your tables contents LONG datatype will not move to new tablespace.
3.Rename the DWH to DWH_OLD.
4.Rename DWH_TEMP to DWH.
5.Drop DWH.
Yes,but also test first on dev/test db.
[Updated on: Wed, 12 December 2007 02:57] Report message to a moderator
|
|
|
|
|
|
|
|
|
|