SlideShare a Scribd company logo
Missing Redo Logs – Scenario

Filed under: Oracle,RMAN,Redo Logs — Vikram @ 11:39 pm
Tags: Oracle, Redo Logs, RMAN

   Consider a scenario where you have lost your redo logs on a DB instance. It is
possible to recreate them. It is also possible to recover the database with no data loss in
certain situations. Let’s jump to action immediately. But first we need to know different
ways of redo loss and which category we fit in.

A Redo log is a journal of events happening in the DB at any given time. Redo logs are
the most crucial part of the database after the controlfile. The documentation defines the
redo logs as follows:

The online redo log is a set of operating system files that record all changes made to any
database block, including data, index, and rollback segments, whether the changes are
committed or uncommitted. All changes to Oracle blocks are recorded in the online log.

A redo log, at the time of being deleted, will be in one of the below scenarios:
1) The redo log is not CURRENT and archived
2) The redo log is not CURRENT but not archived
3) The redo log is CURRENT (DB was shut down cleanly)
4) The redo log is CURRENT (DB was not shut down cleanly)
Identify which scenario fits you. In all the scenarios except (1) we will need to open the
database using OPEN RESETLOGS option. You may use the below SQL to find the above
details:

SQL> select a.group#, b.member, a.archived, a.status
  2 from v$log a, v$logfile b where a.group#=b.group#;

    GROUP#    MEMBER                                               ARC   STATUS
----------    ----------------------------------------             ---   ----------------
         3    D:VIKRAMORADATATESTTESTREDO03.LOG               YES   INACTIVE
         2    D:VIKRAMORADATATESTTESTREDO02.LOG               YES   UNUSED
         1    D:VIKRAMORADATATESTTESTREDO01.LOG               NO    CURRENT

Remember: RESETLOGS is compulsory when there is an incomplete recovery.

1) Redo log is not CURRENT and archived

If a redo log file is already archived, its loss can safely be ignored. Since all the changes
in the DB are now archived and the online log file is only waiting for its turn to be re-
written by LGWR (redo log files are written circularly) the loss of the redo log file doesnt
matter much. It may be re-created using the command

SQL> STARTUP MOUNT;
SQL> ALTER DATABASE CLEAR LOGFILE GROUP <group#>;
This will re-create all groups and no transactions are lost. The database can be opened
normally after this.

2) Redo log is not CURRENT and not archived

If the redo log is lost before it is archived then there are a few transactions in the redo log
that are lost too. Since a crash recovery is no more possible, a media recovery is required.
The DB needs to be restored from a previous backup and recovered until the last
available archive log is applied. The reason I say crash recovery is not possible is that by
definition a crash recovery should need only online redo logs to recover the database to a
consistent state. If a recovery needs a log file that is not online (like archive logs) then the
recovery is no more a crash recovery. It becomes media recovery. In our current case
since we are applying the archives and using the previous backup to restore it is not a
crash recovery.
Also since we cannot recover database completely as some data is lost in the redo log
files before being archived, this becomes an incomplete recovery too. The DB needs to be
opened up in RESETLOGS mode. The steps to recover are below:

-- Restore the DB from previous backup and open the DB in mount state.
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
-- Apply all the archives available
SQL> ALTER DATABASE OPEN RESETLOGS;

In a similar scenario an RMAN restore will be as below:

RMAN> RESTORE CONTROLFILE FROM '<backup tag location>';
RMAN> ALTER DATABASE MOUNT;
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE UNTIL TIME "to_date('MAR 05 2009 19:00:00','MON
DD YYYY HH24:MI:SS')";
RMAN> ALTER DATABASE OPEN RESETLOGS;

The above commands can also be used in a normal recovery scenario from Production to
Test with a few modifications. The actual plan of steps that I had followed can be found
here. There is a metalink note 1044466.6 that discusses this recovery in greater detail.

3) Redo log is CURRENT (DB was shut down cleanly)

If the CURRENT redo log is lost and if the DB is closed consistently, OPEN RESETLOGS
can be issued directly without any transaction loss. It is advisable to take a full backup of
DB immediately after the STARTUP.

