1 2 3 Previous Next 38 Replies Latest reply: Apr 30, 2013 9:50 AM by John Stegeman RSS

    RESTORE DATABASE OR RECOVER DATABASE

    yxes2013
      Hi All,

      10.2.0.4
      SLES 11

      I want to restore my RMAN backup.

      I run this command:
      RMAN> restore database;
      
      RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
      RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
      ORACLE error from target database:
      ORA-03135: connection lost contact
      
      Starting restore at 30-APR-13
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-00601: fatal error in recovery manager
      RMAN-03004: fatal error during execution of command
      ORA-03114: not connected to ORACLE
      RMAN-03002: failure of restore command at 04/30/2013 16:13:50
      ORA-03114: not connected to ORACLE
      Why does it say not connected to oracle when I am simulating a database crash... meaning no oracle db is up.


      Thanks,

      zxy
        • 1. Re: RESTORE DATABASE OR RECOVER DATABASE
          Fran
          restore controlfile --> database nomount
          restore database --> database mount
          recover database --> database mount
          when all will be restore/Recover --> alter database open resetlogs;

          you can't restore/recover something that is not there. How you can repair a car if you haven't car? (based in sb theory,I hope he is not offended)

          Edited by: Fran on 30-abr-2013 1:51
          • 2. Re: RESTORE DATABASE OR RECOVER DATABASE
            Marcel S.
            Hi,

            do you have mount the database?
            • 3. Re: RESTORE DATABASE OR RECOVER DATABASE
              Mahir M. Quluzade
              yxes2013 wrote:
              Hi All,

              10.2.0.4
              SLES 11

              I want to restore my RMAN backup.

              I run this command:
              RMAN> restore database;
              
              RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
              RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
              ORACLE error from target database:
              ORA-03135: connection lost contact
              
              Starting restore at 30-APR-13
              RMAN-00571: ===========================================================
              RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
              RMAN-00571: ===========================================================
              RMAN-00601: fatal error in recovery manager
              RMAN-03004: fatal error during execution of command
              ORA-03114: not connected to ORACLE
              RMAN-03002: failure of restore command at 04/30/2013 16:13:50
              ORA-03114: not connected to ORACLE
              Why does it say not connected to oracle when I am simulating a database crash... meaning no oracle db is up.


              Thanks,

              zxy
              Hi,

              Did you started database mount mode ?

              Mahir
              • 4. Re: RESTORE DATABASE OR RECOVER DATABASE
                sybrand_b
                To restore a database, the database must be mounted.
                If you have control files, you can mount the database.

                ----------
                Sybrand Bakker
                Senior Oracle DBA
                • 5. Re: RESTORE DATABASE OR RECOVER DATABASE
                  asahide
                  Why does it say not connected to oracle when I am simulating a database crash... meaning no oracle db is up.
                  You have to connect to target database first.
                  <<http://www.orafaq.com/wiki/Oracle_database_Backup_and_Recovery_FAQ#Can_one_restore_RMAN_backups_without_a_CONTROLFILE_and_RECOVERY_CATALOG.3F>>

                  Regards,
                  • 6. Re: RESTORE DATABASE OR RECOVER DATABASE
                    yxes2013
                    I thank you all :)

                    RMAN> startup mount;
                    
                    connected to target database (not started)
                    Oracle instance started
                    RMAN-00571: ===========================================================
                    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                    RMAN-00571: ===========================================================
                    RMAN-03002: failure of startup command at 04/30/2013 17:06:59
                    ORA-00205: error in identifying control file, check alert log for more info
                    
                    RMAN>
                    Still error :( maybe nomount?
                    • 7. Re: RESTORE DATABASE OR RECOVER DATABASE
                      yxes2013
                      RMAN> startup mount using backup controlfile;

                      RMAN-00571: ===========================================================
                      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                      RMAN-00571: ===========================================================
                      RMAN-00558: error encountered while parsing input commands
                      RMAN-01009: syntax error: found "using": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
                      RMAN-01007: at line 1 column 15 file: standard input
                      • 8. Re: RESTORE DATABASE OR RECOVER DATABASE
                        Kh$n
                        ORA-00205: error in identifying control file, check alert log for more info
                        you tried to mount database but database in not actully mounted due to control file problem. 1st you need to recover control file from auto backup than try to mount the database.

                        RESTORE CONTROLFILE FROM AUTOBACKUP command:

                        RMAN> SHUTDOWN IMMEDIATE;
                        RMAN> STARTUP NOMOUNT;
                        RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
                        • 9. Re: RESTORE DATABASE OR RECOVER DATABASE
                          634559
                          Step 1: RMAN> Connect target /

                          Step 2: Startup nomount pfile='<pfile name>'

                          Step 3: restore control file from backup

                          Step 4: alter database mount

                          Step 5: restore database

                          Step 6: recover database

                          Step 7: open database resetlogs;

                          Thanks,
                          • 10. Re: RESTORE DATABASE OR RECOVER DATABASE
                            yxes2013
                            How can it be lost when i did not touch anything from my current database? I only remove dbf under the oradata folders? other files are still intact :(
                            • 11. Re: RESTORE DATABASE OR RECOVER DATABASE
                              yxes2013
                              I thank you all :)

                              Which is correct?
                              Step 3: restore control file from backup
                              or
                              restore control file from autobackup
                              • 12. Re: RESTORE DATABASE OR RECOVER DATABASE
                                yxes2013
                                When do I use this program? :(
                                Now, from SQL*Plus, run the following PL/SQL block to restore the file:
                                DECLARE
                                  v_devtype   VARCHAR2(100);
                                  v_done      BOOLEAN;
                                  v_maxPieces NUMBER;
                                
                                  TYPE t_pieceName IS TABLE OF varchar2(255) INDEX BY binary_integer;
                                  v_pieceName t_pieceName;
                                BEGIN
                                  -- Define the backup pieces... (names from the RMAN Log file)
                                  v_pieceName(1) :=
                                     '/flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_ncsnf_TAG20040820T153256_0lczfrx8_.bkp';
                                  v_pieceName(2) :=
                                     '/flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_nnndf_TAG20040820T153256_0lczd9tf_.bkp';
                                  v_maxPieces    := 2;
                                
                                  -- Allocate a channel... (Use type=>null for DISK, type=>'sbt_tape' for TAPE)
                                  v_devtype := DBMS_BACKUP_RESTORE.deviceAllocate(type=>NULL, ident=>'d1');
                                
                                  -- Restore the first Control File...
                                  DBMS_BACKUP_RESTORE.restoreSetDataFile;
                                
                                  -- CFNAME mist be the exact path and filename of a controlfile taht was backed-up
                                  DBMS_BACKUP_RESTORE.restoreControlFileTo(cfname=>'/app/oracle/oradata/orcl/control01.ctl');
                                
                                  dbms_output.put_line('Start restoring '||v_maxPieces||' pieces.');
                                  FOR i IN 1..v_maxPieces LOOP
                                    dbms_output.put_line('Restoring from piece '||v_pieceName(i));
                                    DBMS_BACKUP_RESTORE.restoreBackupPiece(handle=>v_pieceName(i), done=>v_done, params=>null);
                                    exit when v_done;
                                  END LOOP;
                                
                                  -- Deallocate the channel...
                                  DBMS_BACKUP_RESTORE.deviceDeAllocate('d1');
                                EXCEPTION
                                   WHEN OTHERS THEN
                                      DBMS_BACKUP_RESTORE.deviceDeAllocate;
                                      RAISE;
                                END;
                                /
                                Thanks....
                                • 13. Re: RESTORE DATABASE OR RECOVER DATABASE
                                  Fran
                                  depend what controlfile do you want to use. You must think that every change in database are stored in "autobackup", and "backup" probably will be a bit older.
                                  • 14. Re: RESTORE DATABASE OR RECOVER DATABASE
                                    Mahir M. Quluzade
                                    yxes2013 wrote:
                                    I thank you all :)

                                    Which is correct?
                                    Step 3: restore control file from backup
                                    May be this file is old backup of control file

                                    >
                                    or
                                    restore control file from autobackup
                                    After this command RMAN choose latest control file backup.
                                    1 2 3 Previous Next