代码改变世界

Oracle:Create tablespace and move table to another tablespace

2011-09-23 17:24  Tracy.  阅读(713)  评论(0编辑  收藏  举报

CREATE TABLESPACE "IMAGEDATA"
    NOLOGGING
    DATAFILE 'D:/oracle/oradata/DATA01.dbf' SIZE 2000M,
    'D:/oracle/oradata/DATA02.dbf' SIZE 2000M,
    'D:/oracle/oradata/DATA03.dbf' SIZE 2000M,
    'D:/oracle/oradata/DATA04.dbf' SIZE 2000M,
    'D:/oracle/oradata/DATA05.dbf' SIZE 2000M EXTENT
    MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT  AUTO

----------------------------------------------------------------------------------------

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
TEMP
EXAMPLE
INDX
USERS
PERF

7 rows selected.

SQL> create table test(a number);

Table created.

SQL> select tablespace_name from tabs where table_name='TEST';

TABLESPACE_NAME
------------------------------
SYSTEM

SQL> alter table test move users;
alter table test move users
*
ERROR at line 1:
ORA-14133: ALTER TABLE MOVE cannot be combined with other operations


SQL> alter table test move tablespace users;

Table altered.

SQL> select tablespace_name from tabs where table_name='TEST';

TABLESPACE_NAME
------------------------------
USERS

SQL>
SQL> drop table test;

Table dropped.

SQL>