Ask the Expert

Moving table with indexes to another tablespace

Do you know how to move an Oracle table to another tablespace along with its associated indexes? I am having trouble with a LOB moving from tablespace A to B.

    Requires Free Membership to View

To move a table to another tablespace, issue the following command:
ALTER TABLE table_name MOVE TABLESPACE new_ts;
To move an index, use the following:
ALTER INDEX index_name REBUILD TABLESPACE new_ts;
To move the LOB when moving the table, use the following:
ALTER TABLE table_name MOVE TABLESPACE new_ts 
LOB (lob_item) STORE AS (TABLESPACE another_new_ts);
All of this is documented in the SQL Reference Guide.

This was first published in September 2006

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: