All about Performing User-Managed Database Recovery(二)
ed 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 block