当前位置:网站首页>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.
边栏推荐
- OpenCV视频质量检测--清晰度检测
- Thesis reading [distinctive late semantic graph for video capturing]
- Ubuntu14 install MySQL and configure root account local and remote access
- [go ~ 0 to 1] day 4 June 30 defer, structure, method
- How to correctly use vertx to operate redis (3.9.4 with source code analysis)
- Ffmpeg avframe to cv:: mat
- 通过js实现金字塔(星号金字塔,回文对称数字金字塔)
- Mysql查询结果去除换行
- Redo和Undo的区别
- 解决VSCode下载慢或下载失败的问题
猜你喜欢
新版国标GB28181视频平台EasyGBS如何配置WebRTC视频流格式播放?
Facebook聊单,SaleSmartly有妙招!
The use of subplot function in MATLAB
【AI服务器搭建】CUDA环境
wireshark报文分析tcp,ftp
Thesis reading [distinctive late semantic graph for video capturing]
How to correctly use vertx to operate redis (3.9.4 with source code analysis)
Class loading mechanism
精耕渠道共謀發展 福昕攜手偉仕佳傑開展新產品培訓大會
GC垃圾回收
随机推荐
The use of subplot function in MATLAB
新增订单如何防止重复提交
JS 之 常用内置类的使用
数字化转型企业成功的关键,用数据创造价值
JDBC中如何添加事务
Flutter 实战-快速实现音视频通话应用
正则表达式=Regex=regular expression
Brpc understanding
商业智能BI开发和报表开发有什么本质区别?
JS ternary expression complex condition judgment
js三元表达式复杂条件判断
Why must we move from Devops to bizdevops?
Ffmpeg error code
H264 encoding profile & level control
Collation of open source protocols of open source frameworks commonly used in Web Development
H264编码profile & level控制
Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?
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
GetMessage底层机制分析
Basic knowledge of audio coding and decoding