Link to home
Start Free TrialLog in
Avatar of kunchesm
kunchesm

asked on

When to use "Alter database open resetlogs;"?

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,
Avatar of schwertner
schwertner
Flag of Antarctica image

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.
ASKER CERTIFIED SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial