Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Posts
    1

    Red face Unanswered: Setup HADR for DB2

    Dear all,
    I setup HADR on DB2 with below parameter:

    Node1:
    db2 update db cfg for SAMPLE using HADR_LOCAL_HOST NODE1
    db2 update db cfg for SAMPLE using HADR_LOCAL_SVC DB2_HADR_1
    db2 update db cfg for SAMPLE using HADR_REMOTE_HOST NODE2
    db2 update db cfg for SAMPLE using HADR_REMOTE_SVC DB2_HADR_2
    db2 update db cfg for SAMPLE using HADR_REMOTE_INST db2inst1
    db2 update db cfg for SAMPLE using HADR_SYNCMODE SYNC
    db2 update db cfg for SAMPLE using HADR_TIMEOUT 3
    db2 update db cfg for SAMPLE using HADR_PEER_WINDOW 120
    db2 connect to SAMPLE
    db2 quiesce database immediate force connections
    db2 unquiesce database
    db2 connect reset
    Node2:
    db2 update db cfg for SAMPLE using HADR_LOCAL_HOST NODE2
    db2 update db cfg for SAMPLE using HADR_LOCAL_SVC DB2_HADR_2
    db2 update db cfg for SAMPLE using HADR_REMOTE_HOST NODE1
    db2 update db cfg for SAMPLE using HADR_REMOTE_SVC DB2_HADR_1
    db2 update db cfg for SAMPLE using HADR_REMOTE_INST db2inst1
    db2 update db cfg for SAMPLE using HADR_SYNCMODE SYNC
    db2 update db cfg for SAMPLE using HADR_TIMEOUT 3
    db2 update db cfg for SAMPLE using HADR_PEER_WINDOW 120

    db2set DB2_HADR_ROS=ON
    db2set DB2_STANDBY_ISO=UR

    When I start Standby

    db2 deactivate database SAMPLE
    db2 start hadr on database SAMPLE as standby

    --> it's successful.
    db2pd -db sample -hadr

    Database Member 0 -- Database SAMPLE -- Active Standby -- Up 0 days 00:04:20 -- Date 2014-01-14-00.16.27.444736

    [LEFT][LEFT][LEFT] HADR_ROLE = STANDBY
    REPLAY_TYPE = PHYSICAL
    HADR_SYNCMODE = SYNC
    STANDBY_ID = 0
    LOG_STREAM_ID = 0
    HADR_STATE = REMOTE_CATCHUP_PENDING
    HADR_FLAGS =
    PRIMARY_MEMBER_HOST = NULL
    PRIMARY_INSTANCE = NULL
    PRIMARY_MEMBER = NULL
    STANDBY_MEMBER_HOST = db02
    STANDBY_INSTANCE = db2inst1
    STANDBY_MEMBER = 0
    HADR_CONNECT_STATUS = DISCONNECTED
    HADR_CONNECT_STATUS_TIME = 01/14/2014 00:12:08.374097 (1389633128)
    HEARTBEAT_INTERVAL(seconds) = 1
    HADR_TIMEOUT(seconds) = 3
    TIME_SINCE_LAST_RECV(seconds) = 0
    PEER_WAIT_LIMIT(seconds) = 0
    LOG_HADR_WAIT_CUR(seconds) = 0.000
    LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.000000
    LOG_HADR_WAIT_ACCUMULATED(seconds) = 0.000
    LOG_HADR_WAIT_COUNT = 0
    SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 16384
    SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 87380
    PRIMARY_LOG_FILE,PAGE,POS = S0000000.LOG, 0, 0
    STANDBY_LOG_FILE,PAGE,POS = S0000000.LOG, 0, 40760001
    HADR_LOG_GAP(bytes) = 0
    STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0000000.LOG, 0, 40760001
    STANDBY_RECV_REPLAY_GAP(bytes) = 0
    PRIMARY_LOG_TIME = NULL
    STANDBY_LOG_TIME = 01/06/2014 13:51:09.000000 (1388991069)
    STANDBY_REPLAY_LOG_TIME = 01/06/2014 13:51:09.000000 (1388991069)
    STANDBY_RECV_BUF_SIZE(pages) = 16
    STANDBY_RECV_BUF_PERCENT = 0
    STANDBY_SPOOL_LIMIT(pages) = 13000
    STANDBY_SPOOL_PERCENT = 0
    PEER_WINDOW(seconds) = 120
    READS_ON_STANDBY_ENABLED = Y
    STANDBY_REPLAY_ONLY_WINDOW_ACTIVE = N


    But when I perform start on primary it appear error:
    db2 start hadr on database sample as primary
    SQL1768N Unable to start HADR. Reason code = "7".

    And on Standby appear force shutdown.
    [db2inst1@db02 ~]$ db2pd -db sample -hadr

    Database SAMPLE not activated on database member 0.

    Option -hadr requires -db <database> or -alldbs option and active database.

    Pls have me some advise!!

    Thanks
    DuyPM

  2. #2
    Join Date
    Jan 2010
    Posts
    335
    Did you check the error-message?
    Use a higher Value for Timeout or try to be faster with activating your Primary. I'ld increase the Timeout!

    > db2 ? SQL1768N
    ...
    7

    The primary database failed to establish a connection to its
    standby database within the HADR timeout interval. There are
    multiple scenarios that can cause this error condition. For
    example, this message can be returned with reason code 7 if the
    value of the hadr_timeout configuration parameter or the
    hadr_peer_window configuration parameter on the primary
    database is not the same as the value on the standby database.
    ...

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    instance port ?
    translated values for :
    HADR_LOCAL_SVC DB2_HADR_2
    DB2_HADR_1
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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