4) Redo log is CURRENT (DB was not shut down cleanly)

When a current redo log is lost, the transactions in the log file are also lost before making
to archived logs. Since a DB startup can no more perform a crash recovery (since all the
now-available online log files are not sufficient to startup the DB in consistent state), an
incomplete media recovery is the only option. We will need to restore the DB from a
previous backup and restore to the point just before the lost redo log file. The DB will
need to be opened in RESETLOGS mode. There is some transaction loss in this scenario.

RMAN> RESTORE CONTROLFILE FROM '<backup tag location>';
RMAN> ALTER DATABASE MOUNT;
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE UNTIL TIME "to_date('MAR 05 2009 19:00:00','MON
DD YYYY HH24:MI:SS')";
RMAN> ALTER DATABASE OPEN RESETLOGS;

Here we come to an end of all the scenarios in which a redo log can be lost.

There is a simpler way to restore the deleted current redo log file on Unix/Linux
platforms too. The procedure to do it will be mentioned in my subsequent posts.

Meanwhile, I would love to hear from you any suggestions or additions to this post.
Thank you.



Possibly related posts: (automatically generated)

   •   Archived Redo Log Files

               Ads by Google
2010 SIEM Magic Quadrant
View complimentary copy of Gartner SIEM MQ Report from
LogLogic.
LogLogic.com/GartnerSIEM



Comments (5)

5 Comments »
   1. Thanks for the input, I just blew away my redo logs testing backup/restore
      scenarios and this post helped point me in the right direction!!

       Comment by Free Games Gallery — April 3, 2009 @ 2:08 pm

   2. Great Post!Can you please let us know the simpler method of restoring the deleted
      logfiles.Keep up the good work:)
Comment by monto — July 21, 2009 @ 9:10 am

3. Hello Monto,

   On Unix/Linux platforms one can retrieve a missing datafile or a redo logfile
   using the file descriptor. Instructions for this can be found in this metalink note:
   444749.1 – Retrieve deleted files on Unix / Linux using File Descriptors

   Happy playing around!

   Comment by Vikram — July 24, 2009 @ 9:47 pm

4. I’d mv’d my redo logs instead of copying them, doing a clone. Obviously the
   clone was OK, my prod was not, there had been no transactions applied so I
   copied them back, obviously they were now out of sync. Used one of the
   scenarios you’ve listed. Fingers crossed. Thanks.

   Comment by James — August 15, 2009 @ 11:00 am

