Opening the Database with the RESETLOGS Option

原创 2008年09月29日 22:27:00

Opening the Database with the RESETLOGS Option

you perform incomplete recovery or recovery with a backup control file,
you must reset the online logs when you open the database. The new
version of the reset database is called a new incarnation.

This section contains the following topics:

About Opening with the RESETLOGS Option

The RESETLOGS option is always required after incomplete media recovery or recovery using a backup control file. Resetting the redo log does the following:

  • Archives the current online redo logs (if they are accessible) and
    then erases the contents of the online redo logs and resets the log
    sequence number to 1. For example, if the current online redo logs are
    sequence 1000 and 1001 when you open RESETLOGS, then the database archives logs 1000 and 1001 and then resets the online logs to sequence 1 and 2.

  • Creates the online redo log files if they do not currently exist.

  • Reinitializes the control file metadata about online redo logs and redo threads.

  • Updates all current datafiles and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp.

Because the database will not apply an archived log to a datafile unless the RESETLOGS SCN and time stamps match, the RESETLOGS
prevents you from corrupting datafiles with archived logs that are not
from direct parent incarnations of the current incarnation.

In prior releases, it was recommended that you back up the database immediately after the RESETLOGS. Because you can now easily recover a pre-RESETLOGS
backup like any other backup, making a new database backup is optional.
In order to perform recovery through resetlogs you must have all
archived logs generated since the last backup and at least one control
file (current, backup, or created).

Figure 18-1
shows the case of a database that can only be recovered to log sequence
2500 because an archived redo log is missing. When the online redo log
is at sequence 4000, the database crashes. You restore the sequence
1000 backup and prepare for complete recovery. Unfortunately, one of
your archived logs is corrupted. The log before the missing log
contains sequence 2500, so you recover to this log sequence and open RESETLOGS. As part of the RESETLOGS, the database archives the current online logs (sequence 4000 and 4001) and resets the log sequence to 1.

You generate changes in the new incarnation of the database,
eventually reaching log sequence 4000. The changes between sequence
2500 and sequence 4000 for the new incarnation of the database are
different from the changes between sequence 2500 and sequence 4000 for
the old incarnation. You cannot apply logs generated after 2500 in the old incarnation to the new incarnation, but you can apply the logs generated before sequence 2500 in the old incarnation to the new incarnation. The logs from after sequence 2500 are said to be orphaned in the new incarnation because they are unusable for recovery in that incarnation.

Figure 18-1 Creating a New Database Incarnation


Description of "Figure 18-1 Creating a New Database Incarnation"

Executing the ALTER DATABASE OPEN Statements

To preserve the log sequence number when opening a database after media recovery, execute either of the following statements:


To reset the log sequence number when opening a database after
recovery and thereby create a new incarnation of the database, execute
the following statement:


If you open with the RESETLOGS option, the database
returns different messages depending on whether recovery was complete
or incomplete. If the recovery was complete, then the following message
appears in the alert_SID.log file:

RESETLOGS after complete recovery through change scn

If the recovery was incomplete, then this message is reported in the alert_SID.log file, where scn refers to the end point of incomplete recovery:

RESETLOGS after incomplete recovery UNTIL CHANGE scn

If you attempt to OPEN RESETLOGS when you
should not, or if you neglect to reset the log when you should, then
the database returns an error and does not open the database. Correct
the problem and try again.

See Also:

"About User-Managed Media Recovery Problems" for descriptions of situations that can cause ALTER DATABASE OPEN RESETLOGS to fail

Checking the Alert Log After a RESETLOGS Operation

After opening the database with the RESETLOGS option, check the alert_SID.log
to see whether the database detected inconsistencies between the data
dictionary and the control file, for example, a datafile that the data
dictionary includes but which is not listed in the new control file.
The following table describes two possible scenarios.

Control File Data Dictionary Result
Datafile is listed Datafile is not listed References to the unlisted datafile are removed from the control file. A message in the alert log indicates what was found.
Datafile is not listed Datafile is listed The database creates a placeholder entry in the control file under MISSINGnnnnn (where nnnnn is the file number in decimal). MISSINGnnnnn is flagged in the control file as offline and requiring media recovery. You can make the datafile corresponding to MISSINGnnnnn accessible by using ALTER DATABASE RENAME FILE for MISSINGnnnnn so that it points to the datafile. If you do not have a backup of this datafile, then drop the tablespace.



一.创建控制文件时:Resetlogs和Noresetlogs当我们将控制文件备份到trace 文件时,可以看到里面包含了2部分的重建语句,一个是使用resetlogs,另一个是使用noresetlo...
  • tianlesoftware
  • tianlesoftware
  • 2012年07月16日 23:58
  • 11904

alter database backup controlfile to trace创建控制文件脚本,重建控制文件

创建控制文件脚本,重建控制文件 alter database backup controlfile to trace 1、alter session set tracefile_identifier...
  • Oraclesand
  • Oraclesand
  • 2016年10月26日 10:53
  • 1843

oracle11g OCP 认证 1Z0-053考试笔记6

502.A database is running In ARCHIVBXXMS mode. It has two online redo log groups and each group has ...
  • wlbzy
  • wlbzy
  • 2016年11月27日 14:53
  • 2529


错误展现如下:SQL> conne /as sysdbaConnected.SQL> shutdown abortORACLE instance shut down.SQL> startupORACL...
  • shenzhen2008
  • shenzhen2008
  • 2010年06月17日 11:53
  • 7020

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open; alter database open * ERROR at line 1: ORA-01589: must use RESETLOGS o...
  • songxixi
  • songxixi
  • 2011年11月25日 10:43
  • 5518


本文档转发自:,只加了部分自己操作后的备注,操作环境:虚拟机Vmware Player 5.0.2+RHEL Se...
  • totuswhf
  • totuswhf
  • 2014年01月12日 22:44
  • 1128

ocp 认证 043

分卷:A 1: 单选题 Your database is open and running in ARCHIVELOG mode. You take RMAN full backups every...
  • yujin2010good
  • yujin2010good
  • 2012年02月07日 22:02
  • 3498

About Opening with the RESETLOGS Option

官方文档地址:     About Opening ...
  • u011316319
  • u011316319
  • 2013年07月08日 22:56
  • 371

一次恢复DB的过程:试用隐含参数_allow_resetlogs_corruption和重建undo tablespace

问题:某个现场做数据库恢复的时侯有一个问题:DB恢复需要这个归档日志文件1_33160.dbf,但是在备份中没有。SQL> recover database using backup controlf...
  • yjz0065
  • yjz0065
  • 2008年09月26日 18:29
  • 1124

Opening the Database with the RESETLOGS Option

导读:Opening the Database with the RESETLOGS OptionWheneveryou perform incomplete recovery or recovery...
  • Xviewee
  • Xviewee
  • 2008年09月29日 22:27
  • 1328
您举报文章:Opening the Database with the RESETLOGS Option