Viewing entries tagged
Oracle Database 11g Release 2

Comment

2012-12 – Deferred Segment Creation

This article discusses Deferred Segment Creation, a space saving feature of Oracle Database 11gR2, which is also known as segment creation on demand.

Problem
When we create a table, Oracle will immediately create related segments, like table segment, implicit index segment and LOB segment. And if there are lots of empty tables in the database, then they will occupy disk space before they are even used.

Solution
To handle this issue Oracle introduces Deferred Segment Creation feature using SEGMENT CREATION { IMMEDIATE | DEFERRED } clause. If you use SEGMENT CREATION IMMEDIATE clause with CREATE TABLE statement then all associated segments will be created immediately, but if you use SEGMENT CREATION DEFERRED clause with CREATE TABLE statement then all associated segments will be created only when rows are inserted in the table. So empty tables will not occupy any disk space. To use this feature you need to set DEFERRED_SEGMENT_CREATION initialization parameter, which is TRUE by default.

Example
We will turn off this parameter and create a table using regular create table statement.

Comment