Local management table space (LMT)

zhaozj2021-02-16  102

Preface

Prior to Oracle 8i, Oracle uses a Dictionary Management TableSpace, for use the data dictionary to manage the tablespace of the area, the Oracle server will update the corresponding table in the data dictionary whenever the area is assigned or recycled, this is the table space. Default spatial management method. This is the only way to be available in Oracle 8.0 and earlier versions.

Starting from Oracle 8i, Oracle provides a new table space management, namely local management table space (Local Managed TableSpace). Using LMT, Oracle maintains a bitmap in each data file to understand the idle or use status of the data file in the data file, each bit in the bitmap or a set of blocks in the allocation area or release area. When it is reused, the Oracle server change bitmap value value to display a new state of the block.

Using the local management table space (LMT), each time a range is assigned or released (for reuse), Oracle updates bitmap information to display new space usage, which avoids spatial assignments in dictionary management. Performance issues caused during recursive operations, and simplify spatial allocation, reduce the dependence of the user's data dictionary (because the necessary information is stored in the file header and bit map block).

Using local management tablespaces rarely forms a spatial fragment, there are few problems associated with space in this space. It is also important to note that no matter whether you use the Oracle 8i database or an Oracle 9i database system, you cannot create the System table space as a local management table space (LMT) when you create a database, and you will never convert the System tablespace to this management table. Space (LMT).

Some options for creating local management tablespaces

In the Oracle 9i database, the local management table space (LMT) is the default spatial management method. To create a local management table space (LMT), you only need to specify a local sentence in the Extent Management clause of the CREATE TABLESPACE statement. When you create an LMT, you can choose to use the Autoallocate option to use the Oracle automatic management panel, or you can use a unified disk area of ​​a Specify Size (Uniform Size "to manage the table space. If the uniform size option is omitted, the default option is Autoallocate.

The specific syntax is as follows:

The local option of the Extent Management clause of the CREATE TABLESPACE statement specifies that the tablespace is localized by:

EXTENT_MANAGEMENT_CLAUSE: ==

[EXtent management

{Dictionary | Local

{Autoallocate | Uniform [Size Integer [K | M]]}}]

(Where Dictionary specifies the use of a dictionary table to manage table space this is the default method)

among them:

· Local specifies the local management table space through the bitmap (if Local is specified, default storage_clause minimum extent or temporary)

· Autoallocate specifies that the table space is managed by system, and users cannot specify the area size.

• Uniform specifies to manage tablespaces by a unified area of ​​size ze bytes, using k or m to specify the area size in kilobyte or megabytes.

· Size default is 1 megabyte

· Extent Management clause can be used in a variety of create commands, for non-System's permanent table spaces can specify extent management local in the Create TableSpace command; for temporary tablespaces, you can specify EXTENT MANGEMENT LOCAL in the CREATE TEMPORY TABLESPACE command, for example, if used The following statement will create the local management table space (LMT) of the Oracle Automatic Management Panel by default:

Create TableSpace LMTTest

DataFile 'd: /lmttest.dbf' size 5m

Extent management local;

When is Oracle Automatic Administrative Dish (ie, use the autoallocate option)?

If the size of the Extent in the table space is not necessarily, you need a different panel size and an object that has a variety of variations of many panels, and Autoallocate is a relatively reasonable choice. Although some spaces may be wasted, it is managed by Oracle to manage space (spatial allocation and recycling work), simplifying user space management.

E.g:

SQL> CREATE TABLESPACE LMTTEST

2 DataFile 'D: /Lmttest.dbf' size 5m

3 Extent Management Local

4 autoallocate;

The table space has been created.

SQL>

When is using a unified disk area to manage table space (ie, use uniform size sentences)?

If you want to accurately control unused space, and can accurately expect the number, size, size, etc. of one or more objects to be allocated, so use the uniform option is more appropriate, because it ensures that it is never in the table space There is a certain number of unused space. The default size of UNIFORM SIZE is 1MB. At this time, when you create a data file in this way, the size of the data file is at least 1MB (bit map space plus a block).

For example, it is assumed that the table space block size is 4KB, and the size of the unified panel is 256K, and each bit in the bitmap describes 64 blocks (256/4):

SQL> CREATE TABLESPACE LMTTEST

2 datafile 'd: /lmttest.dbf' size 10m

3 Extent Management Local

4 UNIFORM SIZE 256K;

The table space has been created.

SQL>

In summary, local management table space has the following advantages over the tablespace managed by the dictionary:

• Local management avoids loop space management operations, and this operation may happen in a dictionary management table space (when consuming or releases a space in a zone, resulting in another consumption or release of the return segment or data dictionary table within the table operating)

• Because local managed tablespace does not record the idle space in the data dictionary table, thereby reducing the contention of these tables

The local management of the area automatically tracks the neighboring free space, so there is no need to merge free area

• Local management area can be automatically determined by the system, as all of the districts in table spaces selected locally, can have the same size

• The bitmap converted to the zone will not generate a fallback information because they do not update the tables in the data dictionary (except for special cases such as table space quota information)

转载请注明原文地址:https://www.9cbs.com/read-13923.html

New Post(0)