9 Replies Latest reply: Jul 16, 2013 11:32 AM by 7fca5d0c-c8ba-4161-90d7-40a1370604bb RSS

    RMAN-03002: failure of recover command

    1024718

      Hi all,

       

      I am testing a new backup and restore mechanism of a 11.2 system in Linux. A third mirror of the disks from the database server has been split and mounted in a media server. An RMAN backup was taken then, on tape, using HP Data Protector. Then, in the media server again, I mounted all the disk groups and removed all the files from ASM via asmcmd. With everything cleared, I proceeded in doing the following:

       

      1. Started up nomount using an old PFILE.

      2. Initiated an RMAN session and SET DBID, connected to the target and the catalog. Restore the SPFILE in a PFILE.

      3. Shutdow and started up nomount with PFILE the newly created file (edited it first to comment out CLUSTER_DATABASE parameter, as the media server is not configured for this).

      4. Restored the contorl file. This was done successfully.

      5. Restored the database. This was done successfully.

      6. Mounted the database and attempted to recover it. I received the following error:

       

      RMAN-00571: ===========================================================

      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

      RMAN-00571: ===========================================================

      RMAN-03002: failure of recover command at 07/12/2013 09:42:24

      RMAN-06094: datafile 1 must be restored

       

      7. I attempted a recover from SQL*Plus; the error message was a little more helpful:

       

      SQL> recover database using backup controlfile;

      ORA-00283: recovery session canceled due to errors

      ORA-01110: data file 1: '+BT1_A_SYSTEM/bt1_a/datafile/system.259.813148661'

      ORA-01157: cannot identify/lock data file 1 - see DBWR trace file

      ORA-01110: data file 1: '+BT1_A_SYSTEM/bt1_a/datafile/system.259.813148661'

       

      8. I checked my source database and the file name is as it appears above. But in the restored system, the file has a different name:

       

      ASMCMD> pwd

      +BT1_A_SYSTEM/BT1_A/DATAFILE

      ASMCMD> ls -l SYSTEM*

      Type      Redund  Striped  Time             Sys  Name

      DATAFILE  UNPROT  COARSE   JUL 11 16:00:00  Y    SYSTEM.257.820514399

       

      9. OK. I presume that this happened because we are using OMF. But, I was expecting RMAN to specify the full file names and thus restore them with their original names. The problem is now that the control file has the original file names, which cannot be found in the media server, where the restore took place. I am wondering if I should MOUNT the database after the control file restore and before I start the database restore, so RMAN might have the opportunity of renaming the file names in the control file.

       

      Has anyone encountered this problem? I would appreciate some help.

       

      Regards,

      Takis.

        • 1. Re: RMAN-03002: failure of recover command
          Mahir M. Quluzade

          6. RMAN> SQL 'Alter database mount';

          7. RMAN> RECOVER DATABASE;

           

          Please paste result here

           

           

          Regards

          Mahir M. Quluzade

          • 2. Re: RMAN-03002: failure of recover command
            Fran

            SHUTDOWN IMMEDIATE;

            STARTUP NOMOUNT;

            set dbid XXXXXX;

            RESTORE CONTROLFILE FROM '/u01/app/oracle/backup_396_1';

            startup mount;  


            run{

            ALLOCATE CHANNEL c1 DEVICE TYPE disk format '/u01/app/oracle/';

            SET NEWNAME FOR DATAFILE '/../../../old_datafile_name' TO '/../../../../../new_datafile_name';

            SET NEWNAME FOR DATAFILE '/../../../old_datafile_name' TO '/../../../../../new_datafile_name';

            *

            *

            *

            SET NEWNAME FOR TEMPFILE'/../../../old_tempfile_name' TO '/../../../../../new_tempfile_name';

            *

            *

            ##<you also can change the name of redo logs, if needed/want>

            RESTORE DATABASE;

               SWITCH DATAFILE ALL;

               RECOVER DATABASE;

               release channel c1;

            }ALTER DATABASE OPEN RESETLOGS;

            • 3. Re: RMAN-03002: failure of recover command
              1024718

              Hi Mahir,

               

              The database is already mounted now. So:

              RMAN> run {
              2> allocate channel 'dev_1' type 'sbt_tape'
              3> parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=BT1_1,OB2BARLIST=HP_TEST_ZDB_BT1_NEW_RMANCAT),SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so';
              4> recover database;
              5> release channel 'dev_1';
              6> }

              released channel: ORA_DISK_1
              allocated channel: dev_1
              channel dev_1: SID=2647 device type=SBT_TAPE
              channel dev_1: Data Protector A.06.20/PHSS_42081/PHSS_42082/DPSOL_00448/DPLNX_

              Starting recover at 12-JUL-13
              released channel: dev_1
              RMAN-00571: ===========================================================
              RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
              RMAN-00571: ===========================================================
              RMAN-03002: failure of recover command at 07/12/2013 12:58:17
              RMAN-06094: datafile 1 must be restored

              RMAN>

               

               

              This is because the file has been restored with a different name. I guess it would be easy to rename a file, but I have hundrends of files in the database.

               

              Regards,

              Takis.

               

              Regards,

              • 4. Re: RMAN-03002: failure of recover command
                Mahir M. Quluzade

                it means your datafiles is not restored true.

                then you  must check datafile name is correct or not ?

                 

                select error from v$datafile_header;

                select name from v$datafile;

                 

                or you can  use

                 

                alter database rename file 'data file name from v$datafile' to 'data file new location ';

                if you want restore  datafile different location, then you must use set newname datafile ;

                 

                run

                {

                SET NEWNAME FOR DATAFILE 1  TO '/new location/system01.dbf';

                ....

                restore database;

                recover database;

                }

                 

                Regards

                Mahir

                • 5. Re: RMAN-03002: failure of recover command
                  1024718

                  This is a good idea. But with 771 data files, I cannot see an easy way to generate such a script. The control file (i.e. v$datafile) has the information from the original database. I do not see an easy way to much the files from ASM, especially almost all of them are from the same tablespace and thus the names start with exactly the same string.

                   

                  I think I shall mount the instance and then restore the entire database again. With the database in mount state, the control file is accessible. I expect thus RMAN to do the renaming for me.

                   

                  Thanks,

                  Takis.

                  • 6. Re: RMAN-03002: failure of recover command
                    Hemant K Chitale

                    >I think I shall mount the instance and then restore the entire database again.

                     

                    So, in your first post :

                    4. Restored the contorl file. This was done successfully.

                    5. Restored the database. This was done successfully.

                    6. Mounted the database and attempted to recover it

                     

                    Was the RESTORE DATABASE done through RMAN without a MOUNT ?

                     

                     

                    Hemant K Chitale

                    • 7. Re: RMAN-03002: failure of recover command
                      1024718

                      That is correct Hemant. I latter realised my mistake.

                       

                      When I mounted the database, the control file was opened. Then I repeated the restore. RMAN, this time was able to access the control file and rename dynamically the files, as they were restored and getting their new names.

                       

                      So, I think, the correct sequence of events may be:

                       

                      1, Check in ASM if the disk groups are mounted (lsdg). If not, mount the disk groups (alter diskgroup <dg_name> mount;).

                      2. Startup nomount (if no PFILE available, create a simple one with only db_name in it).

                      3. From RMAN, set DBID and then connect to target and catalog.

                      4. restore spfile to pfile from autobackup

                      5. restore control file(s) from autobackup

                      6. alter database mount

                      7. restore database

                      8. restore archivelog all

                      9. recover database

                      10. alter database open resetlogs

                       

                      In my case, this worked, by enslarge. RMAN stopped when it run out of archived redo logs.

                       

                      I then attempted, via SQL*Plus:

                       

                      recover database using backup controlfile until cancel

                      When prompted, I typed: CANCEL

                       

                      That was fine, but then, when I attempted:

                       

                      SQL> alter database open resetlogs;

                      alter database open resetlogs

                      *

                      ERROR at line 1:

                      ORA-19809: limit exceeded for recovery files

                      ORA-19804: cannot reclaim 525336576 bytes disk space from 2147483648 limit

                       

                       

                      So, I needed to increase the parameter db_recovery_file_dest_size which I did (in the pfile; luckily I had available space in the disk group). I shut down and started up (mount). Then:

                       

                      SQL> alter database open resetlogs;

                      alter database open resetlogs

                      *

                      ERROR at line 1:

                      ORA-00392: log 24 of thread 2 is being cleared, operation not allowed

                      ORA-00312: online log 24 thread 2: '+BT1_A_RECO'

                       

                       

                      So:

                       

                      SQL> alter database clear unarchived logfile group 24;

                      Database altered.

                      SQL> alter database open resetlogs;

                      Database altered.

                      SQL> select * from dual;

                      D
                      -
                      X

                       

                      Happy days!

                       

                      Regards,

                      Takis.

                      • 8. Re: RMAN-03002: failure of recover command
                        Hemant K Chitale

                        Good listing of the sequence of actions.

                         

                        However, this was unexpected :

                        alter database open resetlogs

                        *

                        ERROR at line 1:

                        ORA-00392: log 24 of thread 2 is being cleared, operation not allowed

                         

                        We presume that it was from the previous OPEN RESETLOGS.

                         

                        Hemant K Chitale

                        • 9. Re: RMAN-03002: failure of recover command
                          7fca5d0c-c8ba-4161-90d7-40a1370604bb

                          Hi,

                           

                          When I am trying to recover the database I am getting the following error

                          ORA-19963: error getting logical block size of file +DATA/testdb12/group_1.263.820493815

                          ORA-15173: entry 'group_1.263.820493815' does not exist in directory 'testdb12'

                           

                          Any idea what is the possible solution to same.