做实验发现Oracle11gR2,创建无数据的table、index等对象,oracle为了节省空间,开始并不分配segment,而是等有dml操作时才会分配segment,即使dml回滚,分配的segment并不回收。
简单实验如下:
SQL> create table test(a number);
Table created.
SQL> create index ind_test on test(a);
Index created.
QL> select segment_name,bytes from dba_segments wheresegment_name='TEST' and owner='WXLUN';
no rows selected
SQL> insert into test values(1);
1 row created.
SQL>
SQL> col SEGMENT_NAME for a22
SQL> select segment_name,bytes from dba_segments wheresegment_name in ('TEST','IND_TEST') and owner='WXLUN';
SEGMENT_NAME
BYTES
---------------------- ----------
IND_TEST