Oracle undo tablespace and redo logs

Source: Internet
Author: User

The role of undo tablespace and redo log files in Oracle is very important. This article focuses on the role and features of undo rollback segments, and briefly introduces the differences between undo and redo and their respective roles:

1. Features of undo data:
1. Is a backup before data modification, mainly to ensure the user's read consistency
2. generated when the transaction modifies data
3. At least save to the end of the transaction

II. The role of undo data:
1. rollback operation
2. read consistency and flashback Query
3. Restore data from a failed transaction
4. instance recovery after abnormal Shutdown

Iii. Features of undo rollback segments:
1. A rollback segment is a dedicated segment automatically created by the instance to support transaction operations. It is also composed of a partition and a block. The rollback top will automatically increase or contract as needed, is a storage buffer that can be used for a specified transaction loop.
2. Each transaction uses only one rollback segment. A rollback segment may serve multiple transactions at the same time.
3. When a transaction starts, a rollback segment is specified. During the transaction, when the data is modified, the original data is copied to the rollback segment.
4. In the rollback segment, the transaction continues to fill the disk area until the transaction ends or all space is used up. If the current disk area is insufficient, the transaction requests to expand the next disk partition in the segment. If all allocated disk partitions are used up, the transaction will overwrite the original disk partition or extend the new disk partition when the rollback segment permits.
5. Rollback segments exist in the undo tablespace. multiple undo tablespaces can exist in the database, but only one undo tablespace can be used at the same time.

4. Data Types in rollback segments:
Data in a rollback segment can be divided into the following three types:
1. Uncommitted undo information; Uncommitted rollback data, the transaction associated with the data is not committed, and www.bkjia.com is used to achieve read consistency, so the data cannot be overwritten by the data of other transactions
2. Committed undo information; rollback data that has been submitted but has not expired. The transaction associated with the data has been Committed, but it is still affected by the retention time of the undo retention parameter.
3. Expired undo information; The transaction has been committed, and the data retention time has exceeded the time specified by the undo retention parameter. It is an Expired data.
When the rollback segment is full, Expired undo information will be overwritten first. When the Expired data space is used up, the area of Committed undo information will be overwritten, at this time, the retention time specified by the undo retention parameter will be damaged, and the Uncommitted undo information data cannot be overwritten, if the data to be submitted is not overwritten within the time specified by the undo retention parameter, you can specify retention guarantee on the undo tablespace. The syntax is as follows:
Alter tablespace UNDOTBS1 retention guarantee;

5. Differences between undo data and redo data:
1. Before undo records data modification, redo records the operations to be performed on disk data.
2. undo is used for data rollback and consistent read. redo is used for database rollback.
3. undo is stored in the rollback segment, and redo is stored in the redo log file.
4. undo is used to ensure consistent read in multi-user concurrent systems, and redo is used to prevent data loss.

6. undo-related parameters
Undo_management = auto automatic undo tablespace Management
Undo_tablespace = undotbs1: Set the name of the undo tablespace. multiple undo tablespaces can exist, but only one
Undo_retention = 900 (seconds) sets the minimum time for snapshot storage. After this setting, it may still be overwritten during this period.
Alter tablespace UNDO_TS retention guarantee; force all snapshots to save the time specified by undo_retention.

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.