magqq
magqq

Reputation: 1023

Oracle Database: How can I alter a partitioned table to a new table space for not only the partitions but also the table itself?

How can I alter a partitioned table (in Oracle 10g Database) to a new table space for not only the partitions but also the table itself? Which I mean is, I can do following without issues, --sql alter table abc move partition abc01 tablespace new_tablespace; alter table abc move partition abc02 tablespace new_tablespace; alter table abc move partition abc03 tablespace new_tablespace;

but somehow the table's definition is still associating with the old table space, and and I have moved all tables data off the old table space. If I query the dba_segment for the old table space, there is nothing there. My question is, may I drop the old table space, even no data in the data files in the old table space, but somehow those partitioned tables definitions still associating with the old table space?

Upvotes: 2

Views: 1444

Answers (1)

Adam Musch
Adam Musch

Reputation: 13638

Each partition must be moved, as you've discovered. If you want new partitions to be created in a different tablespace without specifying that new tablespace, you'd have to use the following:

alter table abc modify default attributes tablespace new_tablespace;

Upvotes: 3

Related Questions