您的位置:首页 > Web前端

the different between crash recovery and media recovery

2012-07-31 17:37 417 查看
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恢复的并行度。通过这些参数可以优化数据库崩溃恢复的时间。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: