The meaning of ALTER DATABASE open Resetlogs

Source: Internet
Author: User
Tags oracle documentation

Transferred from: http://blog.sina.com.cn/s/blog_63216bda0100zblr.html

As mentioned in the Oracle documentation, once the database is restored with a backed-up control file, the database needs to be opened using the Resetlogs method, but resetlogs usually means incomplete recovery and, more importantly, once the database is opened with the Resetlogs method, The serial number of the log is used again starting from 1. In fact, if only control file corruption, log files are complete, the database can be fully restored, and do not have to use resetlogs open. Next, we summarize the incomplete recovery, which is shown in 9-10, and then through some experiments in-depth understanding.

Fig. 9-10 Reconstruction method of control file and subsequent recovery operation

9.6.1 use the ALTER DATABASE open resetlogs Occasion

With the Resetlogs option, the current log sequence number (log sequence numbers) is reset to 1 and all log information is discarded. The Resetlogs option is required when the following conditions are used:

In the incomplete recovery (media recovery);

Use a backup control file.

After you open a database with Resetlogs, be sure to make a full database backup.

Specifying Resetlogs performs the following actions:

Archive The current online redo log file (if available), then empty the content and reset the log file sequence number to 1 (rebuild if the online redo log file does not exist).

Resets the metadata about the online log file in the control file .

Update the Resetlogs SCN and reset time information in data files and online redo log files.

As the name implies, reset resets the log order number, so backup of the previous database will no longer be available

All things have a cause, an incomplete recovery operation is performed, or a backup control file is used for recovery, or after the flashback database operation is performed, the Resetlogs option must be specified when opening the databases, which is determined by the Oracle's own characteristics.

There is a life cycle within Oracle in normal operation, and this life cycle also has a professional vocabulary called incarnation in Oracle. Incomplete recovery, as the name implies is only to restore some of the data, because the database can not be restored to the current state (the state before the crash), the Oracle database is not aware of the current state, the transaction may be consistent, but is not up-to-date, Oracle can not judge, follow-up may still have redo log files, However, it cannot be applied (or the DBA does not allow the application). Without the concept of incarnation, the normal open database will produce redo log files, and the sequence number of these log files is the same as before (but the content may be different), so whether it is a backup or recovery is confusing, it must be performed after incomplete recovery, marking the end of the life cycle, The method is to open the database in Resetlogs mode. When opened in Resetlogs mode, the Oracle database begins a new lifecycle, resetting incarnation, and the log file sequence number is reinitialized to 1.

Figure 7-4 shows the operation of an open resetlogs. If we draw a timeline, the incomplete recovery is to restore the database to a point between the backup time and the current time.

The database creates a backup when the log file sequence number is 1000, crashes when the log file sequence number is 4000, because the log file sequence number is 2501, so you can only restore the database to the state of the log file ordinal 2500, and then open it in resetlogs mode. The Oracle database starts with a new incarnation, the log file sequence number is reinitialized to 1, and then as the database runs up and up to 4000, but these log files are not associated with the previous log file (although the file number is the same).

Specifying Resetlogs performs the following actions:

Archive the current online redo log file (if available), then empty the content and reset the log file sequence number to 1 (rebuild if the online redo log file does not exist).

Resets the metadata about the online log file in the control file.

Update the Resetlogs SCN and reset time information in data files and online redo log files.

Prior to the 10g version, after the database performed the open resetlogs operation, it is recommended that a full backup be made immediately, since the current online Redologs file is not archived in previous versions when the open Resetlogs operation is performed. This causes the archive file to no longer be contiguous, so the previously created backup is no longer valid (recovery is not in the current state and can only be restored until the open resetlogs operation). 10g and later versions do not have this problem, the open Resetlogs operation will first archive the current online redo log file (if you have access to it), and open resetlogs operation will also be recorded in the online redologs file and properly archived, The equivalent of open resetlogs is just a command operation, just like any other SQL command, which guarantees the continuity of the archive log file, while the previous backup is still valid, but it is still recommended to do a full-library backup immediately after the open resetlogs operation.

Tips

What is incarnation?

The Incarnation of Oracle database is translated into some materials, which in my opinion can be interpreted as a life cycle. Oracle database from creation to encountering resetlogs as a life cycle, the logical attributes of the database during this life cycle, such as SCN, log file serial number, etc. have the same characteristics. When the database is opened by Open Resetlogs, the original life cycle is declared closed, the redo log files generated during the original life cycle are discarded, and the log file sequence number is automatically reset to 1.

(turn) ALTER DATABASE open resetlogs meaning

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.