Automatic Recovery with SET AUTORECOVERY

========================================
Issuing SET AUTORECOVERY ON before issuing the RECOVER command. If you recovery with SET AUTORECOVERY OFF, which is the default, then you must enter filenames manually or accept the suggested filename by pressing Enter.

STARTUP MOUNT
SET AUTORECOVERY ON
RECOVER DATABASE
ALTER DATABASE OPEN;
Note:
After issuing the SQL*Plus RECOVER command, you can view all files that have been considered for recovery in the V$RECOVERY_FILE_STATUS view. You can access status information for each file in the V$RECOVERY_STATUS view. These views are not accessible after you terminate the recovery session.

The filenames used when you use automatic recovery are derived from the concatenated values of LOG_ARCHIVE_FORMAT with LOG_ARCHIVE_DEST_n, where n is the highest value among all enabled, local destinations. For example, assume the following initialization parameter settings are in effect in the database instance:

LOG_ARCHIVE_DEST_1 = "LOCATION=/arc_dest/loc1/" 
LOG_ARCHIVE_DEST_2 = "LOCATION=/arc_dest/loc2/"
LOG_ARCHIVE_DEST_STATE_1 = DEFER 
LOG_ARCHIVE_DEST_STATE_2 = ENABLE 
LOG_ARCHIVE_FORMAT = arch_%t_%s_%r.arc
In this example, SQL*Plus automatically suggests the filename /arc_dest/loc2/arch_%t_%s_%r.arc (where %t is the thread, %s is the sequence and %r is the resetlogs ID).

Automatic Recovery with the AUTOMATIC Option of the RECOVER Command
===================================================================
STARTUP MOUNT
RECOVER AUTOMATIC DATABASE
ALTER DATABASE OPEN;
If you use an Oracle Real Application Clusters configuration, and if you are performing incomplete recovery or using a backup control file, then the database can only compute the name of the first archived redo log file from the first redo thread. You may have to manually apply the first log file from the other redo threads. After the first log file in a given thread has been supplied, the database can suggest the names of the subsequent logs in this thread.

Recovery When Archived Logs Are in a Nondefault Location
########################################################

Overriding the Archived Log Destination
=======================================
SET LOGSOURCE "/tmp"

Recover the offline tablespace. For example, to recover the offline tablespace users do the following:
RECOVER AUTOMATIC TABLESPACE users

Alternatively, you can avoid running SET LOGSOURCE and simply run:
RECOVER AUTOMATIC TABLESPACE users FROM "/tmp"

Parallel Media Recovery
=======================
By default, Oracle uses parallel media recovery to improve performance of the roll forward phase of media recovery
To override the default behavior of performing parallel recovery, use the RECOVER with the NOPARALLEL option, or RECOVER PARALLEL 0. The RECOVERY_PARALLELISM initialization parameter controls instance or crash recovery only. Media recovery is not affected by the value used for RECOVERY_PARALLELISM.

Performing Closed Database Recovery
===================================
If you choose not to automate the application of archived redo logs, then you must accept or reject each prompted log. If you automate recovery, then the database applies the logs automatically. Recovery continues until all required archived and online redo logs have been applied to the restored datafiles. The database notifies you when media recovery is complete:

Media recovery complete.
If no archived redo logs are required for complete media recovery, then the database applies all necessary online redo log files and terminates recovery.

ALTER TABLESPACE users OFFLINE TEMPORARY;

RECOVER AUTOMATIC FROM '/tmp' TABLESPACE users, tools;

RECOVER AUTOMATIC TABLESPACE users, tools;

ALTER TABLESPACE users ONLINE;

Performing Incomplete Database Recovery
#######################################
Performing Cancel-Based Incomplete Recovery
===========================================
RECOVER DATABASE UNTIL CANCEL;

The database applies the necessary redo log files to reconstruct the restored datafiles. The database supplies the name it expects to find from LOG_ARCHIVE_DEST_1 and requests you to stop or proceed with applying the log file. If the control file is a backup, then you must supply the names of the online redo logs if you want to apply the changes in these logs.

ALTER DATABASE OPEN RESETLOGS;

Performing Time-Based or Change-Based Incomplete Recovery
=========================================================
RECOVER DATABASE UNTIL CHANGE 10034;

RECOVER DATABASE UNTIL TIME '2000-12-31:12:47:30';

About User-Managed Media Recovery Problems
##########################################
When media recovery encounters a problem, the alert log may indicate that recovery can continue if it is allowed to corrupt the data block causing the problem. The alert log contains information about the block: its block type, block address, the tablespace it belongs to, and so forth. For blocks containing user data, the alert log may also report the data object number.

In this case, the database can proceed with recovery if it is allowed to mark the problem block as corrupt. Nevertheless, this response is not always advisable. For example, if the block is an important block in the SYSTEM tablespace, marking the block as corrupt can eventually prevent you from opening the recovered database. Another consideration is whether the recovery problem is isolated. If this problem is followed immediately by many other problems in the redo stream, then you may want to open the database with the RESETLOGS option.

ALTER DATABASE OPEN READ ONLY;

SELECT OWNER, OBJECT_NAME, SUBOBJECT_NAME, OBJECT_TYPE
FROM DBA_OBJECTS
WHERE DATA_OBJECT_ID = 8031;

Allowing Recovery to Corrupt Blocks
===================================
RECOVER DATABASE ALLOW 5 CORRUPTION

Performing Trial Recovery
=========================
By default, if a trial recovery encounters a stuck recovery or similar problem, then it always marks the data block as corrupt in memory when this action can allow recovery to proceed. The database writes errors generated during trial recovery to alert files. These errors are clearly marked as test run errors.

