In this case, what is the 1st extent size? 100k or 200k? What's the 2nd? 120k or 240k (because the MINEXTENTS is 2)?
If the answer is "100k and 120k", what's the use of MINEXTENTS?
A2.
First extent will be 100K, second will be 120K (if oracle won't round the values up to the 5 blocks multiplication). The usage of MINEXTENTS - you are telling oracle that you want to prealocate 2 extents at table creation time. Those two extents will be sized based on INITAL and NEXT parameters.
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
However for Q1, pls see the following result running in 9i and 8i:
=========================================================== In 9i, the default is LMT
SQL> create tablespace local_storage datafile 'd:\testlocal.dbf' size 2m
2 default storage (initial 100k next 120k minextents 2);
Tablespace created.
SQL> select INITIAL_EXTENT, NEXT_EXTENT, MIN_EXTENTS, EXTENT_MANAGEMENT from dba_tablespaces
2 where TABLESPACE_NAME='LOCAL_STORAGE';
Though the storage can be used, but it doesn't really affect the space allocating.
In 8i, the default is DMT
SQL> create tablespace local_storage datafile '$ORACLE_BASE/oradata/local_storage.dbf'
2 size 2m extent management local
3 default storage (initial 120k);
create tablespace local_storage datafile '$ORACLE_BASE/oradata/local_storage.dbf'
*
ERROR at line 1:
ORA-25143: default storage clause is not compatible with allocation policy
For Q2:
You said "Oracle will prealocate 2 extents at table creation time", do you mean oracle will preallocate "100k+120k" space, because the first 2 extents is "100k and 120k". Am I right?
If you do not specify the extent_management_clause, then Oracle interprets the COMPATIBLE setting, the MINIMUM EXTENT clause and the DEFAULT storage_clause to determine extent management. If the COMPATIBLE initialization parameter is less than 9.0.0, then Oracle creates a dictionary managed tablespace. If COMPATIBLE = 9.0.0 or higher:
If you do not specify the DEFAULT storage_clause at all, then Oracle creates a locally managed autoallocated tablespace.
If you did specify the DEFAULT storage_clause:
If you specified the MINIMUM EXTENT clause, then Oracle evaluates whether the values of MINIMUM EXTENT, INITIAL, and NEXT are equal and the value of PCTINCREASE is 0. If so, Oracle creates a locally managed uniform tablespace with extent size = INITIAL. If the MINIMUM EXTENT, INITIAL, and NEXT parameters are not equal, or if PCTINCREASE is not 0, Oracle ignores any extent storage parameters you may specify and creates a locally managed, autoallocated tablespace.
If you did not specify MINIMUM EXTENT clause, then Oracle evaluates only whether the storage values of INITIAL and NEXT are equal and PCTINCREASE is 0. If so, the tablespace is locally managed and uniform. Otherwise, the tablespace is locally managed and autoallocated.
Restrictions on extent management:
A permanent locally managed tablespace can contain only permanent objects. If you need a locally managed tablespace to store temporary objects (for example, if you will assign it as a user's temporary tablespace, use the CREATE TEMPORARY TABLESPACE statement.
If you specify LOCAL, then you cannot specify DEFAULT storage_clause, MINIMUM EXTENT, or TEMPORARY.
" If you specify LOCAL, then you cannot specify DEFAULT storage_clause, MINIMUM EXTENT, or TEMPORARY. "
I apologize for harping on above statement but can I safely assume for examination purpoe that above statement applies to both Temporary and Permanenet tablespaces.
Bookmarks