Tales From A Lazy Fat DBA

Its all about Databases & their performance, troubleshooting & much more …. ¯\_(ツ)_/¯

ALTER DATABASE OPEN *RESETLOGS*

Posted by FatDBA on September 24, 2012

What is and why there is a need to open database in RESETLOGS mode ?

Answer:
Whenever you perform incomplete recovery or recovery with a backup control file, you must reset the online logs when you open the database.

– 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.

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

– The RESETLOGS prevents you from corrupting datafiles with archived logs that are not from   direct parent incarnations of the current incarnation.

 
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:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;
Database altered.

 

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     0
Next log sequence to archive   1
Current log sequence           1

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: