1 2 Previous Next 16 Replies Latest reply: Nov 12, 2009 9:07 AM by tychos RSS

    Restoring backup fails with RMAN-06054

    680825
      I'm trying to restore a 10g database from backup (with catalog) to a new host (disaster recovery) but the recovery fails like this:

      unable to find archive log
      archive log thread=1 sequence=1234
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-03002: failure of recover command at 11/04/2009 16:11:16
      RMAN-06054: media recovery requesting unknown log: thread 1 seq 1234 lowscn 83314466

      These are the backup scripts I use:

      Weekly:

      connect target rman/bla@SRV6
      CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
      CONFIGURE BACKUP OPTIMIZATION ON;
      CONFIGURE DEFAULT DEVICE TYPE TO DISK;
      CONFIGURE CONTROLFILE AUTOBACKUP ON;
      CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/rman/rman/SRV6_DB1/%F.ctrl';
      CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;
      CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
      CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
      CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 5G;
      CONFIGURE MAXSETSIZE TO UNLIMITED;
      CONFIGURE ENCRYPTION FOR DATABASE OFF;
      CONFIGURE ENCRYPTION ALGORITHM 'AES128';
      CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
      CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/rman/rman/SRV6_DB/snapcf_SRV6_DB.f';
      backup database format '/rman/rman/SRV6_DB/ora_df%t_s%s_s%p';
      backup archivelog all delete input format '/rman/rman/SRV6_DB/arch_%d_%u_%s';
      delete noprompt force obsolete;
      report need backup;

      Daily:

      connect target sys/ind@SRV6_DB
      change archivelog all crosscheck;
      backup archivelog all delete input format '/rman/rman/SRV6_DB/arch_%d_%u_%s';
      delete noprompt force obsolete;
      report need backup;
      exit;


      Now I've looked around here ... googled ... metalinked ... but I'm getting lost a little.
      Are the backup scripts not right or am I doing something wrong during restore/recovery?

      I can setup a dummy db for rrestore ... restore spfile from autobackup works fine ... restore controlfile from autobackup works fine too ... restore database also no problem ... but recovery shows above error ...
        • 1. Re: Restoring backup fails with RMAN-06054
          P.Forstmann
          Is the missing archived redo log known to RMAN ?
          list backup of archivelog sequence=1234;
          If it's not known but should be known you may need to catalog it manually.
          If this archived redo log does not exist, you have to ask RMAN to recover to a previous point in time with the SET UNTIL statement or UNTIL clause.
          $ oerr rman 6054
          6054, 1, "media recovery requesting unknown archived log for thread %s with sequence %s and starting SCN of %s"
          // *Cause: Media recovery is requesting a log whose existence is not
          //         recorded in the recovery catalog or target database control file.
          // *Action: If a copy of the log is available, then add it to the recovery
          //          catalog and/or control file via a CATALOG command and then
          //          retry the RECOVER command.  If not, then a point-in-time recovery
          //          up to the missing log is the only alternative and database can
          //          be opened using ALTER DATABASE OPEN RESETLOGS command.
          Edited by: P. Forstmann on 4 nov. 2009 19:00
          • 2. Re: Restoring backup fails with RMAN-06054
            680825
            list backup of archivelog sequence=1234;

            result is empty

            What I can't understand is that I'm using a "recovery" catalog to be able to recover the database but I still have to do it manually. Why am I using a catalog?

            Second question ... I'm doing a disaster recovery (test environment) ... so I have no access to the original database. How to find out until when I can restore/recover the database? And in this situation whatdo you think is easiest ... until time or scn?

            Edited by: Tony K on 05-Nov-2009 23:46
            • 3. Re: Restoring backup fails with RMAN-06054
              P.Forstmann
              The recovery catalog cannot replace all steps needed to recover a database : it make things easier especially when identifying the database identifier (DBID) in case of loss of all control files. If you want to have a recovery tool able to generate rman statements to restore and recover you should consider 11g Data Recovery Advisor http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/high_av.htm#sthref1930.

              In case of disaster recovery, you should identify the last archived redo log that has been successfully backed up by RMAN: after restoring the control files with RMAN, you can try to get it with "LIST BACKUP OF ARCHIVELOG ALL;". Whether you use time or scn or log sequence number does not really matter, what matters is that you get the last archived redo log successfully backed up after the database backup.

              Edited by: P. Forstmann on 6 nov. 2009 09:22
              • 4. Re: Restoring backup fails with RMAN-06054
                tychos
                Hi Tony K,

                Can you check the information on the logseqs using a bigger interval?

                list backup of archivelog from logseq 1230 until logseq 1240;

                Had the source already reached logseq 1234 at the time of backup or was 1233 the highest?

                Regards,

                Tycho
                • 5. Re: Restoring backup fails with RMAN-06054
                  680825
                  The archivelogs it can find are all from 2 days ago or older. That's because a full backup was taken yesterday and no other backup was done after that.


                  Now I've tried something else ...

                  I took a level 0 incremental backup and a level 1 incremental after that. All through the recovery catalog.
                  Trying to do a restore + recovery gives me exactly the same error.

                  Restore works fine ... no errors. Then:

                  RMAN> recover database;

                  Starting recover at 06-NOV-09
                  using channel ORA_DISK_1
                  using channel ORA_DISK_2
                  using channel ORA_DISK_3
                  using channel ORA_DISK_4

                  starting media recovery

                  unable to find archive log
                  archive log thread=1 sequence=8418
                  RMAN-00571: ===========================================================
                  RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                  RMAN-00571: ===========================================================
                  RMAN-03002: failure of recover command at 11/06/2009 10:50:15
                  RMAN-06054: media recovery requesting unknown log: thread 1 seq 8418 lowscn 27845210

                  (this is the real seq no ... i used a dummy one in my opening post)

                  And the available archivelogs:

                  RMAN> list backup of archivelog from logseq 8292 until logseq 8418;


                  List of Backup Sets
                  ===================

                  BS Key Size Device Type Elapsed Time Completion Time

                  1220 249.50K DISK 00:00:01 03-NOV-09
                  BP Key: 1220 Status: AVAILABLE Compressed: YES Tag: TAG20091103T213341
                  Piece Name: /rman/rman/SRV6_DB/arch_SINDDB_66ktf29m_1222

                  List of Archived Logs in backup set 1220
                  Thrd Seq Low SCN Low Time Next SCN Next Time

                  1 8292 27688922 03-NOV-09 27689722 03-NOV-09

                  RMAN>

                  Edited by: Tony K on 06-Nov-2009 02:14

                  Edited by: Tony K on 06-Nov-2009 02:15

                  Edited by: Tony K on 06-Nov-2009 02:17
                  • 6. Re: Restoring backup fails with RMAN-06054
                    P.Forstmann
                    You backup archived redo logs but they are not listed in RMAN backups. Did you transfer all backup sets to new host ?
                    I wonder also if you control file is not old: are your sure you have a recent control file copy in backup sets in new host ?
                    How do you restore control file ?

                    Edited by: P. Forstmann on 6 nov. 2009 11:44
                    • 7. Re: Restoring backup fails with RMAN-06054
                      680825
                      The last restore/recover I did was based on an incremental level 0 backup + level 1 incremental backup.

                      I cataloged all backup pieces generated by these two backups manually and started the restore/recover.

                      I restored the spfile and controlfile from the backuppieces generated by the latest backup. Basically I cataloged all files generated by the backups I took today.

                      I dont think there are any archivelogs available/needed after a backup ... right?

                      Edited by: Tony K on 06-Nov-2009 03:03
                      • 8. Re: Restoring backup fails with RMAN-06054
                        P.Forstmann
                        OK but you still need to backup archived redo logs because they are needed by the recovery steps.
                        • 9. Re: Restoring backup fails with RMAN-06054
                          680825
                          Hmmm ... but I'm testing disaster recovery. The full backup is all I have (not really of course but for the sake of it).
                          Why do I need archivelogs to restore a full backup? I understand I need archivelogs to get my database back to it's last state ... but that's not the case now. I want to restore the last full backup (incremental 0 + 1 in this case).

                          Would it help to do a "restore archivelog all" and then "recover"?

                          Edited by: Tony K on 06-Nov-2009 03:31
                          • 10. Re: Restoring backup fails with RMAN-06054
                            680825
                            I ran "crosscheck archivelog all" and then a "delete expired archivelog all;".

                            Then:

                            RMAN> restore archivelog all;

                            Starting restore at 06-NOV-09
                            using channel ORA_DISK_1
                            using channel ORA_DISK_2
                            using channel ORA_DISK_3
                            using channel ORA_DISK_4

                            RMAN-00571: ===========================================================
                            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                            RMAN-00571: ===========================================================
                            RMAN-03002: failure of restore command at 11/06/2009 12:36:45
                            RMAN-06026: some targets not found - aborting restore
                            RMAN-06025: no backup of log thread 1 seq 8417 lowscn 27836189 found to restore
                            RMAN-06025: no backup of log thread 1 seq 8416 lowscn 27836003 found to restore
                            RMAN-06025: no backup of log thread 1 seq 8415 lowscn 27833161 found to restore
                            -----------
                            RMAN-06025: no backup of log thread 1 seq 8362 lowscn 27764860 found to restore
                            RMAN-06025: no backup of log thread 1 seq 8361 lowscn 27760553 found to restore
                            RMAN-06025: no backup of log thread 1 seq 8360 lowscn 27758093 found to restore
                            MAN-06025: no backup of lo
                            RMAN> recover database;

                            Starting recover at 06-NOV-09
                            using channel ORA_DISK_1
                            using channel ORA_DISK_2
                            using channel ORA_DISK_3
                            using channel ORA_DISK_4

                            starting media recovery

                            unable to find archive log
                            archive log thread=1 sequence=8418
                            RMAN-00571: ===========================================================
                            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                            RMAN-00571: ===========================================================
                            RMAN-03002: failure of recover command at 11/06/2009 12:36:55
                            RMAN-06054: media recovery requesting unknown log: thread 1 seq 8418 lowscn 27845210
                            • 11. Re: Restoring backup fails with RMAN-06054
                              P.Forstmann
                              If you don't specify a UNTIL clause in the RECOVER statement or use a SET UNTIL statement, RMAN tries to recover until the last known SCN.

                              If you don't want to apply archived redo logs, you must specify the NOREDO clause in the RECOVER statement.
                              However I am not sure this can work for a database running in ARCHIVELOG mode because level 0 backup is not consistent.

                              I don't think you need to run CROSSCHECK / DELETE EXPIRED .. /RESTORE ARCHIVELOG ALL
                              • 12. Re: Restoring backup fails with RMAN-06054
                                703442
                                Tony K wrote:
                                Hmmm ... but I'm testing disaster recovery. The full backup is all I have (not really of course but for the sake of it).
                                Why do I need archivelogs to restore a full backup? I understand I need archivelogs to get my database back to it's last state ... but that's not the case now. I want to restore the last full backup (incremental 0 + 1 in this case).

                                Would it help to do a "restore archivelog all" and then "recover"?

                                Edited by: Tony K on 06-Nov-2009 03:31
                                Possibly running into similar misunderstanding when I tried to recover from a database backed up using "backup database" only. You also need the archived redo logs (or backups of them) to restore database to a consistent state.
                                • 13. Re: Restoring backup fails with RMAN-06054
                                  680825
                                  Ok I think I got it.

                                  This thread helped:

                                  RMAN Database Clone with set until time

                                  I used the "LIST BACKUP" command in RMAN to find the latest SEQEUNCE and THREAD. And then used this script to restore and recover the database:

                                  RMAN>run{
                                  SET UNTIL SEQUENCE 8471 THREAD 1;
                                  RESTORE DATABASE;
                                  RECOVER DATABASE;
                                  }

                                  Like you guys said ... !

                                  Still ... it's not clear to me why RMAN doesn't know when to stop recovering if all the info is in the CATALOG ... why doesn't it just recover until the sequence/thread I found in the "LIST BACKUP" info?
                                  • 14. Re: Restoring backup fails with RMAN-06054
                                    tychos
                                    Hi Tony K,

                                    Using RESTORE DATABASE; & RECOVER DATABASE; without any SET UNTIL clause is used when you want to perform complete recovery.
                                    For example you lost all your datafiles but you still have the current controlfile, the redologs, an rman backup of all the dbfs and all archived redologs between the backup and the time time the dbfs went missing.

                                    The database can now be recovered till the last commited transaction using RESTORE DATABASE; & RECOVER DATABASE;

                                    Regards,

                                    Tycho

                                    Edited by: tychos on 10-Nov-2009 00:39
                                    1 2 Previous Next