Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2010
    Posts
    99

    Unanswered: userexit and log shipping setup

    Hi I am trying to test a DR solution using log shipping. We already are using HADR on the server so this is to add the DR component. I create the USEREXIT program and it is working fine - copies logs to the dir. So far so good. My issue is that my standby server is not "seeing" the new logs. When I run the command ROLLFORWARD DB <name> TO END OF LOGS it only rolls forward to the end of logs that were provided in the initial restore. The LOGARCHMETH1 on the standby islet to USEREXIT. I also tried to point the LOGARCHMETH1 to the dest. of the USEREXIT i.e. DISK:/shareddirectory/containing/archive/logs.

    Is there something I am missing on the CFG on the standby - i.e. what do I set it's LOGARCHMETH1 to?

    In the results below I am expecting the roll forward to apply S0000007.LOG. When I backed up the primary db it had up to S*6.LOG. The initial roll forward on the standby finished on S*6.LOG, so far so good. But again as new logs are archived using the USEREXIT the roll forward command is not rolling forward through the NEW logs.

    Thanks,
    James

    See below:

    System software: db2 EE level 9.7.0.4 running on RH6

    Last LOG that was archived by the primary server to the dest. dir on the target server:
    -rw-------. 1 db2inst1 db2iadm1 16384 Feb 6 11:01 S0000007.LOG

    CFG on STANDBY:
    First active log file = S0000006.LOG
    First log archive method (LOGARCHMETH1) = USEREXIT
    Path to log files = /db2data/db2inst1/test11/NODE0000/


    Command I am running to play through the logs:
    db2 rollforward db test11 to end of logs

    RESULTS of roll forward:

    Rollforward Status

    Input database alias = test11
    Number of nodes have returned status = 1

    Node number = 0
    Rollforward status = DB working
    Next log file to be read = S0000006.LOG
    Log files processed = -
    Last committed transaction = 2015-02-06-15.40.00.000000 UTC

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Does your USEREXIT program support retrieval of archived logs? Does it get called during the rollforward? Does it return an error?
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Nov 2010
    Posts
    99
    Thanks for your reply. My POC is a little too simple. I am using the same server to ship logs. So the db's have different names. As a result the retrieve from path is appending the standby db name to the path.

    I tried to manuallycopy the archive logs from the primary to the path the standby retrieves from but it's still looking for log S0000006.LOG. I will try to perform this test using DIFFERENT servers with the SHARING a single db name and try again.

    i.e.
    ARCHIVE from /db2data/db2inst1/test1/NODE0000/ file S0000008.LOG to /db2archive/db2inst1/test11/TEST1
    RETRIEVE to /db2data/db2inst1/test11/NODE0000/ file S0000006.LOG from /db2archive/db2inst1/test1/TEST11

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Rollforward looks for logs in its database log path. If the logs from the primary are copied elsewhere, it's the responsibility of the userexit program to fetch the logs from wherever they are.

    Since you didn't answer any of my questions I'm afraid I can't offer much help beyond that.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    May 2012
    Location
    Canberra, Australia
    Posts
    176
    Provided Answers: 6
    I can't see the point of what you are trying to do. You say you have HADR running but you also want to ship logs. If the HADR secondary is not in your DR location then why not add a second alternate?

  6. #6
    Join Date
    Nov 2010
    Posts
    99
    Hi Tafster,

    We are running DB2 9.7. I thought you can only have one HADR standby, is this not the case?

    Currently the HADR servers are at the same data center. We are looking to create a DR solution to a separate data center. For this solution I am researching log shipping.

    I am new to DR and HADR so let me know if I missed something in my research.

    Thanks,

    James

  7. #7
    Join Date
    Nov 2010
    Posts
    99
    Sorry I didn't directly reply n_i. The user exit program does archive and retrieve logs without error. What I noticed is that the directory it choses it appended with the db name. Since I am using different database names for my POC I can't get the archive to copy logs into the TEST11 directory. See my reply from 02-06-15 for the exact paths.

    Thanks!

    James

  8. #8
    Join Date
    May 2012
    Location
    Canberra, Australia
    Posts
    176
    Provided Answers: 6
    My apologies. I skipped over the 9.7 bit.

  9. #9
    Join Date
    Nov 2010
    Posts
    99
    No worries! Thanks for the follow-up.

  10. #10
    Join Date
    May 2012
    Location
    Canberra, Australia
    Posts
    176
    Provided Answers: 6
    just be aware that logretain and userexit have been discontinued in 10.1.

  11. #11
    Join Date
    Feb 2015
    Posts
    4
    On the DR server you have LOGARCHMETH1 set to:

    LOGDISK:/shareddirectory/containing/archive/logs

    The actual location of the logs has to be (do not change LOGARCHMETH1):

    /shareddirectory/containing/archive/logs/<DBNAME>/NODE0000/C0000000


    That way when you issue the RF command the LOGARCHMETH1 will retrieve the logs from the above directory. The other option is to specify the overflow logpath in the RF command to be:

    db2 rollforward db <dbname> to end of logs overflow log path (/shareddirectory/containing/archive/logs)


    Cheers,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •