oracle tablespace pctfree pctused two, oracle pctfree and pctused Detailed

Two, oracle pctfree and pctused Detailed

First, the establishment table, pay attention to the role of the PCTFREE parameter

      PCTFREE: as a percentage of the space reserved block, block data indicating under what circumstances can be insert, default is 10, a rear when the data block is less than 10% free space, the insert may be not only be used Update; namely: when using a block, prior to reaching PCTFREE, which has a block can be inserted, in this time of rising.

      PCTUSED: means that when the data in the block is lower than the percentage, and can be re-insert, usually the default is 40, or 40%, that is: when the data is less than 40%, and can write new data, this time in a period of decline.

 

Second, exemplified

      Suppose you one block can store 100 the data, and PCTFREE is 10, PCTUSED 40, then: continue to insert data block, if when stored in 90, can not store new data, which is subject to pctfree controlled the reserved space is used to UPDATE.

      When you delete a data, think insert new data okay? No, it must be deleted 41, ie below to insert new data after a 40, which is controlled by pctused.

      Note: If the table space is enabled ASSM, when the establishment of the table, only specify PCTFREE, otherwise it can be used to specify PCTFREE and PCTUSED.

             

 

Third, the adjustment pctfree PCTUSED
. 1, by the pct_free user_tables, pct_used view
select a.table_name, a.pct_free, a.pct_used, a * from user_tables a;.
Description:
pctfree indicates the percentage of update operations for a reservation, and if it exceeds the data value can not be inserted.
pctused represents the lowest percentage share data, can not be inserted if reached pctfree, after delete is reached before they can be used to insert pctused

 

2, if you are using automatic space management table pctused not need to set
altertable tablename pctfree values;
Description:
PCTFREE default is 10, mainly to see how much data is updated, you can view the table max_row_len if large and frequent updates may consider increasing the value.
pctused mainly depends on the size of the deleted data, you can turn up if the value is great, if not very often you can set a relatively small 30-40
pctused + PCTFREE <90

 

3. Check the automatic management table space
select tablespace_name, segment_space_management from user_tablespaces; --segment_space_management to auto means the automatic management table space
is mainly played the role of space-saving table.

Guess you like

Origin www.cnblogs.com/ruiy/p/11798959.html