The new feature of Oracle 11g r2, delay segment creation, that is, the default table created from 11GR2 does not set and allocate segment, and does not occupy disk space, which sounds reasonable, space is allocated only when the first data is inserted.
Test
- Sys @ ANBOB> conn anbob/anbob
- Connected.
- Anbob @ ANBOB>Select*FromV $ version;
- BANNER
- --------------------------------------------------------------------------------
- OracleDatabase11g Enterprise Edition Release 11.2.0.1.0-Production
- PL/SQL Release 11.2.0.1.0-Production
- CORE 11.2.0.1.0 Production
- TNSForLinux: Version 11.2.0.1.0-Production
- NLSRTL Version 11.2.0.1.0-Production
- Anbob @ ANBOB>Create TableTestnew (idInt Primary Key,NameVarchar2 (10 ));
- TableCreated.
- Anbob @ ANBOB>Create TableTestnew_IME (idInt Primary Key,NameVarchar2 (10) segment creation immediate;
- TableCreated.
- Anbob @ ANBOB>Create TableTestnew_def (idInt Primary Key,NameVarchar2 (10) segment creation deferred;
- TableCreated.
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_nameLike 'Testnew %';
- SEGMENT_NAME
- ---------------------------------------------------------------------------------
- TESTNEW_IME
- Anbob @ ANBOB>SelectINDEX_NAME, TABLE_OWNERFromUSER_indexesWhereTable_name ='Testnew';
- INDEX_NAME TABLE_OWNER
- ------------------------------------------------------------
- SYS_C0010903 ANBOB
- Anbob @ ANBOB>SelectINDEX_NAME, TABLE_OWNERFromUSER_indexesWhereTable_name ='Testnew _ ime';
- INDEX_NAME TABLE_OWNER
- ------------------------------------------------------------
- SYS_C0010904 ANBOB
- Anbob @ ANBOB>SelectINDEX_NAME, TABLE_OWNERFromUSER_indexesWhereTable_name ='Testnew _ DEF';
- INDEX_NAME TABLE_OWNER
- ------------------------------------------------------------
- Sys_c00000005 ANBOB
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_name ='Sys _ C0010903';
- No RowsSelected
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_name ='Sys _ C0010904';
- SEGMENT_NAME
- ---------------------------------------------------------------------------------
- SYS_C0010904
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_name ='Sys _ c00000005';
- No RowsSelected
- Anbob @ ANBOB>Insert IntoTestnewValues(1,'Anbob. com');
- 1 row created.
- Anbob @ ANBOB>Commit;
- CommitComplete.
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_nameLike 'Testnew %';
- SEGMENT_NAME
- ---------------------------------------------------------------------------------
- TESTNEW
- TESTNEW_IME
- Anbob @ ANBOB>SelectINDEX_NAME, TABLE_OWNERFromUSER_indexesWhereTable_name ='Testnew';
- INDEX_NAME TABLE_OWNER
- ------------------------------------------------------------
- SYS_C0010903 ANBOB
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_name ='Sys _ C0010903';
- SEGMENT_NAME
- ---------------------------------------------------------------------------------
- SYS_C0010903
- Anbob @ ANBOB>Truncate TableTestnew;
- TableTruncated.
- Anbob @ ANBOB>SelectSegment_nameFromUser_segmentsWhereSegment_nameLike 'Testnew %';
- SEGMENT_NAME
- ---------------------------------------------------------------------------------
- TESTNEW
- TESTNEW_IME
- Anbob @ ANBOB> conn sys/oracleAsSysdba
- Connected.
- Sys @ ANBOB>Create TableTestnew_def (idInt Primary Key,NameVarchar2 (10) segment creation deferred;
- Create TableTestnew_def (idInt Primary Key,NameVarchar2 (10) segment creation deferred
- *
- ERRORAtLine 1:
- ORA-14223: This table does not support delayed creation segments
Sys @ ANBOB> conn anbob/anbobConnected. anbob @ ANBOB> select * from v $ version; BANNER implements Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-ProductionPL/SQL Release 11.2.0.1.0-ProductionCORE 11.2.0.1.0 ProductionTNS for Linux: version 11.2.0.1.0-ProductionNLSRTL Version 11.2.0.1.0-Productionanbob @ ANBOB> create table testnew (id int primary key, name varchar2 (10); Table created. anbob @ ANBOB> create table testnew_IME (id int primary key, name varchar2 (10) segment creation immediate; Table created. anbob @ ANBOB> create table testnew_def (id int primary key, name varchar2 (10) segment creation deferred; Table created. anbob @ ANBOB> select segment_name from user_segments where segment_name like 'testnew % '; SEGMENT_NAME---------------------------------------------------------------------------------TESTNEW _ IMEanbob @ ANBOB> select INDEX_NAME, TABLE_OWNER from USER_indexes where table_name = 'testnew '; INDEX_NAME TABLE_OWNER comment Comment comment ANBOBanbob @ ANBOB> select INDEX_NAME, TABLE_OWNER from USER_indexes where table_name = 'testnew _ IME '; INDEX_NAME TABLE_OWNER comment Comment comment SYS_C0010904 ANBOBanbob @ ANBOB> select INDEX_NAME, TABLE_OWNER from USER_indexes where table_name = 'testnew _ DEF '; INDEX_NAME TABLE_OWNER without using sys_c00000005 ANBOBanbob @ ANBOB> select segment_name from user_segments where segment_name = 'sys _ c0010903 '; no rows selectedanbob @ ANBOB> select segment_name from user_segments where segment_name = 'sys _ C0010904 '; SEGMENT_NAME---------------------------------------------------------------------------------SYS _ blank @ ANBOB> select segment_name from user_segments where segment_name = 'sys _ c00000005 '; no rows selectedanbob @ ANBOB> insert into testnew values (1, 'anbob. com '); 1 row created. anbob @ ANBOB> commit; Commit complete. anbob @ ANBOB> select segment_name from user_segments where segment_name like 'testnew % '; SEGMENT_NAME---------------------------------------------------------------------------------TESTNEWTESTNEW _ IMEanbob @ ANBOB> select INDEX_NAME, TABLE_OWNER from USER_indexes where table_name = 'testnew '; INDEX_NAME TABLE_OWNER comment Comment comment ANBOBanbob @ ANBOB> select segment_name from user_segments where segment_name = 'sys _ C0010903 '; SEGMENT_NAME---------------------------------------------------------------------------------SYS _ C0010903anbob @ ANBOB> truncate table testnew. anbob @ ANBOB> select segment_name from user_segments where segment_name like 'testnew % '; SEGMENT_NAME---------------------------------------------------------------------------------TESTNEWTESTNEW _ IMEanbob @ ANBOB> conn sys/oracle as sysdbaConnected. sys @ ANBOB> create table testnew_def (id int primary key, name varchar2 (10) segment creation deferred; create table testnew_def (id int primary key, name varchar2 (10 )) segment creation deferred * ERROR at line 1: ORA-14223: This table does not support delay in creating segments
Note:
11g r2 is created using segment creation deferred by default. The newly created non-record-free table is not allocated with sement. When the first record is inserted, the segment space is allocated and will not be recycled due to truncate, it is not supported in sys schema. I heard that exp will not be exported.