Oracle rec_,Oracle备份与恢复:Types of Oracle Recovery

实例恢复,也可称作崩溃恢复(Crash Recover),这种恢复方式由Oracle自动进行,通过读取当前的数据文件和联机重做日志文件(注意:不是归档文件,实例恢复与是否归档模式无关)来恢复数据库,使数据文件和控制文件恢复到崩溃前的一致性状态。

实例恢复分两个步骤进行。

1、缓存恢复(Cache Recovery)

Oracle启动实例并加载数据库,然后通过Online Redologs中的重做日志,重新实例崩溃前对数据库的修改操作。在恢复过程中对于已经提交的事务,但尚未写入数据文件的那部分数据全部写入数据文件,这个过程叫做Rolling Forward(前滚)。

2、事务恢复(Transaction Recovery)

Rolling Forward之后,虽然已经提交的修改操作更改的数据都已经被写入数据文件,但在实例崩溃时,部分未提交的事务操作的数据也被写入到数据文件,这些事务必须被撤销,这个过程叫做Rolling Back(回滚)。[@more@]

·Instance and Crash Recovery

·Media Recovery

Learn Oracle - Instance and Crash Recovery

Crash recovery is used to recover from a failure either when a single-instance database crashes or all instances of an Oracle Real Application Clusters database crashes. Instance recovery refers to the case where a surviving instance recovers a failed instance in an Oracle Real Application Clusters database.

The goal of crash and instance recovery is to restore the data block changes located in the cache of the dead instance and to close the redo thread that was left open.Instance and crash recovery use only online redo log files and current online datafiles.Oracle recovers the redo threads of the dead instances together.

Crash and instance recovery have the following shared characteristics:

·Redo the changes using the current online datafiles (as left on disk after the crash or SHUTDOWN ABORT)

·Use only the online redo logs and never require the use of the archived logs

·Have a recovery time governed by the number of dead instances, amount of redo generated in each dead redo thread since the last checkpoint, and by user-configurable factors such as the number and size of redo log files, checkpoint frequency, and the parallel recovery setting

Oracle performs this recovery automatically on two occasions:

·At the first database open after the crash of a single-instance database or all instances of an Oracle Real Applications Cluster database (crash recovery). After a normal shutdown, Oracle sets a flag in the control file. Oracle performs crash recovery automatically at startup upon detecting that an instance did not set a flag in the control file indicating a normal shutdown.

·When some but not all instances of an Oracle Real Application Clusters configuration fail (instance recovery). The recovery is performed automatically by a surviving instance in the configuration.

The important point is that in both crash and instance recovery Oracle applies the redo automatically: no user intervention is required to supply redo logs. However, Oracle DBA can set parameters in the database server that can tune the duration of instance and crash recovery performance. Also, Oracle DBA can tune the rolling forward and rolling back phases of instance recovery separately. Finally, Oracle DBA can tune checkpointing so that recovery time is optimized.

Learn Oracle - Media Recovery

Media recovery is divided into the following types:

·Datafile media recovery

·Block media recovery

Typically, the term "media recovery" refers to recovery of datafiles.Block media recovery is a more specialized operation that Oracle DBA can only perform with RMAN.

Learn Oracle - Datafile Media Recovery

Datafile media recovery is used to recover from a lost or damaged current datafile or control file. It is also used to recover changes that were lost when a tablespace went offline without the OFFLINE NORMAL option. Datafile media recovery and instance recovery have in common the requirement to repair database integrity. However, these types of recovery differ with respect to their additional features.Media recovery has the following characteristics:

·Applies needed changes using restored backups of damaged datafiles.

·Can use archived logs as well as the online logs.

·Requires explicit invocation by a user.

·Does not detect media failure (that is, the need to restore a backup) automatically. After a backup has been restored, however, detection of the need to recover it through media recovery is automatic.

·Has a recovery time governed solely by user policy (for example, frequency of backups, parallel recovery parameters) rather than by Oracle internal mechanisms.

The database cannot be opened if any of the online datafiles needs media recovery, nor can a datafile that needs media recovery be brought online until media recovery has been executed.The following scenarios necessitate media recovery:

·Oracle DBA restore a backup of a datafile.

·Oracle DBA restore a backup control file (even if all datafiles are current).

·A datafile is taken offline (either by Oracle DBA or automatically by Oracle) without the OFFLINE NORMAL option.

Unless the database is not open by any instance, datafile media recovery can only operate on offline datafiles. Oracle DBA can initiate datafile media recovery before opening a database even when crash recovery would have sufficed. If so, crash recovery still runs automatically at database open.

Note that when a file requires media recovery, you must perform media recovery even if all necessary changes are contained in the online logs. In other words, you must still run recovery even though the archived logs are not needed. Media recovery may find nothing to do -- and signal the "no recovery required" error -- if invoked for files that do not need recovery.

Learn Oracle - Block Media Recovery

Block media recovery is a technique for restoring and recovering individual data blocks while all database files remain online and available. If corruption is limited to only a few blocks among a subset of database files, then block media recovery may be preferable to datafile recovery.

The interface to block media recovery is provided by RMAN. If Oracle DBA do not already use RMAN as your principal backup and recovery solution, then you can still perform block media recovery by cataloging into the RMAN repository the necessary user-managed datafile and archived redo log backups.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值