Oracle移動表

來源:互聯網
上載者:User

Oracle移動表

在建立表時可以為表指定儲存空間,如果不指定,Oracle會將該表格儲存體到預設的資料表空間中。根據需要可以將表從一個資料表空間移動到另一個資料表空間中。文法如下:

alter table table_name move tablespace tablespace_name;
SQL> select table_name,tablespace_name from user_tables;

TABLE_NAME
----------------------------------------
TABLESPACE_NAME
------------------------------
USERS
USERS


STUDENT
USERS


MESSAGE
USERS
如上所示,在該使用者的tablespace中有三張表,他們都位於users資料表空間中,
使用該語句移動student表:
SQL> alter table student move tablespace testspace;

表已更改。重新查詢

SQL> select table_name,tablespace_name from user_tables;

TABLE_NAME
----------------------------------------
TABLESPACE_NAME
------------------------------
USERS
USERS


MESSAGE
USERS


STUDENT
TESTSPACE

相關文章

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.