7 Replies Latest reply: Apr 25, 2014 9:11 AM by Shivananda Rao RSS

    On standby,backup archivelog not yet applied with rman

    1001135

      Hello every DBA,

      Between standby and primary database, we have a volontary lag of 4 hours.

      We need to backup frequently archivelogs from standby, so my question :

      Is it possible to take a rman backup on standby, of unapplied archivelogs. ( just arrived not yet applied because of volontary lag of 4 hours).

       

      Thank you in advance.

        • 1. Re: On standby,backup archivelog not yet applied with rman
          Top.Gun

          You can backup unapplied logs, but if you then delete the archivelogs before they are applied, then the standby will not sync with the primary.

          • 2. Re: On standby,backup archivelog not yet applied with rman
            mseberg

            Hello;

             

            This is worth a look:

             

            Using RMAN Effectively In A Dataguard Environment. (Doc ID 848716.1)

             

            Best Regards

             

            mseberg

            • 3. Re: On standby,backup archivelog not yet applied with rman
              1001135

              Hello, Thanks a lot for your answers.

              I read a mentionned document (Doc ID 848716.1), but I didn't found an answer of my question.

               

              So, which tman command could we use on standby database to backup unapplied archivelogs ?

               

              Thank you in advance.

              • 4. Re: On standby,backup archivelog not yet applied with rman
                mseberg

                Hello again;

                 

                Is it possible you are trying to solve a problem you don't have? If the archive has not been applied you should still have a copy on the Primary side right? If you ran into an issue you could alway use RMAN to roll forward your Standby right?

                 

                Example

                 

                http://www.oracle-ckpt.com/?s=roll+forward&op.x=0&op.y=0

                 

                I don't want to second guess you, but I'm also a firm believer in not making things more complex than they have to be.

                 

                Also if you have FRA setup won't any RMAN backup include the Archive applied or not. I don't believe there's an exact command for just these logs.

                 

                The archived log deletion policy is your friend.

                 

                What exact problem are you trying to solve?

                 

                Best Regards

                 

                mseberg

                • 5. Re: On standby,backup archivelog not yet applied with rman
                  1774531

                  Hello mseberg,

                  Thank your for your answer.

                         Connect to standby databse

                         RMAN> backup archivelog all;
                  If I understand well, if I execute this command on standby database, I will backup applied and unapplied archivelogs ?

                   

                  In other words, my problem is to understand "backup archivelog all" on standby database. This command takes on account unapplied archivelogs or not.

                   

                   

                   

                  Thank you in advance.

                  • 6. Re: On standby,backup archivelog not yet applied with rman
                    mseberg

                    I can test.

                     

                    Set Delay

                     

                    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

                     

                    Database altered.

                     

                     

                    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DELAY 30 disconnect;

                     

                    Database altered.

                     

                    SQL>

                     

                     

                    Force log Switch

                     

                     

                     

                    SQL> alter system switch logfile;

                     

                    System altered.

                     

                    SQL> alter system switch logfile;

                     

                    System altered.

                     

                    SQL>

                     

                     

                     

                    Check Applied

                     

                     

                    SQL> SET PAGESIZE 140

                    SQL> COL DB_NAME FORMAT A10

                    SQL> COL HOSTNAME FORMAT A14

                    SQL> COL LOG_ARCHIVED FORMAT 999999

                    SQL> COL LOG_APPLIED FORMAT 999999

                    SQL> COL LOG_GAP FORMAT 9999

                    SQL> COL APPLIED_TIME FORMAT A14

                    SQL> SELECT

                      2 DB_NAME, HOSTNAME, LOG_ARCHIVED, LOG_APPLIED, APPLIED_TIME, LOG_ARCHIVED-LOG_APPLIED LOG_GAP

                      3 FROM

                      4 ( SELECT

                      5 NAME DB_NAME

                      6 FROM

                      7 V$DATABASE

                      8 ),

                      9 (

                    10 SELECT

                    11 UPPER(SUBSTR(HOST_NAME,1,(DECODE(INSTR(HOST_NAME,'.'),0,LENGTH(HOST_NAME), (INSTR(HOST_NAME,'.')-1))))) HOSTNAME

                    12 FROM

                    13 V$INSTANCE

                    14 ),

                    15 (

                    16 SELECT

                    17 MAX(SEQUENCE#) LOG_ARCHIVED

                    18 FROM

                    19 V$ARCHIVED_LOG

                    20 WHERE

                    21 DEST_ID=1

                    22 AND

                    23 ARCHIVED='YES'

                    24 ),

                    25 (

                    26 SELECT

                    27 MAX(SEQUENCE#) LOG_APPLIED

                    28 FROM

                    29 V$ARCHIVED_LOG

                    30 WHERE

                    31 DEST_ID=2

                    32 AND

                    33 APPLIED='YES'

                    34 ),

                    35 (

                    36 SELECT

                    37 TO_CHAR(MAX(COMPLETION_TIME),'DD-MON/HH24:MI') APPLIED_TIME

                    38 FROM

                    39 V$ARCHIVED_LOG

                    40 WHERE

                    41 DEST_ID=2

                    42 AND

                    43 APPLIED='YES'

                    44 );

                     

                    DB_NAME HOSTNAME LOG_ARCHIVED LOG_APPLIED APPLIED_TIME LOG_GAP

                    ---------- -------------- ------------ ----------- -------------- -------

                    PRIMARY BIG_TEST_ 2214 2212 25-APR/06:20 2

                     

                    SQL>

                     

                    Run RMAN

                     

                    It Finds the unapplied logs

                     

                    input archived log thread=1 sequence=2213 RECID=2103 STAMP=845800215

                    input archived log thread=1 sequence=2214 RECID=2104 STAMP=845800230

                     

                    End of test

                     

                    I would still consider my RMAN settings and possible conflict with them.

                     

                    Best Regards

                     

                    mseberg

                    • 7. Re: On standby,backup archivelog not yet applied with rman
                      Shivananda Rao

                      Hello,

                       

                       

                      In other words, my problem is to understand "backup archivelog all" on standby database. This command takes on account unapplied archivelogs or not.

                       

                       

                       

                      Yes, "backup archivelog all" backs up all the archives (applied as well as unapplied).

                       

                      Why not look out for the last sequence that was applied on the standby database and try backing up from the next sequence that was applied. This would back up the unapplied archives.

                       

                       

                      SQL> select max(sequence#) from v$archived_log where applied='YES';

                       

                       

                      RMAN>backup archivelog from sequence <the next sequence from the above outcome>;

                       

                       

                      But still, I do not understand the need for backing up only the un-applied archives.

                       

                       

                       

                      Regards,

                      Shivananda