RECOVER DATABASE TEST
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL TEST
RECOVER TABLESPACE users TEST
RECOVER DATABASE UNTIL CANCEL TEST

By default, trial recovery always attempts to corrupt blocks in memory if this action allows trial recovery to proceed. Trial recovery by default can corrupt an unlimited number of data blocks. You can specify the ALLOW n CORRUPTION clause on the RECOVER ... TEST statement to limit the number of data blocks trial recovery can corrupt in memory.

A trial recovery command is usable in any scenario in which a normal recovery command is usable. Nevertheless, you should only need to run trial recovery when recovery runs into problems.

All about Performing User-Managed Database Recovery的更多相关文章

  1. Performing a full database disaster recovery with RMAN

    Performing a full database disaster recovery with RMAN1. Make the RMAN backup set pieces available.2 ...

  2. Performing User-Managed Database-18.7、Performing Complete User-Managed Media Recovery

    18.7.Performing Complete User-Managed Media Recovery 完毕一致性备份,把数据库恢复到当前的scn是最好的结果.能够恢复整个数据库.恢复单个表空间.或 ...

  3. CMU Database Systems - Database Recovery

    数据库数据丢失的典型场景如下, 数据commit后,还没有来得及flush到disk,这时候crash就会丢失数据 当然这只是fail的一种情况,DataBase Recovery要讨论的是,在各种f ...

  4. 11gR2 Database Services for "Policy" and "Administrator" Managed Databases (文件 ID 1481647.1)

    In this Document   _afrLoop=1459311711568804&id=1481647.1&displayIndex=6&_afrWindowMode= ...

  5. 11gR2 Database Services for "Policy" and "Administrator" Managed Databases (文档 ID 1481647.1)

    In this Document   Purpose   _afrLoop=1459311711568804&id=1481647.1&displayIndex=6&_afrW ...

  6. Oracle Database 12c Using duplicate standby database from active database Created Active DataGuard

    primary database db_name=zwc, db_unique_name=zwc standby database db_name=zwc, db_unique_name=standb ...

  7. Oracle DG故障诊断一则:alter database recover to logical standby new_logical_dbname卡住

    我们在基于物理standby的基础上搭建逻辑备库过程过程中,在运行: alter database recover to logical standby READDB; 卡住不动,而且alert也没有 ...

  8. 采用Duplicate target database在线恢复秩序oracle datagard图书馆设备

    线上oracle datagard备库由于断电以及误删除从库的归档日志文件,所以导致,备库主库数据不一致,备库须要紧急恢复.以下是大概恢复过程 1,从主库上面备份控制文件[oracle@localho ...

  9. Backup and Recovery Strategies1

    2.1.Data Recovery Strategy Determines Backup Strategy 在设计备份策略.如若数据恢复需求和数据恢复战略启动.每种类型的数据恢复需要你采取相应的备份类 ...

随机推荐

  1. oracle存储过程+游标处理select数据

    create or replace PROCEDURE UPDATE_RECORDCODE is cursor location_data is select * from location wher ...

  2. 《Visual Studio Magazine》2013年读者选择奖—软件类

    <Visual Studio Magazine>会在每年的下半年向读者发出投票邀请,读者将在28个大类,超过500个开发工具的名单中选出他们认为最好的产品,以票数评出各分类的金.银.铜奖. ...

  3. 苹果公司的新的编程语言 Swift 高级语言(十五)--协议

    协议定义了适合某个特定任务或功能须要的方法.属性和其他需求的一个蓝图.协议本身不提供这些需求的实现,它仅仅是描写叙述了一个任务或功能实现的蓝图. 协议与java 语言中的接口定义类似,都是描写叙述了一 ...

  4. centOS6 php 编 imap 模

    php 编 c-client imap 客户.下载 http://www.washington.edu/imap/mirrors.html 第一步,编 c-client 官方文档说究竟有点坑,编译报错 ...

  5. 安装64位的oracle连接客户端

    VS自带的WebServer只有32位的,你只能以32位运行,即使你的VS里面编译目标是64位的, 注意:发布到iis,可以以64位运行,你需要安装64位的oracle连接客户端.如果没有,你的程序必 ...

  6. c#生成word文档

    参考:http://blog.163.com/zhouchunping_99/blog/static/7837998820085114394716/ 生成word文档 生成word文档 view pl ...

  7. 如何给非AppCompatActivity添加Toolbar?--关于5.0新特性兼容5.0以下设备的探索

    Android支持包22.1引进了AppCompatDelegate 最新22.1版本的支持包引入了大量酷炫的新特性,这些特性将允许我们轻易地将材料设计/API 21+的特性应用到之前的那些老的,不兼 ...

  8. 云服务器下ASP.NET Core 1.0环境搭建(包含mono与coreclr)

    最近.net core如火如荼,国内这方面环境搭建方面的文档也非常多,但是不少已经是过时的,就算按照那个流程走下去也避免不了一些地方早就不一样了.所以下面我将从头到尾的教大家搭建一次环境,并且成功运行 ...

  9. Webapi帮助文档

    生成自己的Webapi帮助文档(一) 最近Webapi接口的开发刚刚进入尾声,随之而来的是让用户知道接口的详细参数信息,看过淘宝的接口文档,但网上没找到他的实现方式 虽然新建Webapi时C#也会给你 ...

  10. 移动web知识

    1.像素知识 px: css pixels,逻辑像素,浏览器使用的抽象单位 dp,pt:device independent pixels ,设备无关像素 dpr:devicePixelRatio 设 ...