SQL> create temporary tablespace temp2 tempfile 'test2.dbf' size 50M;
Tablespace created.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
----------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 52428800 1048576 51380224
SQL> alter tablespace temp2 shrink space keep 40M;
Tablespace altered.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
--------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 42991616 1048576 41943040
SQL> alter tablespace temp2 shrink tempfile 'D:\APP\SANTONIE\PRODUCT\11.1.0\DB_1\DATABASE\TEST2.DBF' keep 30M;
Tablespace altered.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
---------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 32497664 1040384 31457280
SQL> alter tablespace temp2 shrink space;
Tablespace altered.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
--------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 2088960 1040384 1048576
Tablespace created.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
----------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 52428800 1048576 51380224
SQL> alter tablespace temp2 shrink space keep 40M;
Tablespace altered.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
--------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 42991616 1048576 41943040
SQL> alter tablespace temp2 shrink tempfile 'D:\APP\SANTONIE\PRODUCT\11.1.0\DB_1\DATABASE\TEST2.DBF' keep 30M;
Tablespace altered.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
---------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 32497664 1040384 31457280
SQL> alter tablespace temp2 shrink space;
Tablespace altered.
SQL> select * from dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
--------------- --------------- --------------- ----------
TEMP 20971520 4194304 19922944
TEMP2 2088960 1040384 1048576
No comments:
Post a Comment