Solved

When to use "Alter database open resetlogs;"?

Posted on 2008-06-16
2
9,888 Views
Last Modified: 2008-08-07
Hi,
Can anyone tell me the purpose of Resetting the logs..during DB recovery.

i.e..Alter database open resetlogs;

In which scenario we have to use this command and why?

Regards,
0
Comment
Question by:kunchesm
2 Comments
 
LVL 47

Expert Comment

by:schwertner
ID: 21793194
This is used when the old backup (offline or online) and the set of archived logs will not be used in the future.
Using 'resetlog' you begin a new 'incarnation' of the backups:

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.
0
 
LVL 34

Accepted Solution

by:
johnsone earned 50 total points
ID: 21793203
You need to use a resetlogs when you do an incomplete recovery.

That is the way Oracle works.  The basic reason is so all the file headers and control files get updated with the correct information.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now