View the code below.
CREATE TABLE COINS_IN_LOT (auction_id NUMBER, lot_id NUMBER, coin_id NUMBER)
STORAGE (INITIAL 100K NEXT 50K MINEXTENTS 1 MAXEXTENTS 5 PCTINCREASE 50 );
If you use the storage parameters when creating a table, the syntax will look like this: This SQL statement causes the
table to begin with a single extent of 100 K allocated. Subsequent extents would contain 50K, 75 K (50 K *150%), and so
on. The table could not contain more than five extents, which would limit its overall size to 506.25 K.
You do not have to specify storage parameters for any object.
The amount of space used by a segment is determined by its storage parameters
These parameters are determined by the database at segment-creation time; if no specific storage parameters are
given in the
- create table,
- create index, or
- create cluster
command, then the database will use the default storage parameters for the tablespace in which the segment is to be stored.
Note: You can assign default tablespaces to users, and assign space quotas within those tablespaces, via the create user, alter user, and grant commands.
When you create a table, index, or other segment, you can use the default values for a locally managed tablespace
(the recommended option) or specify a storage clause as part of the create command. You can also specify a tablespace clause,
enabling you to direct Oracle to store the data in a particular tablespace. For example, a create table command in a dictionary-managed
tablespace may include the following clauses:
storage (initial 1M next 1M pctincrease 0
minextents 1 maxextents 200)
If no storage clause is specified, the default storage parameters of the tablespace will be used. For a locally managed USERS tablespace,
the create table command would only need to include
The storage parameters
specify the initial extent size, the next extent size, the pctincrease (a factor by which each successive extent will geometrically grow),
- the maxextents (maximum number of extents), and
- the minextents (minimum number of extents).
After the segment has been created, the initial and minextents values cannot be altered unless you perform a reorganization of the object.
The default values for the storage parameters for each tablespace are available in the DBA_TABLESPACES and USER_TABLESPACES views.
The next lesson shows how to set default storage attributes for all the objects in a tablespace.