Oracle Table creation Parameters

Source: Internet
Author: User

First, let's look at an Oracle 10g table to create an SQL statement, which is the default value:
Create table sys. QS
(
USERNAME VARCHAR2 (30 BYTE) not null,
USER_ID number not null,
CREATED DATE NOT NULL
)
TABLESPACE SYSTEM
PCTUSED 40
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64 K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
Freelist groups 1
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
For the tablespaces of data Dictionary management and Local management, their parameters are different. In the Local management mode, the autoallocate and uniform types are different, the parameters are also different. Here, the tablespace of the local managed autoallocate type is used.


I. Storage parameter description
1. INITIAL
Specify the size of the first extent of the object. Oracle allocates space for this extent when you create the schema object. Refer to size_clause for information on that clause.
In locally managed tablespaces, Oracle uses the value of INITIAL, in conjunction with the type of local management-AUTOALLOCATE or UNIFORM-and the values of MINEXTENTS, NEXT and PCTINCREASE, to determine the initial size of the segment.
(1) With AUTOALLOCATE extent management, Oracle uses the INITIAL setting to optimize the number of extents allocated. extents of 64 K, 1 M, 8 M, and 64 M can be allocated. during segment creation, the system chooses the greatest of these four sizes that is equal to or smaller than INITIAL, and allocates as your extents of that size as are needed to reach or exceed the INITIAL setting. for example, if you set INITIAL to 4 M, then the database creates four 1 M extents. but if you set INITIAL to 14 M, then the database creates two 8 M extents, which exceeds the INITIAL setting, rather than creating the less optimal one 8 M extent plus six 1 M extents.
(2) For UNIFORM extent management, the number of extents is determined from initial segment size and the uniform extent size specified at tablespace creation time. for example, in a uniform locally managed tablespace with 1 M extents, if you specify an INITIAL value of 5 M, then Oracle creates five 1 M extents.
Consider this comparison: With AUTOALLOCATE, if you set induplicate to 72 K, then the initial segment size will be 128 K (greater than INITIAL ). The database cannot allocate an extent smaller than 64 K, so it must allocate two 64 K extents. if you set INITIAL to 72 K with a UNIFORM extent size of 24 K, then the database will allocate three 24 K extents to equal 72 K.
In dictionary managed tablespaces, the default initial extent size is 5 blocks, and all subsequent extents are rounded to 5 blocks. if minimum extent was specified at tablespace creation time, then the extent sizes are rounded to the value of minimum extent.
-- Since Oracle 9i, we recommend that you use the tablespace managed locally. We do not recommend that you use the tablespace managed in the dictionary.
Restriction on INITIAL You cannot specify INITIAL in an ALTER statement.


2. MINEXTENTS
(1) In locally managed tablespaces, Oracle Database uses the value of MINEXTENTS in conjunction with PCTINCREASE, INITIAL and NEXT to determine the initial segment size.
(2) In dictionary-managed tablespaces, specify the total number of extents to allocate when the object is created. the default and minimum value is 1, meaning that Oracle allocates only the initial extent, before t for rollback segments, for which the default and minimum value is 2. the maximum value depends on your operating system.
(11) In a locally managed tablespace, MINEXTENTS is used to compute the initial amount of space allocated, which is equal to INITIAL * MINEXTENTS. thereafter this value is set to 1, which is reflected in the DBA_SEGMENTS view.
(22) In a dictionary-managed tablespace, MINEXTENTS is simply the minimum number of extents that must be allocated to the segment.
If the MINEXTENTS value is greater than 1, then Oracle calculates the size of subsequent extents based on the values of the INITIAL, NEXT, and PCTINCREASE storage parameters.
When changing the value of MINEXTENTS by specifying it in an ALTER statement, you can reduce the value from its current value, but you cannot increase it. resetting MINEXTENTS to a smaller value might be useful, for example, before a TRUNCATE... Drop storage statement, if you want to ensure that the segment will maintain a minimum number of extents after the TRUNCATE operation.
Restrictions on MINEXTENTS
The MINEXTENTS storage parameter is subject to the following restrictions:
(11) MINEXTENTS is not applicable at the tablespace level.
(22) You cannot change the value of MINEXTENTS in an ALTER statement or for an object that resides in a locally managed tablespace.


3. MAXEXTENTS
This storage parameter is valid only for objects in dictionary-managed tablespaces. specify the total number of extents, including the first, that Oracle can allocate for the object. the minimum value is 1 TB t for rollback segments, which always have a minimum of 2. the default value depends on your data block size.
Restriction on MAXEXTENTS
MAXEXTENTS is ignored for objects residing in a locally managed tablespace, unless the value of ALLOCATION_TYPE is USER for the tablespace in the DBA_TABLESPACES data dictionary view.
-- This parameter is ignored in local managed tablespace.
UNLIMITED
Specify UNLIMITED if you want extents to be allocated automatically as needed. Oracle recommends this setting as a way to minimize fragmentation.
Do not use this clause for rollback segments. Doing so allows the possibility that long-running rogue DML transactions will continue to create new extents until a disk is full.
Caution:
A rollback segment that you create without specifying the storage_clause has the same storage parameters as the tablespace in which the rollback segment is created. thus, if you create a tablespace with maxextents unlimited, then the rollback segment will have this same default.


