Get the App
SLTechnology News&Howtos  ›  Database  › 

Explain the parameters of creating table by Oracle in detail

Shulou Source: shulou.com Published: 2022-06-01 06:14:35 10月19日 Update

Explain the parameters of creating table by Oracle in detail

Create table mytable

(

Id number (3)

Name varchar2 (10)

)

PCTFREE 20

PCTUSED 70

INITRANS 2

MAXTRANS 255

TABLESPACE users

STORAGE

(

INITIAL 102400

NEXT 102400

PCTINCREASE 0

MINEXTENTS 1

MAXEXTENTS 102400

);

Parameter description:

PCTFREE: the percentage of space reserved for a block, indicating the circumstances under which the data block can be insert. The default is 10, which means that when the available space of the data block is less than 10%, it cannot be used by insert, but can only be used for update;. That is, when a block is used, the block can always be inserted before the pctfree is reached, and this time is in the rising period.

PCTUSED: it means that when the data in the block is less than what percentage, it can be re-insert. Generally, the default is 40%, that is, when the data is less than 40%, new data can be written. At this time, it is in a period of decline.

Give examples to illustrate

Suppose you can hold 100 pieces of data in a block, and PCTFREE is 10, PCTUSED is 40, then: constantly insert data into the block, if stored to 90, you can't store new data, which is controlled by pctfree, and the space reserved is for UPDATE.

When you delete a data, do you want to insert a new data row? No, 41 must be deleted, that is, less than 40 before new data can be inserted, which is controlled by pctused.

INITTRANS: the number of initialized transaction slots.

MAXTRANS: the number of maximum transaction slots.

These two parameters are related to the number of transaction concurrency. In the case of high concurrency, the value of INITTRANS should be increased appropriately.

STORAGE: storing parameters

INITIAL: initial segment size. When no specific unit is specified, the default unit is megabyte (B).

NEXT: after the initial segment is full, the default unit is megabytes (B) for each expansion of the object.

PCTINCREASE: the percentage of each increase. This parameter had better be zero, otherwise the space for expansion is larger and larger each time, and it is dangerous to grow in a proportional sequence.

MINEXTENTS: the minimum number of times an object can be extended.

MAXEXTENTS: the minimum number of times an object can be extended

Tags: Data parameters space transaction unit object percentage percentage no minimum number position size situation time number this is control maximum appropriate Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple Shulou Technology Linux macOS