5. [...] we test this solution please refer to this link VN:F [1.9.1_1087]please wait…
   Rating: 0.0/5 (0 votes cast)VN:F [1.9.1_1087]Rating: 0 (from 0 [...]
Ad

More Related Content

What's hot (20)

Database upgradation
Database upgradationDatabase upgradation
Database upgradation
santosh kodandapani
 
Pluggable database tutorial
Pluggable database tutorialPluggable database tutorial
Pluggable database tutorial
Osama Mustafa
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
uzzal basak
 
Les 10 Tune Rman
Les 10 Tune RmanLes 10 Tune Rman
Les 10 Tune Rman
vivaankumar
 
Oracle-L11 using Oracle flashback technology-Mazenet solution
Oracle-L11 using  Oracle flashback technology-Mazenet solutionOracle-L11 using  Oracle flashback technology-Mazenet solution
Oracle-L11 using Oracle flashback technology-Mazenet solution
Mazenetsolution
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
K Kumar Guduru
 
Install Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxInstall Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle Linux
Arun Sharma
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
vivaankumar
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman script
Maris Elsins
 
Configure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncConfigure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change Sync
Arun Sharma
 
Cloning 2
Cloning 2Cloning 2
Cloning 2
Deepti Singh
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
vivaankumar
 
Dba 3+ exp qus
Dba 3+ exp qusDba 3+ exp qus
Dba 3+ exp qus
krreddy21
 
10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper
Yury Velikanov
 
Oracle dba interview questions with answer
Oracle dba interview questions with answerOracle dba interview questions with answer
Oracle dba interview questions with answer
upenpriti
 
Ensuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback FeaturesEnsuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback Features
Pini Dibask
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
Anar Godjaev
 
Upgrade 11.2.0.1 gi crs to 11.2.0.2 in linux
Upgrade 11.2.0.1 gi crs to 11.2.0.2 in linuxUpgrade 11.2.0.1 gi crs to 11.2.0.2 in linux
Upgrade 11.2.0.1 gi crs to 11.2.0.2 in linux
maclean liu
 
Les 01 Arch
Les 01 ArchLes 01 Arch
Les 01 Arch
vivaankumar
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
Manish Mudhliyar
 
Pluggable database tutorial
Pluggable database tutorialPluggable database tutorial
Pluggable database tutorial
Osama Mustafa
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
uzzal basak
 
Les 10 Tune Rman
Les 10 Tune RmanLes 10 Tune Rman
Les 10 Tune Rman
vivaankumar
 
Oracle-L11 using Oracle flashback technology-Mazenet solution
Oracle-L11 using  Oracle flashback technology-Mazenet solutionOracle-L11 using  Oracle flashback technology-Mazenet solution
Oracle-L11 using Oracle flashback technology-Mazenet solution
Mazenetsolution
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
K Kumar Guduru
 
Install Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxInstall Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle Linux
Arun Sharma
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
vivaankumar
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman script
Maris Elsins
 
Configure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncConfigure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change Sync
Arun Sharma
 
Dba 3+ exp qus
Dba 3+ exp qusDba 3+ exp qus
Dba 3+ exp qus
krreddy21
 
10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper
Yury Velikanov
 
Oracle dba interview questions with answer
Oracle dba interview questions with answerOracle dba interview questions with answer
Oracle dba interview questions with answer
upenpriti
 
Ensuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback FeaturesEnsuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback Features
Pini Dibask
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
Anar Godjaev
 
Upgrade 11.2.0.1 gi crs to 11.2.0.2 in linux
Upgrade 11.2.0.1 gi crs to 11.2.0.2 in linuxUpgrade 11.2.0.1 gi crs to 11.2.0.2 in linux
Upgrade 11.2.0.1 gi crs to 11.2.0.2 in linux
maclean liu
 

Similar to Missing redo logs in oracle (20)

还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery
maclean liu
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
Femi Adeyemi
 
Unit Three: Database Recovery Points & Procedures
Unit Three:   Database Recovery Points & ProceduresUnit Three:   Database Recovery Points & Procedures
Unit Three: Database Recovery Points & Procedures
asterbelete021
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
Gustavo Rene Antunez
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
altistory
 
Redo and Rollback
Redo and RollbackRedo and Rollback
Redo and Rollback
Tubaahin10
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
vivaankumar
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
Nabi Abdul
 
Rman 11g new features
Rman 11g new featuresRman 11g new features
Rman 11g new features
Nabi Abdul
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
Femi Adeyemi
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
Nelson Calero
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
oracle documents
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarez
Insight Technology, Inc.
 
Ioug tip book11_gunukula
Ioug tip book11_gunukulaIoug tip book11_gunukula
Ioug tip book11_gunukula
Satishbabu Gunukula
 
Oracle backup
Oracle backupOracle backup
Oracle backup
Ravi Kumar Lanke
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)
than sare
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
nesmaddy
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
Femi Adeyemi
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
Femi Adeyemi
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery
maclean liu
 
Unit Three: Database Recovery Points & Procedures
Unit Three:   Database Recovery Points & ProceduresUnit Three:   Database Recovery Points & Procedures
Unit Three: Database Recovery Points & Procedures
asterbelete021
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
Gustavo Rene Antunez
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
altistory
 
Redo and Rollback
Redo and RollbackRedo and Rollback
Redo and Rollback
Tubaahin10
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
vivaankumar
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
Nabi Abdul
 
Rman 11g new features
Rman 11g new featuresRman 11g new features
Rman 11g new features
Nabi Abdul
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
Nelson Calero
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarez
Insight Technology, Inc.
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)
than sare
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
nesmaddy
 
