当前位置:网站首页>Difference between redo and undo
Difference between redo and undo
2022-07-01 19:42:00 【Raindrops in June】
Redo stay Oracle In the database , There is a kind of log file called redo log file redo log, Divided into two : Online redo logs and archive logs .
Online redo logs (online redo log) It is mainly used for :Oracle The server where the database is located suddenly loses power 、 Restart or execute shutdown Wait for the command to restart ,Oracle The database cannot start the instance normally . here ,Oracle Will use online redo logs , Restore the database to the Jianyang moment before the server power failure , Make the database start normally .( By default , The database will have at least two redo log groups , Recycling )
Archive log (archive log) Mainly used for hardware level errors : The bad track of the disk makes it impossible to read and write 、 Failed to write 、 Disk damage leads to database data loss . At this time, the database archives log files , Restore the database to the time point where the archived log is located, and then restore the database to the current time point by online redoing the log file .
For archive log files , It can be understood as online redo log file backup . That is, when a redo log file is filled , Archive the log file and keep a backup .( Because it says , Online redo log files will be automatically overwritten ) therefore , Archive log files are backups of old online log files .
Undo Undo data is reverse DML Information required for statement results , go by the name of “ Undo Data ”.
undo data : If the database has been converted, use the undo segment , And automatic revocation management , Then any existing rollback segment must be in offline mode , And cannot be set to online . according to UNDO_MANAGEMENT Different settings of parameters ,Oracle The database either uses undo segments , Or use rollback segments .
undo Table space : A database can have multiple Undo tablespaces , But only one undo table space can be used at any given time . Undo tablespaces must be created as persistent 、 Locally managed table spaces that can automatically expand the allocated space .
DML sentence (insert Insert 、update to update 、delete Delete ), Operation produces redo and undo The most and the least ?
answer :undo: Rollback records the action of reverse operation , It is used to cover water after subsequent implementation . therefore delete Produce the most , The reverse operation of deletion is to insert , It means that the whole line of records is completely inserted back , That is to record all the field information of the table .insert least , The reverse operation is to delete , As long as the mark is positioned to the original position ( because insert Of undo The information is recorded in the inserted record rowid, The only mark , According to this rowid It is enough to locate the inserted record and delete , So as to achieve the purpose of fallback ); and update In the middle , Just record the value of the field before updating and save it .
redo Redo log ,delete Just record the relevant rowid You can delete it again , produce redo least , and insert If you want to finish it again , At least you need to know the values of all fields , Produced redo Definitely most ,update The situation remains the same , It's all in the middle .
undo There will be a corresponding redo?
answer : Meeting ,undo The information of is the front image information for preparing the user to retreat , It is used for the restoration action after everyone regrets their operation , These data also need to be protected , If we lose it, we can't restore it , and redo It is a very good recovery treasure .
DML A feature of the statement :DML Statements are different from query statements , Will change the data in the database . besides , There will also be for future recovery redo And for fallback undo. Another detail is , because undo It also needs protection , So there will be special protection undo Operation of the redo.
边栏推荐
- After studying 11 kinds of real-time chat software, I found that they all have these functions
- Botu V16 obtains the system time and converts it into a string
- IPv4 address, subnet mask, gateway
- ES6中的代理proxy
- uni-app商品分类
- Interview question 16.16 Partial sorting - Double finger needling
- JS ternary expression complex condition judgment
- Object creation
- 通过js实现金字塔(星号金字塔,回文对称数字金字塔)
- AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
猜你喜欢
解决VSCode下载慢或下载失败的问题
Les canaux de culture intensive s'efforcent de développer Fu Xin et Wei Shi jiajie pour organiser une conférence de formation sur les nouveaux produits
Case sharing: basic networking configuration of QinQ
Regular expression =regex=regular expression
wireshark报文分析tcp,ftp
Wireshark packet analysis TCP, FTP
optaplanner学习笔记(一)案例Cloud balance
Actual combat of flutter - fast implementation of audio and video call application
Intensive cultivation of channels for joint development Fuxin and Weishi Jiajie held a new product training conference
测试自学人必看:软件测试如何找测试项目?
随机推荐
利用win7漏洞进行系统登录密码破解
axure不显示元件库
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
703. 数据流中的第 K 大元素
Shell高级进阶
mysql 报错 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*
音视频、编解码相关电子书、小工具,打包奉送!
Werewolf killing strategy: do you think I'm easy to cheat? Who do we believe!
JS 之 常用内置类的使用
Facebook聊单,SaleSmartly有妙招!
uni-app微信小程序一键登录获取权限功能
Class loading mechanism
Basic knowledge of audio coding and decoding
EasyGBS网络不稳定情况下重复请求视频拉流问题的优化
OpenCV视频质量诊断----视频遮挡诊断
Shell advanced
CMU AI PhD first year summary
118. Yanghui triangle
ffmpeg常用命令(二)
Summary of SQL query de duplication statistics methods