14 Replies Latest reply: Nov 16, 2009 12:15 AM by Azar RSS

    rman restore controlfile error

    Azar
      hi,

      For testing purpose,

      I created rman catalog and configure controlfile autobackup.after that i took backup using follow command.

      sql>run

      2 {
      3 allocate channel c1 type disk format 'd:\oracle\rman\backup\%s_%p_%t';
      4 backup database;
      5 backup archivelog all;
      6 release channel c1;
      7 }
      the data backuped. after backup i down the database and delete controlfile and tablespace and redolog file.
      after that i plan to restore the control file.so that i using follow command and i get a error


      C:\Documents and Settings\SUBAIH>set oracle_sid=orcl

      C:\Documents and Settings\SUBAIH>rman target sys/sys

      Recovery Manager: Release 10.2.0.1.0 - Production on Mon Nov 16 13:53:54 2009

      Copyright (c) 1982, 2005, Oracle. All rights reserved.

      connected to target database: orcl (not mounted)

      RMAN> restore controlfile from autobackup;

      Starting restore at 16-NOV-09
      using target database control file instead of recovery catalog
      allocated channel: ORA_DISK_1
      channel ORA_DISK_1: sid=159 devtype=DISK

      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-03002: failure of restore command at 11/16/2009 13:54:12
      RMAN-06495: must explicitly specify DBID with SET DBID command

      RMAN>

      How do i set the DBID? and when i take backup ,the above path ('d:\oracle\rman\archive\") having three files are located.which one i choose? or anyother way to restore the controlfile...


      Regards

      Azar
      DBA
        • 1. Re: rman restore controlfile error
          asifkabirdba
          If you want to restore
          the control file from autobackup, the database must be in a NOMOUNT state. You must first set the DBID for your database,
          and then use the RESTORE CONTROLFILE FROM AUTOBACKUP command:

          RMAN> SET DBID 320066378;
          RMAN> RUN {
          SET CONTROLFILE AUTOBACKUP FORMAT
          FOR DEVICE TYPE DISK TO 'autobackup_format';
          RESTORE CONTROLFILE FROM AUTOBACKUP;
          }


          RMAN uses the autobackup format and DBID to determine where to hunt for the control file autobackup. If one is found
          ,RMAN restores the control file from that backup to all of the control file locations listed in the CONTROL_FILES
          initialization parameter.

          Hope this will help.

          Regards
          Asif Kabir
          • 2. Re: rman restore controlfile error
            584609
            select DBID from v$database;
            • 3. Re: rman restore controlfile error
              Azar
              HI,

              connected to target database (not started)

              RMAN> set dbid=702991680 (* three files are located in my backup path like '1_1_702991680,1_1_702991808,1_1_702991865' which one i choose')

              executing command: SET DBID

              RMAN> startup nomount

              Oracle instance started

              Total System Global Area 247463936 bytes

              Fixed Size 1248332 bytes
              Variable Size 100664244 bytes
              Database Buffers 138412032 bytes
              Redo Buffers 7139328 bytes

              RMAN> run
              2> {
              3> set controlfile autobackup format for device type
              4> disk to 'd:\oracle\rman\backup\%F';
              5> restore controlfile from autobackup;
              6> }

              executing command: SET CONTROLFILE AUTOBACKUP FORMAT

              Starting restore at 16-NOV-09
              allocated channel: ORA_DISK_1
              channel ORA_DISK_1: sid=157 devtype=DISK

              channel ORA_DISK_1: looking for autobackup on day: 20091116
              channel ORA_DISK_1: looking for autobackup on day: 20091115
              channel ORA_DISK_1: looking for autobackup on day: 20091114
              channel ORA_DISK_1: looking for autobackup on day: 20091113
              channel ORA_DISK_1: looking for autobackup on day: 20091112
              channel ORA_DISK_1: looking for autobackup on day: 20091111
              channel ORA_DISK_1: looking for autobackup on day: 20091110
              channel ORA_DISK_1: no autobackup in 7 days found
              RMAN-00571: ===========================================================
              RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
              RMAN-00571: ===========================================================
              RMAN-03002: failure of restore command at 11/16/2009 14:10:42
              RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

              Regards

              Azar
              DBA
              • 4. Re: rman restore controlfile error
                asifkabirdba
                Restoring a Control File When Using a Recovery Catalog

                Restoring a lost control file from autobackup is easier when using a recovery catalog than when using only the control file to store the RMAN repository. The recovery catalog contains a complete record of your backups, including backups of the control file. Therefore, you do not have to specify your DBID or control file autobackup format.

                To restore the control file, connect RMAN to the target database and the recovery catalog, and bring the database to NOMOUNT state. Then issue the RESTORE CONTROLFILE command with no parameters, as in this example:

                % rman TARGET rman/rman CATALOG catdb/catdb
                RMAN> RESTORE CONTROLFILE;



                Regards
                Asif Kabir

                Edited by: asifkabirdba on Nov 15, 2009 5:26 PM
                • 5. Re: rman restore controlfile error
                  Azar
                  asifkabirdba wrote:
                  Just run the command

                  restore controlfile from autobackup;


                  Regards
                  Asif Kabir
                  No Mr.Asif

                  if i just run the above command, it will ask set dbid. if i set dbid (i took from that file name), it will error occur the previous post error showing'

                  Regards

                  Azar
                  DBA
                  • 6. Re: rman restore controlfile error
                    Azar
                    C:\Documents and Settings\azar>rman target sys/sys catalog rman/rman

                    Recovery Manager: Release 10.2.0.1.0 - Production on Mon Nov 16 14:45:44 2009

                    Copyright (c) 1982, 2005, Oracle. All rights reserved.

                    connected to target database: orcl (not mounted)
                    RMAN-00571: ===========================================================
                    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                    RMAN-00571: ===========================================================
                    RMAN-00554: initialization of internal recovery manager package failed
                    RMAN-04004: error from recovery catalog database: ORA-01033: ORACLE initializati
                    on or shutdown in progress

                    C:\Documents and Settings\azar>

                    Edited by: Azar on Nov 15, 2009 3:47 AM
                    • 7. Re: rman restore controlfile error
                      asifkabirdba
                      Your catalog database did not shutdown properly. Kill the smon/pmon process which abort the database instance. Then startup the catalog database and try again.


                      Regards
                      Asif Kabir
                      • 8. Re: rman restore controlfile error
                        Azar
                        asifkabirdba wrote:
                        Your catalog database did not shutdown properly. Kill the smon/pmon process which abort the database instance. Then startup the catalog database and try again.


                        Regards
                        Asif Kabir
                        I killed process and starting again same previous post error occur
                        • 9. Re: rman restore controlfile error
                          asifkabirdba
                          Confirm that you have connected both the target database and recovery catalog database then the mentioned process will work.

                          Regards
                          Asif Kabir
                          • 10. Re: rman restore controlfile error
                            164995
                            well if you have a control file only then it will be restored.

                            sql>run

                            2 {
                            3 allocate channel c1 type disk format 'd:\oracle\rman\backup\%s_%p_%t';
                            4 backup database;
                            5 backup archivelog all;
                            6 release channel c1;
                            7 }

                            Please ensure that you have the controlfile's in the backup.

                            RMAN> list backup of controlfile;

                            Also you need to set autobackup on in order to have a controlfile backup.

                            Start DB in mount state , set the DBID and then get the controlfile from tape.
                            • 11. Re: rman restore controlfile error
                              Paul M.
                              when i take backup ,the above path ('d:\oracle\rman\archive\") having three files are located
                              When you backup the database, the controlfile is automatically backed up. One of those three files is the controlfile backup, it should be the second one in order of date. With the instance in NOMOUNT state you can do
                              RMAN> restore controlfile from '<path of controlfile backup>';
                              • 12. Re: rman restore controlfile error
                                rgoold
                                I think you've got the wrong DBID, according to your backup script 702991680 is a timestamp (%t) not the DBID.

                                If you don't have a log of your backup, which would have shown the DBID, then look for the controlfile autobackup files, which might be in $ORACLE_HOME/dbs if they are not in your backup directory.

                                Such files usually have this format: c-1279838146-20091109-00, in this example 1279838146 is the DBID.
                                • 13. Re: rman restore controlfile error
                                  Azar
                                  Thanks all..restored controlfile and datafile .now database is opened.



                                  Regards

                                  Azar
                                  DBA
                                  • 14. Re: rman restore controlfile error
                                    Azar
                                    Hi

                                    i did it follow way..

                                    C:\Documents and Settings\AZAR>rman target sys/sys

                                    Recovery Manager: Release 10.2.0.1.0 - Production on Tue Nov 17 08:56:12 2009

                                    Copyright (c) 1982, 2005, Oracle. All rights reserved.

                                    connected to target database (not started)

                                    RMAN> set dbid=1223352922

                                    executing command: SET DBID

                                    RMAN> startup nomount force

                                    Oracle instance started

                                    Total System Global Area 247463936 bytes

                                    Fixed Size 1248332 bytes
                                    Variable Size 100664244 bytes
                                    Database Buffers 138412032 bytes
                                    Redo Buffers 7139328 bytes

                                    RMAN> list backup of controlfile;

                                    using target database control file instead of recovery catalog

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

                                    BS Key Type LV Size Device Type Elapsed Time Completion Time
                                    ------- ---- -- ---------- ----------- ------------ ---------------
                                    4 Full 7.11M DISK 00:00:03 15-NOV-09
                                    BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091115T113128
                                    Piece Name: D:\ORACLE\PRODUCT\10.2.0\DB_2\DATABASE\C-1223352922-20091115
                                    -00
                                    Control File Included: Ckp SCN: 1843561 Ckp time: 15-NOV-09

                                    RMAN> restore controlfile from 'D:\oracle\product\10.2.0\db_2\database\C-1223352
                                    922-20091115-00';

                                    Starting restore at 17-NOV-09
                                    using target database control file instead of recovery catalog
                                    allocated channel: ORA_DISK_1
                                    channel ORA_DISK_1: sid=157 devtype=DISK

                                    channel ORA_DISK_1: restoring control file
                                    channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
                                    output filename=D:\ORACLE\PRODUCT\CONTROL04.CTL
                                    Finished restore at 17-NOV-09

                                    RMAN> alter database mount;

                                    database mounted
                                    released channel: ORA_DISK_1

                                    RMAN> restore database;

                                    Starting restore at 17-NOV-09
                                    allocated channel: ORA_DISK_1
                                    channel ORA_DISK_1: sid=156 devtype=DISK

                                    channel ORA_DISK_1: starting datafile backupset restore
                                    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
                                    restoring datafile 00001 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
                                    restoring datafile 00002 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
                                    restoring datafile 00003 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
                                    restoring datafile 00004 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
                                    restoring datafile 00005 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
                                    restoring datafile 00006 to D:\ORACLE\DMV.DBF
                                    restoring datafile 00007 to D:\ORACLE\RMAN\RMAN01.DBF
                                    channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\BACKUP\1_1_70299168
                                    0
                                    channel ORA_DISK_1: restored backup piece 1
                                    piece handle=D:\ORACLE\RMAN\BACKUP\1_1_702991680 tag=TAG20091115T112800
                                    channel ORA_DISK_1: restore complete, elapsed time: 00:02:15
                                    Finished restore at 17-NOV-09



                                    RMAN> alter database open resetlogs;

                                    database opened.

                                    *May be this is usefull for other guys.so that i posted what i did.

                                    Regards

                                    Azar
                                    DBA