Ad

Recently uploaded (20)

Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptxUnit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Mayuri Chavan
 
COPA Apprentice exam Questions and answers PDF
COPA Apprentice exam Questions and answers PDFCOPA Apprentice exam Questions and answers PDF
COPA Apprentice exam Questions and answers PDF
SONU HEETSON
 
DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...
DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...
DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...
PoojaSen20
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docxPeer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
19lburrell
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Look Up, Look Down: Spotting Local History Everywhere
Look Up, Look Down: Spotting Local History EverywhereLook Up, Look Down: Spotting Local History Everywhere
Look Up, Look Down: Spotting Local History Everywhere
History of Stoke Newington
 
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptxUnit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Mayuri Chavan
 
COPA Apprentice exam Questions and answers PDF
COPA Apprentice exam Questions and answers PDFCOPA Apprentice exam Questions and answers PDF
COPA Apprentice exam Questions and answers PDF
SONU HEETSON
 
DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...
DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...
DEATH & ITS TYPES AND PHYSIOLOGICAL CHANGES IN BODY AFTER DEATH, PATIENT WILL...
PoojaSen20
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docxPeer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
19lburrell
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Look Up, Look Down: Spotting Local History Everywhere
Look Up, Look Down: Spotting Local History EverywhereLook Up, Look Down: Spotting Local History Everywhere
Look Up, Look Down: Spotting Local History Everywhere
History of Stoke Newington
 
Ad

