数据库恢复技术| 数据库管理系统

Database Recovery is a process of recovering or restoring data in the database when a data loss occurs or data gets deleted by system crash, hacking, errors in the transaction, damage occurred coincidentally, by viruses, sudden terrible failure, commands incorrect implementation, etc. Data loss or failures happen in databases like other systems but the data stored in the database should be available whenever it's required. For fast restoration or recovery of data, the database must hold tools which recover the data efficiently. It should have atomicity means either the transactions showing the consequence of successful accomplishment perpetually in the database or the transaction must have no sign of accomplishment consequence in the database.

数据库恢复是在发生数据丢失或由于系统崩溃,黑客攻击,事务中的错误,偶然发生的病毒,突然的严重故障,命令执行不正确等导致的数据丢失或删除数据时恢复或恢复数据库中数据的过程。像其他系统一样,数据丢失或故障也发生在数据库中,但存储在数据库中的数据应在需要时随时可用。 为了快速恢复或恢复数据,数据库必须拥有可有效恢复数据的工具。 它应该具有原子性,这意味着在数据库中永久显示成功成就的结果的事务,或者在数据库中该事务必须没有成就的迹象。

From any failure set of circumstances, there are both voluntary and involuntary ways for both, backing up of data and recovery. So, recovery techniques which are based on deferred update and immediate update or backing up data can be used to stop loss in the database.

在任何故障情况下,都有数据备份和恢复的自愿和非自愿方式。 因此,可以使用基于延迟更新和立即更新或备份数据的恢复技术来阻止数据库中的丢失。

崩溃恢复 (Crash recovery)

Crash recovery is the operation through which the database is transferred back to a compatible and operational condition. In DBMS, this is performed by rolling back insufficient transactions and finishing perpetrated transactions that even now existed in memory when the crash took place.

崩溃恢复是将数据库转移回兼容和可操作状态的操作。 在DBMS中,这是通过回退不足的事务并完成发生崩溃时仍存在于内存中的永久事务来执行的。

With many transactions being implemented with each second shows that, DBMS may be a tremendously complex system. The fundamental hardware of the system manages to sustain robustness and stiffness of software which depends upon its complex design. It’s anticipated that the system would go behind with some methodology or techniques to restore lost data when it fails or crashes in between the transactions.

每秒执行许多事务表明,DBMS可能是一个非常复杂的系统。 系统的基本硬件设法维持软件的鲁棒性和刚性,这取决于其复杂的设计。 预计该系统将在某些方法或技术落后,以便在事务之间失败或崩溃时恢复丢失的数据。

Classification of failure

故障分类

The following points are the generalization of failure into various classifications, to examine the source of a problem,

以下几点是将故障归纳为各种分类,以检查问题的根源,

  1. Transaction failure: a transaction has to terminate when it arrives at a point from where it can’t extend any further and when it fails to implement the operation.

    事务失败 :事务必须在到达无法进一步扩展的点以及无法执行操作的时候终止。

    Transaction failure reasons could be,

    交易失败的原因可能是,

    • Logical errors: The errors which take place in some code or any intrinsic error situation, where a transaction cannot properly fulfill.逻辑错误:在某些代码或任何固有错误情况下发生的错误,其中事务无法正确执行。
    • System errors: The errors which take place when the database management system is not able to implement the active transaction or it has to terminate it because of some conditions in a system.系统错误:数据库管理系统由于系统中的某些条件而无法实现活动事务或必须终止活动事务时发生的错误。
  2. System Crash: There are issues which may stop the system unexpectedly from outside and may create the system condition to crash. For example, disturbance or interference in the power supply may create the system condition of fundamental hardware or software to crash or failure.

    系统崩溃 :有些问题可能会导致系统意外从外部停止,并可能导致系统崩溃。 例如,电源中的干扰或干扰可能导致基本硬件或软件的系统状况崩溃或失败。

  3. Disk Failure: Disk failures comprise bad sectors evolution in the disk, disk inaccessibility, and head crash in the disk, other failures which damage disk storage completely or its particular parts.

    磁盘故障 :磁盘故障包括磁盘中的坏扇区演变,磁盘不可访问性和磁盘中的磁头崩溃,其他故障则完全损坏磁盘存储或其特定部分。

Storage structure

储存结构

The storage structure can be classified into two following categories,

存储结构可分为以下两类:

  • Volatile storage: A volatile storage cannot hold on crashes in the system. These devices are located within reach of CPU. Examples of volatile storage are the main memory and cache memory.

    易失性存储 :易失性存储无法保持系统崩溃。 这些设备位于CPU的范围内。 易失性存储的示例是主存储器和缓存存储器。

  • Non-volatile storage: A non-volatile storage are created to hold on crashes in the system. These devices are enormous in the magnitude of data storage, but not quick in approachability. Examples of non-volatile storage are hard-disks, magnetic tapes, flash memory, and RAM.

    非易失性存储 :创建非易失性存储以保留系统崩溃。 这些设备的数据存储量巨大,但可访问性却不快。 非易失性存储的示例是硬盘,磁带,闪存和RAM。

Recovery and Atomicity

恢复与原子性

To recover and also to sustain the transaction atomicity, there are two types of methodology,

为了恢复并维持交易的原子性,有两种类型的方法,

  • Sustaining each transaction logs and before actually improving the database put them down onto some storage which is substantial.

    维持每个事务日志,并在实际改进数据库之前将其放到大量的存储中。

  • Sustaining shadow paging, in which on a volatile memory the improvements are completed and afterward, the real database is reformed.

    维持影子分页,其中在易失性存储器上完成了改进,然后对真实数据库进行了改革。

基于日志的恢复 (Log-based Recovery)

The log is an order of sequence of records, which sustains the operations record accomplished by a transaction in the database. Before the specific changes and improvements survive on a storage media which is stable and failing securely, it’s essential that the logs area unit put down in storage.

日志是记录顺序的顺序,它维持数据库中事务完成的操作记录。 在将特定的更改和改进保存在稳定且安全地发生故障的存储介质上之前,必须将日志区域​​单元放入存储中。

Following are the workings of Log-based Recovery,

以下是基于日志的恢复的工作原理,

The log file is not damaged on a stable storage media.

日志文件在稳定的存储介质上没有损坏。

Log-based recovery puts down a log regarding a transaction when a transaction begins to be involved in the system and starts implementation.

当事务开始涉及系统并开始实施时,基于日志的恢复会记录有关事务的日志。

Recovery with Concurrent Transactions

并发事务恢复

The logs are interleaved, when multiple transactions are being implemented in collateral. It would be difficult for the system of recovery to make an order of sequence of all logs again, and then start recovering at the time of recovery. Most recent times Database systems use the abstraction of 'checkpoints' to make this condition uncomplicated.

当并行执行多个事务时,日志将交错。 恢复系统很难再次对所有日志进行排序,然后在恢复时开始恢复。 最近,数据库系统使用“检查点”的抽象使这种情况变得简单。

Checkpoint

检查站

The checkpoint is an established process where all the logs which are previously used are clear out from the system and stored perpetually in a storage disk. Checkpoint mention a point before which the DBMS was in a compatible state, and all the transactions were perpetrated.

检查点是一个已建立的过程,在该过程中,将从系统中清除所有先前使用的日志,并将这些日志永久存储在存储磁盘中。 Checkpoint提到了DBMS处于兼容状态之前的一点,所有事务都已执行。

翻译自: https://www.includehelp.com/dbms/database-recovery-techniques.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值