Oracle data recovery from the recovery type, cast aside the specific files, the total can be divided into two major types of recovery, one is full recovery, one is not full recovery. In fact, once you are familiar with the Oracle architecture, there is a general concept for Oracle recovery. Because the external part of Oracle consists mainly of different files, each different type of file has different functions, so as long as understand its role, more conducive to understanding and mastering the Oralce database backup and recovery. Back to the point, full recovery is to restore the database to the latest SCN, the moment before the failure, is a lossless recovery. Incomplete recovery is a lossy recovery, which can be used to restore user errors, archive log loss, and more. This article mainly describes the incomplete recovery based on user management.
First, incomplete recovery characteristics
1. Incomplete recovery
Incomplete recovery is simply the recovery of data to a specific point in time or to a specific SCN, rather than the current point in time. Incomplete recovery affects the entire database and needs to be carried out in the Mount state. After an incomplete recovery is successful, you typically need to use the Resetlogs option to open the database. When the resetlogs is used, the SCN counter is not reset, the original log sequence number log sequence will end, and the new log sequence number starts anew. Called in Oracle to produce a new incarnation. Oracle also resets the online redo log content, so it is recommended that the database be resetlogs after the end of the system.
2. Conditions for incomplete recovery
A user-managed incomplete restore must meet the following three conditions to be used:
A) archive mode
b) to have all datafile before the misoperation of the backup
C to have all the archives since the backup you want to use
3, incomplete recovery of the situation
(1) Media failure (media failure) results in some or all of the online redo logs (online redo log) damaging the user's Operation error (username error) resulting in data loss, for example, the user inadvertently removed the table and submitted invalid data to the table.
(2) The Archive redo log (archived redo log) is missing and cannot be fully restored (complete recovery).
(3) The current control file is missing and you must open the (open) database using the backup control file.
4. Steps for incomplete recovery
(1) Close the database and back up the database (to prevent recovery from failing)
(2) Start database to Mount state
(3) Restore all data files, and optionally restore control files (note that you need to restore all data files, not just damaged files)
(4) Restore the database to a point in time, sequence, or system change number
(5) Open the database using the Resetlogs keyword
5. Note
The prerequisite for incomplete recovery is that the ORACL database is up to the Mount state, that is, the parameter file, the control file
It is recommended to make a backup before and after the recovery before doing a full recovery to avoid unnecessary loss due to recovery failure
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
When incomplete recovery is complete, it is recommended that you do not use the Open resetlogs command to open the database directly in read/write mode, but first open the database in read-only mode and check that the database has been restored to the correct point in time. If the point-in-time recovery is incorrect, it is relatively straightforward to redo the restore operation without using the OPEN resetlogs command.
For recovery results that are earlier than the specified point in time, you only need to redo the recovery operation. If the recovery results exceed the specified point in time, you should restore the database again and restore it again.
Note: Oracle 10g has been able to not back up the database after Resetlogs and will be able to traverse resetlogs when resuming
6. Several types of incomplete media recovery
Time-based recovery (time-based recovery) restores data to a specified point in time
Recover database until time ' 2000-10-01 10:10:10 '
User-controlled recovery (cancel-based recovery) Stop recovery after the user submits Cancel (this option is not valid when using Rman)
Recover database untill Cancel
SCN-based recovery (change-based recovery) restores data to the specified SCN
Recover database until SCN
Restores the data to the specified redo log ordinal (valid only when Rman is used) by redo log ordinal recovery (log sequence recovery)
Incomplete recovery of control files using backup simultaneously
Using Backup control File
Author: 51cto Blog Oracle Little Bastard