Oracle Backup Recovery recover database four statement differences

Source: Internet
Author: User

1 Recover database using Backup Controlfile
2 Recover database until cancel
3 Recover database using Backup controlfile until cancel;
4 Recover database until cancel using Backup controlfile;

This article mainly introduces the following four kinds ofRecoveryThe meaning and difference of the way:1. Recover database using Backup Controlfile
If you lose the current control file, use the coldBackupWhen the control file is restored, it is used to tellOracle, do not use the SCN in Controlfile as the end point of recovery;2. Recover database until CancelIf you lose current/active redo, manually specify the end point.3. Recover database using Backup controlfile until cancel;If the current controlfile is lost and current/active redo is lost, the archive log is automatically applied and the maximum recovery can be achieved.4. Recover database until cancel using Backup controlfile;If the current controlfile is lost and current/active redo is lost, the SCN in the old redo is restored to the endpoint. Because no archived logs are applied, all data is lost. To understand the recover database using Backup Controlfile, first understand recover database, that is, without using the backup Controlfile case. In the ordinary recover database or recover tablespace, recover datafile, Oracle will be based on the current Controlfile recorded SCN, using archive log and redo Log of the redo entry, the relevant datafile block to the "current controlfile record of the SCN" and in some cases, Oracle needs to restore the data to a more than the current record of Controlfile the SCN is still back to the location (such as , control file is backup Controlfile, or Controlfile is based on trace create.   ), it is necessary to use the using Backup Controlfile. Recovery is not limited by the "SCN currently recorded by Controlfile". This time the limit comes from your statement (until time, until SCN), or the available archive log (until cancel) ...

The results are as follows:
If the control file is missing, restore backs up the control files after you must use the Using Backup Controlfile option. Until cancel, however, is not fully recovered, that is, the current/active redo is lost, or an archive file is missing from the restore database and terminates.

Conclusion:
1, for the restore old control files, and the archive log and cuurrent/active redo are not lost. If all archived logs and online logs are intact, you can not lose data. Similar to recover database
2, the current control file is not lost (do not need to restore the old control file), at this time there is an archive log or current/active log has been lost, then terminated. Maximum possible recovery data
3, 4: I am in the Oracle 10.2.0.4 Environment test effect is the same, that is applicable to the restore old control files, after the restoration to the control file backup that moment, the system will be prompted to apply control file backup after the archive log, if not stopped. is also the largest possible recovery data.

As a result, if you have an old database backup, use recover database or recover database using Backup controlfile in case the archive log and the online log are all intact. The data is not lost
If there is a backup data file after restore, the archive log or the online log (active, current) is lost, you can revert to the previous archive log that was lost

Until cancel is not fully recovered
ALTER DATABASE open Resetlogs required
Database open requires an understanding of making a full-library backup

The online log file is missing:

If you shut down the database properly and then start the Times wrong:

sql> ALTER DATABASE open;
ALTER DATABASE Open
*
An error occurred on line 1th:
ORA-00313: Unable to open member of Log Group 1 (for thread 1)
ORA-00312: Online log 1 thread 1:
' C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01. LOG '


sql> ALTER DATABASE open resetlogs;
ALTER DATABASE open Resetlogs
*
An error occurred on line 1th:
The ora-01139:resetlogs option is only valid after incomplete database recovery


sql> recover database until cancel;
Complete media recovery.
sql> ALTER DATABASE open resetlogs;

The database has changed.

Oracle Backup Recovery recover database four statement differences

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.