Oracle 10 Gb table transfer tablespace

Source: Internet
Author: User

1. Single Table transfer tablespace
Scenario: If a table user is stored in the tablespace oldspace, you must move the table user to the tablespace newspace.
 
Execute the statement:
Alter table user move tablespace newspace;
Commit;
 
2. All tables under scott are transferred to the tablespace newspace.
Select 'alter table' | table_name | 'move tablespace newspace; commit ;'
From user_tables where owner = 'Scott'
 
 
 
However, after the table user is moved to the tablespace newspace, will the indexes on the table user be automatically transferred to the tablespace newspace?
 
3. Index transfer tablespace, for example, the index idx_user on the user table
Alter index idx_user rebuild tablespace newspace
 
4. All indexes under user scott are transferred to the tablespace newspace.
Select 'alter Index' | index_name | 'rebuild tablespace newspace; commit ;'
From user_indexs where owner = 'Scott'

Author "lelong"
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.