Differences between Oracle resetlogs and noresetlogs

Source: Internet
Author: User

 

1. When creating Control Files: resetlogs and noresetlogs

When we back up the control file to the trace file, we can see that it contains two reconstruction statements: resetlogs and noresetlogs.

 

The SQL statement for the backup control file is as follows:

SQL> alterdatabase backup controlfile to trace

 

For details about the control file, refer:

Oracle Control File

Http://blog.csdn.net/tianlesoftware/article/details/4974440

 

 

Set #1. noresetlogs case

The followingcommands will create a new control file and use it to open the database. dataused by recovery manager will be lost.

Additional logsmay be required for media recovery of offline.

Use this only ifthe current versions of all online logs are available.

-- Use noresetlogs only when all online logs are currently available.

Set #2. resetlogs case

The followingcommands will create a new control file and use it to open the database. dataused by recovery manager will be lost.

The contents ofonline logs will be lost and all backups will be invalidated. Use this only ifonline logs are damaged.

-- Using resetlogs will cause content loss in online logs, and all backups will fail. The resetlos mode is used only when online logs is damaged.

 

 

Create controlfile reuse Database "Dave" resetlogs/noresetlogs archivelog

Maxlogfiles 16

Maxlogmembers 2

Maxdatafiles 30

Maxinstances 1

# Maxloghistory 292

Logfile

Group 1'/u01/APP/Oracle/oradata/Dave/redo01.log' size 50 m,

Group 2'/u01/APP/Oracle/oradata/Dave/redo02.log 'size 50 m,

Group 3 '/u01/APP/Oracle/oradata/Dave/redo03.log' size 50 m

-- Standby logfile

Datafile

'/U01/APP/Oracle/oradata/Dave/system01.dbf ',

'/U01/APP/Oracle/oradata/Dave/undotbs01.dbf ',

'/U01/APP/Oracle/oradata/Dave/sysaux01.dbf ',

'/U01/APP/Oracle/oradata/Dave/users01.dbf'

Character Set zhs16gbk

;

 

2. When opening the database: resetlogs and noresetlogs

 

2.1 description

Use resetlogsafter incomplete reied (when the entire redo stream wasn' t applied). resetlogs will initialize the logs, reset your log sequence number, and start anew "incarnation" of the database.
-- Resetlogs initializes logs, resets the log sequence number, and creates a new incarnation.

 

Use noresetlogswhen doing complete recovery (when the entire redo stream was applied). oraclewill continue using the existing (valid) log files.

-- Noresetlogs will continue to use existing and valid log files.

 

You can use the RMAN command to view incarnation information:

RMAN> List incarnation;

 

For more information, see:

RMAN series (8) ---- RMAN list and report commands

Http://blog.csdn.net/tianlesoftware/article/details/5728116

 

Oracle RMAN cross-resetlogs version recovery

Http://blog.csdn.net/tianlesoftware/article/details/4682463

 

Resetlogs must be used for Incomplete recovery, and resetlogs can also be used for full recovery. Noresetlogs must be used for full recovery. Resetlogs resets the log serial number to forcibly clear or re-create the Redo, while noresetlogs does not.

 

 

2.2 description of the resetlogs and noresetlogs on MOS:

Physical backup and recovery: An insider 'sperspective [ID 16530.1]:

 

After recoverdatabase operation, open the database with: Alter database open [No] resetlogs

(1) noresetlogs

The noresetlogsoption does not clear the redo log files during startup and the online redologs to be used for recovery. only used in scenario where manual recovery isstarted, cancel is used, and then recover database is started.

(2) resetlogs

Caution: Never use resetlogs unlessnecessary.

 

Once resetlogs is used then the redo logfiles cannot be used and any completed transactions in those redo logs arelost !!

 

Before using the resetlogs option take anoffline backup of the database.

 

The resetlogsoption clears all the online redo logs and modifies all the online data filesto indicate no recovery is needed. After resetting the redo logs none of theexisting log files or data file backups can be used.

 

In the control file, the log sequence number is modified, which is very important for recovery purposes. therecovery will be applied only to the log files whose sequence number is greaterthan log sequence number in the control file. one has to be very cautious whenusing resetlogs option. it is important to remember that all datafiles must beonline otherwise they will become useless once the database Is up.

 

 

2.3 descriptions of several situations

 

(1) first case

Assume that only file loss is controlled, while other files are not lost (mainly archive and redo). If you choose to recover the control file from backup. After restoration, the control file reads the RBA information corresponding to the checkpoint SCN in the data file header to determine the sequence from which the archive log is restored, the redolog that is always promoted to restore to the next SCN is infinite. At this time, the recovery is completely restored, but it must be opened in resetlogs mode when it is opened. In this way, the sequence of the archived log should be reset, that is, if you use a backup control file during recovery, you must resetlogs when opening the database.

 

Resetlogs is required for Incomplete recovery. However, if the backup control file is used for full recovery, resetlogs can be used for full recovery. However, the lost control file can also be opened without resetlogs, which can avoid changing the log serial number. For details, see the fourth case.

 

(2) Case 2

Incomplete recovery: resetlogs must be used no matter what type of Incomplete recovery is required, such as SCN, time, and cross-redo.

(3) Case 3

If redolog is lost, resetlogs is needed because resetlogs can reconstruct redolog. If your redolog, control file, and data file are lost, you need to restore the control file first, and then restore database; recover database; Alter database open resetlogs;

Note: At this time, we do not completely recover because redo does do does not. During the recover process, an error may be reported, and then the system automatically exits RMAN. Ignore the error. Just run alter database open resetlogs,

 

(4) fourth case

There is no loss of control files and various logs, and only data files are lost. This problem is common and may result in loss of data files due to disk damage. After disk troubleshooting, it must be restored, at this point, the recovery is very simple. Restore database; recover database; Alter database open; Is everything OK, that is, without using the backup control file for recovery, yes, you can use the noresetlog method to open the database.

The premise is that log files cannot be lost. If the control file and data file are lost but you still want to open it in the noresetlog mode, you must manually recreate the control file in the noresetlogs mode, and the redolog status must be normal, otherwise, it cannot be opened using the noresetlogs method.

 

The analysis of several situations is transferred from the blog:

Http://space.itpub.net/16628454/viewspace-524593

 

 

 

 

 

Bytes -------------------------------------------------------------------------------------------------------

All rights reserved. reprinted articles are allowed, but source addresses must be indicated by links. Otherwise, the documents will be held legally responsible!

Skype: tianlesoftware

QQ: tianlesoftware@gmail.com

Email: tianlesoftware@gmail.com

Blog: http://www.tianlesoftware.com

WEAVER: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

LinkedIn: http://cn.linkedin.com/in/tianlesoftware

 

 

------- Add a group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, reject the application ----

Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)

Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823

Dba6 group: 158654907 dba7 group: 172855474 DBA group: 104207940

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.