Dealocate Unusd Extent

SQL> analyze table scott.emp compute statistics;

 Table analyzed.

 

SQL> select num_rows,AVG_ROW_LEN

           from dba_tables

          where table_name='EMP';


   NUM_ROWS AVG_ROW_LEN

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

        14          40

 

SQL>  SELECT table_name, initial_extent, next_extent,

             max_extents, num_rows,pct_free

            FROM dba_tables

            WHERE table_name = 'EMP';

TABLE_NAME      INITIAL_EXTENT     NEXT_EXTENT      MAX_EXTENTS      NUM_ROWS       PCT_FREE

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

EMP                              65536                                                          2147483645                      14                             10

 

SQL> SELECT BYTES

           FROM DBA_SEGMENTS

           WHERE SEGMENT_NAME='EMP';

     BYTES

----------

     65536

 

SQL> ALTER TABLE SCOTT.EMP ALLOCATE EXTENT;

Table altered.

 

SQL> analyze table scott.emp compute statistics;

Table analyzed.

 

SQL> SELECT BYTES

          FROM DBA_SEGMENTS

         WHERE SEGMENT_NAME='EMP';


     BYTES

----------

    131072

 

SQL> ALTER TABLE SCOTT.EMP DEALLOCATE UNUSED;

Table altered.

 

SQL> SELECT BYTES

           FROM DBA_SEGMENTS

           WHERE SEGMENT_NAME='EMP';


     BYTES

----------

     65536

 

Comments