RMAN full database [full recovery/Incomplete recovery]

Source: Internet
Author: User

We have the honor to have a few RMAN full-database recovery experiments today. Here is a brief version, which can be found in an instant if you forget it.

1. Full recovery
1. Full database [full recovery]
$ Rman target/log on to the rman tool. If catalog is used, log on to rman targetsys/Oracle @ lscatalogcata/cata @ leo.
RMAN> startup mount must be in the mount status to restore and recover the database.
RMAN> restore database; copy the old data file to overwrite the damaged data file


RMAN> recover database; synchronize the last SCN in the current log with the SCN number in the data file header [completely recovered]
RMAN> alter database open; open a data file

2. Incomplete recovery

1. Based on Time points [Incomplete recovery]
Use the until time, until scn, and until sequence parameters in the restore recover command.
This method avoids the use of the run code block. We recommend that you use this method [to the mount state, restore and recover database]
Startup mount;
Restore database until time "to_date ('2017-04-04 19:13:50 ', 'yyyy-mm-dd hh24: mi: ss ')";
Recover database until time "to_date ('2017-04-04 19:13:50 ', 'yyyy-mm-dd hh24: mi: ss ')";
Alter database open resetlogs; [resetlogs is valid only after "Incomplete recovery". For Incomplete recovery, you must add the resetlogs/noresetlogs option to open the data and reset the archive log serial number from 1]
Note: This command can restore the database to the status at the specified time point, but it must have the last valid backup before this time point, and all related archived logs.

2. Incomplete Restoration Based on the scn number]
Startup mount;
Restore database until scn 10000;
Recover database until scn 10000;
Alter database open resetlogs; [resetlogs is valid only after "Incomplete recovery". For Incomplete recovery, you must add the resetlogs/noresetlogs option to open the data and reset the archive log serial number from 1]
Note: This command restores the database to the status of the specified scn number, but does not include this scn number.

3. Incomplete recovery based on the serial number of the archived log]
Startup mount;
Restore database until sequence 123 thread 1;
Recover database until sequence 123 thread 1;
Alter database open resetlogs; [resetlogs is valid only after "Incomplete recovery". For Incomplete recovery, you must add the resetlogs/noresetlogs option to open the data and reset the archive log serial number from 1]
Note: This command can restore the database to the status of the specified archive log serial number. If there is a breakpoint in the archive log list, it is easier to use this method. The breakpoint means that we can only restore to the start point of the breakpoint.

If you directly restore the database under open, the following error will be reported:
Channel ORA_DISK_1: reading from backup piece/home/oracle/backup/DB_0fn7d50b backup block, which is the last backup to be restored, in the catalog library, automatically find [prerequisite must be connected to catalog]
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of restore command at 12:03:18
ORA-19870: error reading backup piece/home/oracle/backup/DB_0fn7d50b error reading backup Block
ORA-19573: cannot obtain exclusive enqueue for datafile 4 cannot include exclusive data file 4 queue

Summary: Generally, "instance recovery" adopts more than full recovery, and "medium recovery" adopts more than Incomplete recovery.

Recommended reading:

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.