the different between crash recovery and media recovery

The crash recovery process is a special form of recovery, which happens the first time an Oracle database instance is started after a crash (or SHUTDOWN ABORT). In crash recovery, the goal is to bring the datafiles to a transaction-consistent state, preserving all committed changes up to the point when the instance failed.

crash recover在数据库crash之后(比如执行shutdown abort命令),实例启动的时候发生,它的目的就是保证数据文件的事务一致性,用来保证实例毁坏时所有已经commit的事务都是完整的。

Like crash recovery, datafile media recovery is intended to restore database integrity. However, there are a number of important differences between the two:

数据文件的介质恢复目的是数据库的完整性,两者有一下不同:

  • Media recovery must be explicitly invoked by a user. The database will not run media recovery on its own.

    介质恢复必须有用户来执行,数据库不会自动执行,而crash recovery则由数据库在实例启动时,自动执行redo里面的信息,完成数据库的前滚。

  • Media recovery applies needed changes to datafiles that have been restored from backup, not to online datafiles left over after a crash.

    介质恢复是从备份里面将数据文件转储出来,而不用现在数据库里面的文件。

  • Media recovery must use archived logs as well as the online logs, to find changes reaching back to the time of the datafile backup.

    介质恢复需要使用归档日志和在线日志,重做备份之后的事务。

Unlike the forms of recovery performed manually after a data loss, crash recovery uses only the online redo log files and current online datafiles, as left on disk after the instance failure. Archived logs are never used during crash recovery, and datafiles are never restored from backup.

crash recovery使用的是在线日志和数据库现使用的datafile,而介质恢复则是使用备份的数据文件和归档日志以及在线日志信息。

The database applies any pending updates in the online redo logs to the online datafiles of your database. The result is that, whenever the database is restarted after a crash, the datafiles reflect all committed changes up to the moment when the haven't said failure occurred. (After the database opens, any changes that were part of uncommitted transactions at the time of the crash are rolled back.)

数据库现数据文件重做在线日志进行前滚。没有提交的事务则进行回滚。

The duration of crash recovery is a function of the number of instances needing recovery, amount of redo generated in the redo threads of crashed instances since the last checkpoint, and user-configurable factors such as the number and size of redo log files, checkpoint frequency, and the parallel recovery setting.You can set parameters in the database server that can tune the duration of crash recovery. You can also tune checkpointing to optimize recovery time.

数据库崩溃后,进行crash recovery产生大量的redo log,可以通过一些数据库参数来进行设置,比如redo log的大小,检查点执行的频率,crash恢复的并行度。通过这些参数可以优化数据库崩溃恢复的时间。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值