-
Alter nonparttioned table into partitioned one
Hi,
I am looking for the best way, to alter an existing large table to a partitioned (probably hash) one. Create a new partioned one, copy all the data, relink foreign keys, drop the old table and rename the new sounds a bit awful. Is there a better way?
Thaks
-
1. create your partitioned table empty with only one partition as new_table.
2. exchange table target_table with new_table
3. rename target_table to table_old
4. rename new_table to target_table
Jeff Hunter
-
1. create your partitioned table empty with only one partition as new_table.
OK
2. exchange table target_table with new_table
What do you mean with exchange? Does this also adapt the foreign keys on the target_table to new_table?
3. rename target_table to table_old
OK
4. rename new_table to target_table
OK
Thanks
-
Originally Posted by kholger
2. exchange table target_table with new_table
What do you mean with exchange? Does this also adapt the foreign keys on the target_table to new_table?
http://download-west.oracle.com/docs...titi.htm#11985
and I forgot:
5. split your one partition table to the partitions you really want.
Jeff Hunter
-
Originally Posted by marist89
Can't split, drop or merge hash partitions, though. Actualy it would be pretty ineffcient to keep splitting, and probably better to create the new table with the required partitions and insert into it.
kholger, when you say "probably hash", it makes me wonder whether you have got the right reasons worked out for using partitioning ... what problem are you trying to solve?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|