Home  >  Article  >  Database  >  Oracle 11gR2 创建无数据对象临时不分配segment

Oracle 11gR2 创建无数据对象临时不分配segment

WBOY
WBOYOriginal
2016-06-07 17:33:281133browse

做实验发现oracle11gR2,创建无数据的table、index等对象,oracle为了节省空间,开始并不分配segment,而是等有dml操作时才会分配

做实验发现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

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn