OCP question analysis _ 043: differences between Oracle recid and sequence # And resetlogs operations

Source: Internet
Author: User
sys@ORCL> select recid,sequence# from v$log_history;     RECID  SEQUENCE#---------- ----------         1          1         2          2         3          3         4          4         5          5         6          6         7          7         8          8         9          9        10         10        11         11        12         12        13          1        14          2        15          3        16          4        17          1        18          2        19          3        20          4        21          5        22          6        23          7        24          8        25          9        26         10        27         11        28         12        29         13        30         14        31         15        32         16        33         17RMAN> list incarnation of database;using target database control file instead of recovery catalogList of Database IncarnationsDB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time------- ------- -------- ---------------- --- ---------- ----------1       1       ORCL     1316499950       PARENT  1          2005-06-30:19:09:402       2       ORCL     1316499950       PARENT  446075     2012-07-15:16:40:153       3       ORCL     1316499950       PARENT  604802     2012-08-08:10:35:104       4       ORCL     1316499950       CURRENT 607329     2012-08-08:11:28:40

 

 

Alter database open resetlog allows sequence # To start from serial number 1 again

Oracle created a backup when sequence # is 100 and crashed when sequence # is 400, because you only have
Therefore, you can only restore to the status when sequence # is 250, and then open it with resetlogs, and Oracle starts a new incarnation
Sequence # Is reinitialized to 1, and then reaches 400 as Oracle continues to grow, but these logfiles are not associated with the previous logfile
Although their sequence # is the same

Specifying resetlogs will perform the following operations:
① Archive the current online redolog file (if accessible), then clear the content and reset sequence # to 1
(If the online redo log file does not exist, it is rebuilt)
② Reset the metadata of the online redo log file in controlfile
③ Update resetlogs SCN and reset time information in datafile and online redolog File

In versions earlier than 10 Gb, we recommend that you perform a full backup immediately after the database completes the open resetlogs operation.
Because in earlier versions, online redolog files are not archived When the open resetlogs operation is executed.
This will cause the archived log file to be no longer consecutive, And the backup created earlier will not be valid.
That is, the current status cannot be restored and can only be recovered before the open resetlogs operation.
This problem does not exist in 10 GB and later versions. The open resetlogs operation will first archive the current online redolog File
In addition, the open resetlogs operation will be recorded in the online redologs file and archived normally.
It is equivalent to open resetlogs, which is only a command operation, just like other SQL commands.
This ensures the continuity of the archived log file, and the previous backup is still valid.

 

OCP questions:

 

 

However, we recommend that you back up the entire database immediately after the Open resetlogs operation.

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.