4. PCTINCREASE
(1) In locally managed tablespaces, Oracle Database uses the value of PCTINCREASE during segment creation to determine the initial segment size and ignores this parameter during subsequent space allocation.
(2) In dictionary-managed tablespaces, specify the percent by which the third and subsequent extents grow over the preceding extent. the default value is 50, meaning that each subsequent ext is 50% larger than the preceding extent. the minimum value is 0, meaning all extents after the first are the same size. the maximum value depends on your operating system. oracle rounds the calculated size of each new extent to the nearest multiple of the data block size. if you change the value of the PCTINCREASE parameter by specifying it in an ALTER statement, then Oracle calculates the size of the next extent using this new value and the size of the most recently allocated extent.
Restriction on PCTINCREASE
You cannot specify PCTINCREASE for rollback segments. Rollback segments always have a PCTINCREASE value of 0.


5. FREELISTS
(1) In tablespaces with manual segment-space management, Oracle Database uses the FREELISTS storage parameter to improve performance of space management in OLTP systems by increasing the number of insert points in the segment.
(2) In tablespaces with automatic segment-space management, this parameter is ignored, because the database adapts to varying workload.
In tablespaces with manual segment-space management, for objects other than tablespaces and rollback segments, specify the number of free lists for each of the free list groups for the table, partition, cluster, or index. the default and minimum value for this parameter is 1, meaning that each free list group contains one free list. the maximum value of this parameter depends on the data block size. if you specify a FREELISTS value that is too large, then Oracle returns an error indicating the maximum value.
This clause is not valid or useful if you have specified the SECUREFILE parameter of LOB_parameters. If you specify both the SECUREFILE parameter and FREELISTS, then the database silently ignores the FREELISTS specification.
Restriction on FREELISTS
You can specify FREELISTS in the storage_clause of any statement when T when creating or altering a tablespace or rollback segment.


6. FREELIST GROUPS
(1) In tablespaces with manual segment-space management, Oracle Database uses the value of this storage parameter to statically partition the segment free space in an Oracle Real Application Clusters environment. this partitioning improves the performance of space allocation and deallocation by avoiding inter instance transfer of segment metadata. in tablespaces with automatic segment-space management, this parameter is ignored, because Oracle dynamically adapts to inter instance workload.
(2) In tablespaces with manual segment-space management, specify the number of groups of free lists for the database object you are creating. the default and minimum value for this parameter is 1. oracle uses the instance number of Oracle Real Application Clusters (Oracle RAC) instances to map each instance to one free list group.
Each free list group uses one database block. Therefore:
(11) If you do not specify a large enough value for INITIAL to cover the minimum value plus one data block for each free list group, then Oracle increases the value of INITIAL the necessary amount.
(22) If you are creating an object in a uniform locally managed tablespace, and the extent size is not large enough to accommodate the number of freelist groups, then the create operation will fail.
This clause is not valid or useful if you have specified the SECUREFILE parameter of LOB_parameters. If you specify both the SECUREFILE parameter and freelist groups, then the database silently ignores the freelist groups specification.
Restriction on FREELIST GROUPS
You can specify the freelist groups parameter only in create table, create cluster, create materialized view, create materialized view log, and create index statements.


7. BUFFER_POOL
The BUFFER_POOL clause lets you specify a default buffer pool or cache for a schema object. All blocks for the object are stored in the specified cache.
(1) If you define a buffer pool for a partitioned table or index, then the partitions inherit the buffer pool from the table or index definition unless overridden by a partition-level definition.
(2) For an index-organized table, you can specify a buffer pool separately for the index segment and the overflow segment.
Restrictions on the BUFFER_POOL Parameter
BUFFER_POOL is subject to the following restrictions:
(1) You cannot specify this clause for a cluster table. However, you can specify it for a cluster.
(2) You cannot specify this clause for a tablespace or a rollback segment.
KEEP
Specify KEEP to put blocks from the segment into the KEEP buffer pool. maintaining an appropriately sized KEEP buffer pool lets Oracle retain the schema object in memory to avoid I/O operations. KEEP takes precedence over any NOCACHE clause you specify for a table, cluster, materialized view, or materialized view log.
RECYCLE
Specify RECYCLE to put blocks from the segment into the RECYCLE pool. An appropriately sized RECYCLE pool has CES the number of objects whose default pool is the RECYCLE pool from taking up unnecessary cache space.
DEFAULT
Specify DEFAULT to indicate the default buffer pool. This is the default for objects not assigned to KEEP or RECYCLE.

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.