Bu Blogda Ara

5 Aralık 2011 Pazartesi

Truncate table drop all storage - New feature 11.2

Truncate process reduce to initial value from table size before 11.2 versiyon.
New feature of truncate is drop all storage. This sytax reduce to zero from size table.


#Only truncate process:

-------------------------------------------------------------------------------------------------------------------
SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 5 16:17:19 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> set linesize 1000
SQL> create table muratk_dba.truncate_table as select * from scott.emp;
Table created.
SQL> select sum(bytes)/1024/1024 from dba_segments where segment_name ='TRUNCATE_TABLE';
SUM(BYTES)/1024/1024
--------------------
               .0625
SQL> truncate table muratk_dba.truncate_table;
Table truncated.
SQL> select sum(bytes)/1024/1024 from dba_segments where segment_name ='TRUNCATE_TABLE';
SUM(BYTES)/1024/1024
--------------------
               .0625

# Truncate process with drop all storage feature
-------------------------------------------------------------------------------------------------------------------------------
SQL> drop table muratk_dba.truncate_table purge;
Table dropped.
SQL> create table muratk_dba.truncate_table as select * from scott.emp;
Table created.
SQL> select sum(bytes)/1024/1024 from dba_segments where segment_name ='TRUNCATE_TABLE';
SUM(BYTES)/1024/1024
--------------------
               .0625
SQL> truncate table muratk_dba.truncate_table  drop all storage;
Table truncated.
SQL> select sum(bytes)/1024/1024 from dba_segments where segment_name ='TRUNCATE_TABLE';
SUM(BYTES)/1024/1024
--------------------

SQL> drop table muratk_dba.truncate_table purge;
Table dropped.

Hiç yorum yok:

Yorum Gönder