当前位置:网站首页>Database recovery strategy
Database recovery strategy
2022-07-05 21:58:00 【Short section senior】
Recovery of transaction failure
Transaction failure : Transaction terminated before running to normal termination
Recovery method
The recovery subsystem uses log files to undo (UNDO) Changes made to the database by this transaction
The recovery of transaction failure is automatically completed by the system , Transparent to users , No user intervention is required
Recovery steps for transaction failure
(1) Reverse scan file log ( That is, scan log files from the last forward ), Find the update operation of the transaction .
(2) Reverse the update operation of the transaction . Is about to log “ Value before update ” Write to database .
The insert , “ Value before update ” It's empty , It is equivalent to deleting
Delete operation ,“ Updated value ” It's empty , It's equivalent to inserting
If it's a modification , It is equivalent to replacing the modified value with the pre modified value
(3) Continue reverse scanning log files , Find other update operations for this transaction , And do the same thing .
(4) Deal with it like this , Until you read the start tag of this transaction , Transaction recovery is complete .
Recovery of system failure
The reason of database inconsistency caused by system failure
The update to the database by the unfinished transaction may have been written to the database
The database update by committed transaction may be left in the buffer before it can be written to the database
Recovery method
1.Undo Unfinished transactions at the time of failure
2. Redo Completed transactions
The recovery of system failure is automatically completed when the system is restarted , No user intervention is required
Recovery steps for system failure
(1) Forward scanning log files ( Scan log files from scratch )
redo (REDO) queue : Transactions committed before the failure
These things already have BEGIN TRANSACTION Record , Also have COMMIT Record
revoke (UNDO) queue : Unfinished business at the time of failure
These things are just BEGIN TRANSACTION Record , There is no corresponding COMMIT Record
(2) To revoke (UNDO) Queue transactions to undo (UNDO) Handle
Reverse scan log files , Reverse the update operation of each undo transaction
Is about to log “ Value before update ” Write to database
(3) To redo (REDO) Queue transactions redo (REDO) Handle
Forward scanning log files , Re perform the registration operation for each redo transaction
Is about to log “ Updated value ” Write to database
Recovery of media failure
Recovery steps
(1) Mount the latest backup database copy ( The most recent crash of the replica occurred at the time of the dump ) , Restore the database to the consistency state of the last dump .
For a database copy of a static dump , The database is in a consistent state after loading
For a database copy of a dynamic dump , You must also load a copy of the log file at the time of the dump , Use the method of recovering system failure ( namely REDO+UNDO), To restore the database to a consistent state .
(2) Load a copy of the log file in question ( Copy of the log file at the end of the dump ) , Redo what has been done .
First scan the log file , Find out the ID of the transaction that was committed when the failure occurred , Put it in the redo queue .
Then forward scan the log file , Redo all transactions in the redo queue . Is about to log “ Updated value ” Write to database .
The recovery of media failure requires the intervention of database administrator
The work of Database Administrator
Reinstall the database copy of the latest dump and the copies of the related log files
Execute the recovery command provided by the system
The specific recovery operation is still completed by the database management system
Welcome to join me for wechat exchange and discussion ( Please note csdn Add )
边栏推荐
- QML reported an error expected token ";", expected a qualified name ID
- Analysis and test of ModbusRTU communication protocol
- Chap2 steps into the palace of R language
- Codeforces 12D ball tree array simulation 3 sorting elements
- Oracle HugePages没有被使用导致服务器很卡的解决方法
- 极狐公司官方澄清声明
- oracle 控制文件的多路复用
- About the writing method of SQL field "this includes" and "included in" strings
- Bitbucket installation configuration
- 华为游戏多媒体服务调用屏蔽指定玩家语音方法,返回错误码3010
猜你喜欢

Oracle检查点队列–实例崩溃恢复原理剖析

1.2 download and installation of the help software rstudio

Uni app Bluetooth communication

MySQL连接断开报错MySQLdb._exceptions.OperationalError 4031, The client was disconnected by the server

KingbaseES V8R3集群维护案例之---在线添加备库管理节点

Sorting out the problems encountered in MySQL built by pycharm connecting virtual machines

MATLAB | App Designer·我用MATLAB制作了一款LATEX公式实时编辑器

Emotional analysis of wechat chat records on Valentine's day based on Text Mining

How to use tensorflow2 for cat and dog classification and recognition

Ad637 notes d'utilisation
随机推荐
多家呼吸机巨头产品近期被一级召回 呼吸机市场仍在增量竞争
Official clarification statement of Jihu company
ICMP introduction
Did you brush the real title of the blue bridge cup over the years? Come here and teach you to counter attack!
EBS Oracle 11g 克隆步骤(单节点)
华为游戏多媒体服务调用屏蔽指定玩家语音方法,返回错误码3010
Decorator learning 01
极狐公司官方澄清声明
资深电感厂家告诉你电感什么情况会有噪音电感噪音是比较常见的一种电感故障情况,如果使用的电感出现了噪音大家也不用着急,只需要准确查找分析出什么何原因,其实还是有具体的方法来解决的。作为一家拥有18年品牌
Detailed explanation of memset() function usage
An exception occurred in Huawei game multimedia calling the room switching method internal system error Reason:90000017
HDU 4391 Paint The Wall 段树(水
AD637使用笔记
sql常用语法记录
GCC9.5离线安装
Tips for using SecureCRT
Feng Tang's "spring breeze is not as good as you" digital collection, logged into xirang on July 8!
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
Code bug correction, char is converted to int high-order symbol extension, resulting in changes in positivity and negativity and values. Int num = (int) (unsigned int) a, which will occur in older com
阿里云有奖体验:用PolarDB-X搭建一个高可用系统