1 2 Previous Next 20 Replies Latest reply: Nov 11, 2013 8:29 PM by petra-K RSS

    create standby database using restore backup

      Hi,

       

      I am creating a standby database 11g using  manual process of restoring a backup , but to no avail. I can not even restore the backup successfully.

       

      This is the steps I followed (courtesy of ORACLE-BASE) ORACLE-BASE - Data Guard Physical Standby Setup in Oracle Database 11g Release 2

       

       

      I am confused about these steps:

       

      Copy the files from the primary to the standby server.

      Copy Standby controlfile to all locations.

      $ scp oracle@ol5-112-dga1:/tmp/db11g_stby.ctl /u01/app/oracle/oradata/DB11G/control01.ctl

      $ cp /u01/app/oracle/oradata/DB11G/control01.ctl /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl

       

      My question is, for the 2nd copy, do I need to shutdown the primary db? since control01.ctl is being updated all the time?

       

      Can I not used the standby ctl (db11g_stbg.ctl) and copy it to /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl instead?

       

      Your assistance is highly appreciated.

        • 1. Re: create standby database using restore backup
          Mahir M. Quluzade

          f55237a7-2c38-4db3-a7a3-1d77256f0730 wrote:

           

          Hi,

           

          I am creating a standby database 11g using  manual process of restoring a backup , but to no avail. I can not even restore the backup successfully.

           

          This is the steps I followed (courtesy of ORACLE-BASE) ORACLE-BASE - Data Guard Physical Standby Setup in Oracle Database 11g Release 2

           

           

          I am confused about these steps:

           

          Copy the files from the primary to the standby server.

          Copy Standby controlfile to all locations.

          $ scp oracle@ol5-112-dga1:/tmp/db11g_stby.ctl /u01/app/oracle/oradata/DB11G/control01.ctl

          $ cp /u01/app/oracle/oradata/DB11G/control01.ctl /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl

           

          My question is, for the 2nd copy, do I need to shutdown the primary db? since control01.ctl is being updated all the time?

           

          Can I not used the standby ctl (db11g_stbg.ctl) and copy it to /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl instead?

           

          Your assistance is highly appreciated.

           

          Hi,

           

          You are created standby  control file on primary and copied to standby  side:

          $ scp oracle@ol5-112-dga1:/tmp/db11g_stby.ctl /u01/app/oracle/oradata/DB11G/control01.ctl

           

          And now, in paramter files, you have CONTROL_FILES parameter as below :

          control_files='/u01/app/oracle/oradata/DB11G/control01.ctl', '/u01/app/oracle/fast_recovery_area/DB11G/control02.ctl'

          it means you must copy controlfile IN standby side to second control file. Control  files must be same.


          $ cp /u01/app/oracle/oradata/DB11G/control01.ctl /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl

           

          My question is, for the 2nd copy, do I need to shutdown the primary db? since control01.ctl is being updated all the time?

           

          You not need shutdown priamry database, becuase you  copied standby control file to standby side, and all operations goin in standby side.

           

          Can I not used the standby ctl (db11g_stbg.ctl) and copy it to /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl instead?

          Yes, you can use (db11g_stbg.ctl)  standby controlfile

           

           

          Regard

          Mahir M. Quluzade

           


          • 2. Re: create standby database using restore backup
            saurabh

            copy the same control file created on the primary database to the standby database controlfiel location.

             

            Can I not used the standby ctl (db11g_stbg.ctl) and copy it to /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl instead?

            yes you can do this.

             

             


            • 3. Re: create standby database using restore backup
              Anar Godjaev

              HI,

              My question is, for the 2nd copy, do I need to shutdown the primary db? since control01.ctl is being updated all the time?  (Q1)

               

              Can I not used the standby ctl (db11g_stbg.ctl) and copy it to /u01/app/oracle/fast_recovery_area/DB11G/control02.ctl instead? (Q2)

               

               

              (A1) Please copy the same controlfile  on primary database to the standby database controlfile location

              (A2) YEs it is possible

               

              Thank you

              • 4. Re: create standby database using restore backup

                Thanks all,

                 

                Supposing I have created in the Primary db > ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl';

                 

                Then I backup my primary db using > RMAN backup database;

                 

                Then I copied the 2 files to the recovery server2.

                 

                Then I run the following restore process: ( assuming directories have been in place)

                 

                RMAN> startup nomount;

                RMAN> restore control file from '/tmp/db11g_stby.ctl';

                RMAN> alter database mount;

                RMAN> restore database;

                RMAN> recover database;

                RMAN> alter database open resetlogs;

                 

                 

                My question is, is the above correct? That I can use the stby ctl to restore the db? Or my concern is it is not of the same supported format?

                • 5. Re: create standby database using restore backup

                  What is the difference of the 2 files content?

                   

                  rman> backup current controlfile;

                   

                  vs.

                   

                  ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl';

                  • 6. Re: create standby database using restore backup
                    saurabh

                    1.your second step is not correct.

                     

                    As you have taken backup of controlfile through cmd prompt you cannot restore it using rman promt

                     

                    you need to just copy the file to its appropriate location and name as in parameter file.

                     

                    2. recover database will work if you have taken backup of archive log or you need to copy archive log to the location specified in the parameter file.

                    • 7. Re: create standby database using restore backup
                      Mahir M. Quluzade

                      What is the difference of the 2 files content?

                       

                      1.

                      rman> backup current controlfile;

                      It is take controlfile backup.

                      If you  want backup controlfile for standby,  then try following script.

                       

                      RMAN> backup current controlfile for standby format '/tmp/standby.bak'

                       

                      And if you want create standby you  must restore this backup file as below:

                       

                      RMAN> restore standby controlfile from '/tmp/standby.bak'

                       

                       

                      2.

                      ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl';

                      This command is create only a standby control file.

                      You can use this file as standby  controlfile, not need any restore operation.

                       

                      Regards

                      Mahir M. Quluzade

                      • 8. Re: create standby database using restore backup
                        saurabh

                        rman> backup current controlfile;

                         

                        This cmd takes the backup of the controlfile which you can restore only using rman.

                         

                        ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl';

                         

                        This cmd is used to create controlfile for creation of standy database.

                        • 9. Re: create standby database using restore backup

                          Thanks all saur, mahir, anar.

                           

                          So it is okay just to copy my PROD control01.ctl  even if the database is active ( i can see that the timestamp is constantly changing for control files, so it gets updated

                          all the time). Will my copy not corrupted? If I copy it to recovery site and use it to recover the database backup?

                          • 10. Re: create standby database using restore backup
                            saurabh

                            you donot need to copy the production active controlfile.

                             

                            you need to create the controlfile using ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl';

                             

                            and the controlfile created using above controlfile need to be copied to the standby database.

                            • 11. Re: create standby database using restore backup
                              Anar Godjaev

                              HI ,

                               

                              Please you don't copy the PROD (LIVE) database active controlfile.

                              Need to create controlfile using alter database create standby controlfile as '/location/db11g_stby.ctl';     -------- Copy controlfile to the standby database

                               

                              Thank you


                              • 12. Re: create standby database using restore backup

                                Thanks saur,anar,mahir

                                 

                                If I have a database backup last week, and I backup my controlfile now. I still can restore my backup last week using the latest control file?

                                • 13. Re: create standby database using restore backup
                                  saurabh

                                  yes you can do this.

                                  • 14. Re: create standby database using restore backup
                                    Anar Godjaev

                                    yes it is possible . You can even go back later. You can do this.

                                    1 2 Previous Next