In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about the difference between undo and redo in oracle. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
1. The characteristics of data in undo:
1. It is a backup before data modification, mainly to ensure the read consistency of users (to achieve this function, similar to Redo,Oracle uses Undo to record pre-backup information, and the relevant information of insert, update and delete is recorded in the rollback segment of Undo table space; for the amount of information recorded, insert at least needs to add rowid and update to record the modified old value, and delete records the whole row of data deleted at most. If the modification of one transaction has not been committed, the value queried by another transaction will be provided by Undo information)
two。 Generated when a transaction modifies data
3. Save at least until the end of the transaction
Second, the function of undo data:
1. Rollback (rollback) operation
two。 Achieve read consistency and flashback query
3. Restore data from a failed transaction
4. Instance recovery after abnormal downtime
Third, the characteristics of the undo rollback section:
1. The rollback segment is a dedicated segment automatically created by the instance to support transaction operation, which is also composed of areas and blocks. The rollback top automatically grows or shrinks according to the actual needs, and is a storage buffer that can be recycled for specified transactions.
two。 Each transaction uses only one rollback segment, and one rollback segment may serve multiple transactions at the same time.
3. When a transaction starts, a rollback segment is specified, and during the transaction, when the data is modified, the original data is copied to the rollback segment.
4. In the rollback segment, the transaction will continue to fill the extent until the transaction ends or all the space is used up. If the current extent is not enough, the transaction will request the extension of the next extent in the segment, and if all allocated extents are used up, the transaction will cover the original extent or expand the new extent to use if the rollback segment allows
5. The rollback segment exists in the undo table space, and there can be multiple undo table spaces in the database, but only one undo table space can be used at a time.
4. The data type in the rollback segment:
The data in the rollback segment is mainly divided into the following three categories:
1.Uncommitted undo information; uncommitted rollback data, the transaction associated with the data is not committed and is used to achieve read consistency, so the data cannot be overwritten by the data of other transactions
2.Committed undo information; has committed but not expired rollback data, and the transaction associated with the data has been committed, but is still affected by the hold time of the undo retention parameter
The 3.Expired undo information; transaction has been committed, and the data preservation time has exceeded the time specified by the undo retention parameter, so it belongs to data that has expired.
When the rollback segment is full, the Expired undo information will be overwritten first. When the expired data space is used up, the area of the Committed undo information will be covered again. Then the retention time specified by the undo retention parameter will be destroyed, and the Uncommitted undo information data is not allowed to be overwritten. If the submitted data is not overwritten within the time specified by the undo retention parameter, you can specify RETENTION on the undo tablespace.
GUARANTEE, the syntax is as follows:
ALTER TABLESPACE UNDOTBS1 RETENTION GUARANTEE
5. The difference between undo data and redo data:
1.undo records the operation before the data is modified, and redo records the operation that the disk data will do.
2.undo is used for data rollback operations and consistent reading, and redo is used to roll forward database operations.
3.undo is stored in the rollback segment and redo is stored in the redo log file
4.undo is used to ensure consistent reading in multi-user concurrent systems, and redo is used to prevent data loss.
VI. Relevant parameters related to undo
Undo_management = auto automatic undo tablespace management
Undo_tablespace = undotbs1 sets the name of the undo tablespace. Multiple undo tablespaces can exist, but only one can be used at the same time.
Undo_retention = 900s (seconds) set the minimum time for snapshots to be saved, which may still be overwritten during this period after setting
ALTER TABLESPACE UNDO_TS RETENTION GUARANTEE; forces all snapshots to be saved for the time specified by undo_retention
The above is the difference between undo and redo in oracle shared by Xiaobian. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.