Missing redo logs in oracle

  • 1. Missing Redo Logs – Scenario Filed under: Oracle,RMAN,Redo Logs — Vikram @ 11:39 pm Tags: Oracle, Redo Logs, RMAN Consider a scenario where you have lost your redo logs on a DB instance. It is possible to recreate them. It is also possible to recover the database with no data loss in certain situations. Let’s jump to action immediately. But first we need to know different ways of redo loss and which category we fit in. A Redo log is a journal of events happening in the DB at any given time. Redo logs are the most crucial part of the database after the controlfile. The documentation defines the redo logs as follows: The online redo log is a set of operating system files that record all changes made to any database block, including data, index, and rollback segments, whether the changes are committed or uncommitted. All changes to Oracle blocks are recorded in the online log. A redo log, at the time of being deleted, will be in one of the below scenarios: 1) The redo log is not CURRENT and archived 2) The redo log is not CURRENT but not archived 3) The redo log is CURRENT (DB was shut down cleanly) 4) The redo log is CURRENT (DB was not shut down cleanly) Identify which scenario fits you. In all the scenarios except (1) we will need to open the database using OPEN RESETLOGS option. You may use the below SQL to find the above details: SQL> select a.group#, b.member, a.archived, a.status 2 from v$log a, v$logfile b where a.group#=b.group#; GROUP# MEMBER ARC STATUS ---------- ---------------------------------------- --- ---------------- 3 D:VIKRAMORADATATESTTESTREDO03.LOG YES INACTIVE 2 D:VIKRAMORADATATESTTESTREDO02.LOG YES UNUSED 1 D:VIKRAMORADATATESTTESTREDO01.LOG NO CURRENT Remember: RESETLOGS is compulsory when there is an incomplete recovery. 1) Redo log is not CURRENT and archived If a redo log file is already archived, its loss can safely be ignored. Since all the changes in the DB are now archived and the online log file is only waiting for its turn to be re- written by LGWR (redo log files are written circularly) the loss of the redo log file doesnt matter much. It may be re-created using the command SQL> STARTUP MOUNT; SQL> ALTER DATABASE CLEAR LOGFILE GROUP <group#>;
  • 2. This will re-create all groups and no transactions are lost. The database can be opened normally after this. 2) Redo log is not CURRENT and not archived If the redo log is lost before it is archived then there are a few transactions in the redo log that are lost too. Since a crash recovery is no more possible, a media recovery is required. The DB needs to be restored from a previous backup and recovered until the last available archive log is applied. The reason I say crash recovery is not possible is that by definition a crash recovery should need only online redo logs to recover the database to a consistent state. If a recovery needs a log file that is not online (like archive logs) then the recovery is no more a crash recovery. It becomes media recovery. In our current case since we are applying the archives and using the previous backup to restore it is not a crash recovery. Also since we cannot recover database completely as some data is lost in the redo log files before being archived, this becomes an incomplete recovery too. The DB needs to be opened up in RESETLOGS mode. The steps to recover are below: -- Restore the DB from previous backup and open the DB in mount state. SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL; -- Apply all the archives available SQL> ALTER DATABASE OPEN RESETLOGS; In a similar scenario an RMAN restore will be as below: RMAN> RESTORE CONTROLFILE FROM '<backup tag location>'; RMAN> ALTER DATABASE MOUNT; RMAN> RESTORE DATABASE; RMAN> RECOVER DATABASE UNTIL TIME "to_date('MAR 05 2009 19:00:00','MON DD YYYY HH24:MI:SS')"; RMAN> ALTER DATABASE OPEN RESETLOGS; The above commands can also be used in a normal recovery scenario from Production to Test with a few modifications. The actual plan of steps that I had followed can be found here. There is a metalink note 1044466.6 that discusses this recovery in greater detail. 3) Redo log is CURRENT (DB was shut down cleanly) If the CURRENT redo log is lost and if the DB is closed consistently, OPEN RESETLOGS can be issued directly without any transaction loss. It is advisable to take a full backup of DB immediately after the STARTUP. 4) Redo log is CURRENT (DB was not shut down cleanly) When a current redo log is lost, the transactions in the log file are also lost before making to archived logs. Since a DB startup can no more perform a crash recovery (since all the now-available online log files are not sufficient to startup the DB in consistent state), an incomplete media recovery is the only option. We will need to restore the DB from a
  • 3. previous backup and restore to the point just before the lost redo log file. The DB will need to be opened in RESETLOGS mode. There is some transaction loss in this scenario. RMAN> RESTORE CONTROLFILE FROM '<backup tag location>'; RMAN> ALTER DATABASE MOUNT; RMAN> RESTORE DATABASE; RMAN> RECOVER DATABASE UNTIL TIME "to_date('MAR 05 2009 19:00:00','MON DD YYYY HH24:MI:SS')"; RMAN> ALTER DATABASE OPEN RESETLOGS; Here we come to an end of all the scenarios in which a redo log can be lost. There is a simpler way to restore the deleted current redo log file on Unix/Linux platforms too. The procedure to do it will be mentioned in my subsequent posts. Meanwhile, I would love to hear from you any suggestions or additions to this post. Thank you. Possibly related posts: (automatically generated) • Archived Redo Log Files Ads by Google 2010 SIEM Magic Quadrant View complimentary copy of Gartner SIEM MQ Report from LogLogic. LogLogic.com/GartnerSIEM Comments (5) 5 Comments » 1. Thanks for the input, I just blew away my redo logs testing backup/restore scenarios and this post helped point me in the right direction!! Comment by Free Games Gallery — April 3, 2009 @ 2:08 pm 2. Great Post!Can you please let us know the simpler method of restoring the deleted logfiles.Keep up the good work:)
  • 4. Comment by monto — July 21, 2009 @ 9:10 am 3. Hello Monto, On Unix/Linux platforms one can retrieve a missing datafile or a redo logfile using the file descriptor. Instructions for this can be found in this metalink note: 444749.1 – Retrieve deleted files on Unix / Linux using File Descriptors Happy playing around! Comment by Vikram — July 24, 2009 @ 9:47 pm 4. I’d mv’d my redo logs instead of copying them, doing a clone. Obviously the clone was OK, my prod was not, there had been no transactions applied so I copied them back, obviously they were now out of sync. Used one of the scenarios you’ve listed. Fingers crossed. Thanks. Comment by James — August 15, 2009 @ 11:00 am 5. [...] we test this solution please refer to this link VN:F [1.9.1_1087]please wait… Rating: 0.0/5 (0 votes cast)VN:F [1.9.1_1087]Rating: 0 (from 0 [...]
  翻译: