Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / Database concepts.pdf
Скачиваний:
29
Добавлен:
12.05.2015
Размер:
6.96 Mб
Скачать

Segments Overview

Automatic Undo Management

Automatic undo management is undo-tablespace based. You allocate space in the form of a few undo tablespaces, instead of allocating many rollback segments in different sizes.

See Also: Oracle9i Database Administrator’s Guide for information about creating an undo tablespace

Automatic undo management lets you explicitly control undo retention. Through the use of a system parameter (UNDO_RETENTION), you can specify the amount of committed undo information to retain in the database. You specify the parameter as clock time (for example, 30 seconds). With retention control, you can configure your system to enable long queries to run successfully.

Use the V$UNDOSTAT view to monitor and configure your database system to achieve efficient use of undo space. V$UNDOSTAT shows various undo and transaction statistics, such as the amount of undo space consumed in the instance.

Note: In earlier releases, undo space management was performed using rollback segments. This method is now called manual undo management mode.

Undo Mode

Undo mode provides a more flexible way to migrate from manual undo management to automatic undo management. A database system can run in either manual undo management mode or automatic undo management mode. In manual undo management mode, undo space is managed through rollback segments. Manual undo management mode is supported under any compatibility level. Use it when you need to run Oracle9i to take advantage of some new features, but are not yet not ready to convert to automatic undo management mode.

In automatic undo management mode, undo space is managed in undo tablespaces. To use automatic undo management mode, the database administrator needs only to create an undo tablespace for each instance and set the UNDO_MANAGEMENT initialization parameter to AUTO. Automatic undo management mode is supported under compatibility levels of Oracle9i or higher. Although manual undo management mode is supported, you are strongly encouraged to run in automatic undo management mode.

2-16 Oracle9i Database Concepts

Segments Overview

See Also:

Oracle9i Database Administrator’s Guide for descriptions of the syntax and the semantics of the DDL statements.

Appendix B, "Information on Deprecated Features" for more information on manual undo management mode

Undo Quota

In automatic undo management mode, the system controls exclusively the assignment of transactions to undo segments, and controls space allocation for undo segments. An ill-behaved transaction can potentially consume much of the undo space, thus paralyzing the entire system. In manual undo management mode, you can control such possibilities by limiting the size of rollback segments with small MAXEXTENTS values. However, you then have to explicitly assign long running transactions to larger rollback segments, using the SET TRANSACTION USE ROLLBACK SEGMENT statement. This approach has proven to be cumbersome.

The Resource Manager directive UNDO_POOL is a more explicit way to control large transactions. This lets database administrators group users into consumer groups, with each group assigned a maximum undo space limit. When the total undo space consumed by a group exceeds the limit, its users cannot make further updates until undo space is freed up by other member transactions ending.

The default value of UNDO_POOL is UNLIMITED, where users are allowed to consume as much undo space as the undo tablespace has. Database administrators can limit a particular user by using the UNDO_POOL directive.

Undo Retention Control

Long-running queries sometimes fail because undo information required for consistent read operations is no longer available. This happens when committed undo blocks are overwritten by active transactions.

Automatic undo management provides a way to explicitly control when undo space can be reused; that is, how long undo information is retained. A database administrator can specify a retention period by using the parameter UNDO_ RETENTION. For example, if UNDO_RETENTION is set to 30 minutes, then all committed undo information in the system is retained for at least 30 minutes. This ensures that all queries running for 30 minutes or less, under usual circumstances, do not encounter the OER error, "snapshot too old."

Data Blocks, Extents, and Segments 2-17

Segments Overview

You can either set UNDO_RETENTION at startup or change it dynamically with the ALTER SYSTEM statement. The following example sets retention to 20 minutes:

ALTER SYSTEM SET UNDO_RETENTION = 1200;

If you do not set the UNDO_RETENTION value that should be adequate for most usually not very long.

parameter, then Oracle uses a small default OLTP systems, where queries are not

In general, it is a good idea not to set retention to a value very close to what the undo tablespace can support, because that may result in excessive movement of space between undo segments. A 20% buffer of undo space is recommended.

External Views

Monitor transaction and undo information with V$TRANSACTION and V$ROLLSTAT. For automatic undo management, the information in V$ROLLSTAT reflects the behaviors of the automatic undo management undo segments.

The V$UNDOSTAT view displays a histogram of statistical data to show how well the system is working. You can see statistics such as undo consumption rate, transaction concurrency, and lengths of queries run in the instance. Using this view, you can better estimate the amount of undo space required for the current workload. This view is available in both the automatic undo management and manual undo management mode.

See Also: Oracle9i Database Administrator’s Guide for more details about using V$UNDOSTAT.

2-18 Oracle9i Database Concepts

Соседние файлы в папке Oracle selected docs