1 2 Previous Next 15 Replies Latest reply: Sep 18, 2013 4:24 AM by yxes2013 RSS

    Managing Physical Standby

    yxes2013

      Hi all,

       

      Aix 6.1

       

      Today, I am learning dataguard 11.2.0.1.

       

      The docs said:


      A. Monitoring Standby DB

       

      • Application of redo logs may be monitored by issuing the SQL command:

      SQL> select client_dbid, process, sequence#, status from v$managed_standby;

      • In the primary database, the sequence# with the status “WRITING” would refer to the current redo log sequence#
      • In the standby database, if the status of the process MRPO is “APPLYING LOG” and the status of the process LGWR is “IDLE”, then application of redo logs is up to date


      I see that that MRPO at standby is "WAIT_FOR_GAP". How do I resolve this gap please.


      Thanks a lot,

      zxy

        • 1. Re: Managing Physical Standby
          sb92075

          ignore what you see

          • 2. Re: Managing Physical Standby
            yxes2013

            You are so cruel

             

            I found this link > WAIT_FOR_GAP status on standby | Steve Harville's Blog

             

            But I am afraid I might mess the DR. Is this safe to implement? Please helpppp

             

             

            Thanks,

            • 3. Re: Managing Physical Standby
              yxes2013

              1. SELECT PROCESS, CLIENT_PROCESS, SEQUENCE#, STATUS FROM V$MANAGED_STANDBY;

              2. Find out the extent of the gap:

               

                1  SELECT high.thread#, "LowGap#", "HighGap#"

                2  FROM

                3       (

                4       SELECT thread#, MIN(sequence#)-1 "HighGap#"

                5       FROM

                6       (

                7           SELECT a.thread#, a.sequence#

                8           FROM

                9           (

              10               SELECT *

              11               FROM v$archived_log

              12           ) a,

              13           (

              14               SELECT thread#, MAX(next_change#)gap1

              15               FROM v$log_history

              16               GROUP BY thread#

              17           ) b

              18           WHERE a.thread# = b.thread#

              19           AND a.next_change# > gap1

              20       )

              21       GROUP BY thread#

              22   ) high,

              23   (

              24       SELECT thread#, MIN(sequence#) "LowGap#"

              25       FROM

              26       (

              27           SELECT thread#, sequence#

              28           FROM v$log_history, v$datafile

              29           WHERE checkpoint_change# <= next_change#

              30           AND checkpoint_change# >= first_change#

              31       )

              32       GROUP BY thread#

              33   ) low

              34*  WHERE low.thread# = high.thread#

               

              3. RMAN>  restore archivelog from sequence 130106 until sequence 130153;

               

              Where will I run all these 3 process? Is it all in DR or Prod soruce?

               

              Thanks

              • 4. Re: Managing Physical Standby
                saurabh

                select client_dbid, process, sequence#, status from v$managed_standby;

                 

                It will display for which archive gap sequence DR  is waiting. check the same on the standby archive log location.

                 

                Then copy the same archive from production to DR apply manually using recover standby database. Then once it is completed then enable automatic recovery.

                • 5. Re: Managing Physical Standby
                  yxes2013

                  Thanks Saur,

                   

                  But it displays lots of it like 100 missing logs. And they are already deleted from retention file.

                  It is possible to recreate these logs using:

                   

                  RMAN>  restore archivelog from sequence 130106 until sequence 130206;


                  I understand if you run this at primary, it will recreate all the missing or deleted logs? Or my understanding is wrong


                  Thanks


                  • 6. Re: Managing Physical Standby
                    yxes2013

                    Or do you suggest performing an encremental backup and recover it to the physical standby?

                     

                    Or which one is easier, recover it from full RMAN backup?

                     

                    Your advise is highly appreciated. Thanks.

                    • 7. Re: Managing Physical Standby
                      mbc

                      You are saying missed morethan 100 archivelogs and those archive logs has been deleted. So I would suggested to go with incremental backup of production database and recover standby DB.


                      Please follow below steps which will help you:

                      Step1: Take the incremental backup from the SCN number (37127630 - Find current SCN in DR side) in Production database

                       

                      RMAN> run {
                      allocate channel c1 type disk format 'D:\backup\Incremetal_SCN_17SEP2013\%U.rmb';
                      backup incremental from scn 37127630 database;
                      }


                      Step2: Take the standby control file backup in production database.

                      RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT 'D:\backup\Incremetal_SCN_17SEP2013\standby_Prod_17SEP.bck';


                      Step3: Move backup's to standby database and shutdown the standby database.

                      SQL> alter database recover managed standby database cancel;
                      SQL> shutdown

                      Step4: open standby database in nomount state and restore the backup control file.

                      SQL> startup nomount;
                      RMAN> RESTORE STANDBY CONTROLFILE FROM 'D:\backup\Incremetal_SCN_17SEP2013\standby_Prod_17SEP.bck';


                      Step5: Then mount the standby database and recover the DR database.

                      SQL> alter database mount standby database;
                      RMAN> catalog start with 'D:\backup\Incremetal_SCN_17SEP2013\';
                      RMAN> recover database;


                      Step6: Then bounce the database and try to put in recovery mode

                      SQL> shutdown
                      SQL> startup nomount;
                      SQL> alter database mount standby database;
                      SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

                       

                      Hope this help.

                       

                      Best Regards,

                      mbc.

                      • 8. Re: Managing Physical Standby
                        saurabh

                        Your understanding is wrong

                         

                        RMAN>  restore archivelog from sequence 130106 until sequence 130206;

                         

                        is use to restore the archive log sequence given in the cmd from the backup piece.

                         

                        As you have lost the archive log from the source machine and you don't the the backup of it

                         

                        then you can do is take the current scn from the standby and using the same, take the incremental backup from the production database and apply it on the standby database.

                         

                        following link will help you with how to apply incremental backup.

                         

                        http://www.stanford.edu/dept/itss/docs/oracle/10gR2/backup.102/b14191/rcmdupdb008.htm

                        • 9. Re: Managing Physical Standby
                          yxes2013

                          Thanks Saur,

                           

                          Steve's instruction is confusing

                          He said:

                          Recover the logs in Production:

                           

                          RMAN>  restore archivelog from sequence 130106 until sequence 130153;

                           

                          Which means that command will be run in production or primary.

                           

                          My boss is suggesting to use the full rman backup to recover it.

                          Is it possible also to use the RMAN full backup and recover it on the physical standby? Or it is not advisable?

                           

                          I cant understand why this forum is intermittent in logging my post as question , I thought it was a dafult to log it as question, But now it is not again and I can not give points here now?

                          Where is Nico?

                           

                          Thanks a lot

                          • 10. Re: Managing Physical Standby
                            saurabh

                            restore cmd is to be used on th standby to restore the archive logs from the backup.

                             

                            According to my understanding, Full rman backup is not  not use to recover the standby database.

                             

                            so you need to take a incremental backup of your production database.

                            • 11. Re: Managing Physical Standby
                              mbc

                              Either you go with full DB backup (it depends on your database size) or Incremental DB backup to synch your standby database with production database.

                              Suggested to go with incremental database restoration way. Just follow the steps I posted earlier.

                               

                              Best Regards,

                              mbc.

                              • 12. Re: Managing Physical Standby
                                yxes2013

                                I thank you all,

                                 

                                I do not have test db to practise this first before I do it on prod to make me confident.

                                 

                                Can you help me how to setup a DG physical standby on my linux VMbox?

                                • 13. Re: Managing Physical Standby
                                  mbc

                                  Follow below link to setup DG physical standby on VM,,

                                   

                                  http://www.askrenzo.com/oracle/DataGuard_11g/creating_a_data_guard.html

                                   

                                  Thanks,,

                                  1 2 Previous Next