Here the easy steps to move a table from one tablespace to another tablespace !!
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS
TEMP
KAVIN
FOOTBALL
6 rows selected.
SQL> create table spurs (playername VARCHAR(20),goals INT);
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS
TEMP
KAVIN
FOOTBALL
6 rows selected.
SQL> create table spurs (playername VARCHAR(20),goals INT);
Table created.
SQL> insert into spurs (playername,goals)
2 values ('Harry kane',187);
1 row created.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
SPURS TABLE
SQL> show user;
USER is "FOOTBALL"
SQL>
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
SPURS TABLE
SQL> alter table spurs move tablespace kavin;
Table altered.
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
SPURS KAVIN
SQL> alter table spurs move tablespace football;
Table altered.
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
SPURS FOOTBALL
SQL>
No comments:
Post a Comment