truncate 空间不释放问题

SQL> set linesize 200

SQL> select segment_name, sum(bytes / 1024 / 1024/1024)

  from dba_segments

  where segment_name='T_PM_DEBIT_CARD'

  group by segment_name;  2    3    4 

 

SEGMENT_NAME                                                                 SUM(BYTES/1024/1024/1024)

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

T_PM_DEBIT_CARD                                                                  16.1968994

truncate 空间不释放问题_第1张图片

 truncate table T_PM_DEBIT_CARD;

SQL> select segment_name, sum(bytes / 1024 / 1024 / 1024)

  from dba_segments

 where segment_name = 'T_PM_DEBIT_CARD'

 group by segment_name;  2    3    4 

 

SEGMENT_NAME                                    SUM(BYTES/1024/1024/1024)

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

T_PM_DEBIT_CARD                                         .836181641

为什么还有800M呢?

SQL> alter table T_PM_DEBIT_CARD deallocate unused keep 0;

 

Table altered.

 

SQL> select segment_name, sum(bytes / 1024 / 1024 / 1024)

  from dba_segments

 where segment_name = 'T_PM_DEBIT_CARD'

 group by segment_name;  2    3    4 

 

SEGMENT_NAME                                    SUM(BYTES/1024/1024/1024)

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

T_PM_DEBIT_CARD                                         .051513672

是因为initial 分配的缘故.

 

 

你可能感兴趣的:(truncate)