Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Jan 2008
    Posts
    96

    Unanswered: Unable to start HADR on primary

    ENV:

    DB2 9.5 WSE, REDHAT 5.4, 2 servers

    I am trying to set up DB2 HADR using command line and getting SQL1768N error with Reason Code 7 which basically says "The primary database failed to establish a connection to its standby database within the HADR timeout interval". I have tried increasing the timeout interval from 60 to 120 seconds but still the primary won't start. Looked at the iptables and they are tunred off. The network engineer says that since the 2 servers are on same VLAN the ports are open between the 2 servers. Tried using fully qualified name (a.b.c) and also tried the IP address for the HADR_LOCAL_HOST and HADR_REMOTE_HOST but still no luck.

    Here are the steps that I followed:

    Steps on primary server - DB01

    UPDATE DB CFG FOR DB SAMPLE USING LOGARCHMETH1 TSM
    UPDATE DB CFG FOR DB SAMPLE USING LOGARCHMETH2 DISK:/db2/archive
    UPDATE DB CFG FOR DB SAMPLE USING LOGINDEXBUILD ON
    UPDATE DB CFG FOR DB SAMPLE USING INDEXREC RESTART

    -- backup database sample

    BACKUP DATABASE SAMPLE

    -- transfer and restore backup image to DB02 (senondary server)

    RESTORE DATABASE SAMPLE FROM "/tmp" TAKEN AT 20100519144651 REPLACE HISTORY FILE WITHOUT PROMPTING

    --Configure database for client reroute - DB01 -db2inst1 - SAMPLE

    UPDATE ALTERNATE SERVER FOR DB SAMPLE USING HOSTNAME 192.168.54.94 PORT 60000

    --Configure databases for client reroute -DB02

    UPDATE ALTERNATE SERVER FOR DB SAMPLE USING HOSTNAME 192.168.54.93 PORT 60000

    -- update services file on primary system - DB01
    -- service name : DB2_HADR_1
    -- port number: 55001
    -- service name : DB2_HADR_2
    -- port number: 55002
    --
    -- update services file on secondary system - DB02
    -- service name : DB2_HADR_1
    -- port number: 55001
    -- service name : DB2_HADR_2
    -- port number: 55002

    --update HADR config parameters on primary database - DB01 -db2inst1 -SAMPLE

    UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_HOST 192.168.54.93
    UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_SVC DB2_HADR_1
    UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_HOST 192.168.54.94
    UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_SVC DB2_HADR_2
    UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_INST db2inst1
    UPDATE DB CFG FOR SAMPLE USING HADR_SYNCMODE NEARSYNC
    UPDATE DB CFG FOR SAMPLE USING HADR_TIMEOUT 120
    CONNECT TO SAMPLE
    QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS
    UNQUIESCE DATABASE
    CONNECT RESET

    -- update HADR config parameters on standby database - DB02

    UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_HOST 192.168.54.94
    UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_SVC DB2_HADR_2
    UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_HOST 192.168.54.93
    UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_SVC DB2_HADR_1
    UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_INST db2inst1
    UPDATE DB CFG FOR SAMPLE USING HADR_SYNCMODE NEARSYNC
    UPDATE DB CFG FOR SAMPLE USING HADR_TIMEOUT 120

    -- start HADR on standby database -DB02 -

    DEACTIVATE DATABASE SAMPLE
    START HADR ON DATABASE SAMPLE AS STANDBY
    ACTIVATE DATABASE SAMPLE

    --start HADR on primary database - DB01 -db2inst1 -SAMPLE

    DEACTIVATE DATABASE SAMPLE
    START HADR ON DATABASE SAMPLE AS PRIMARY


    And its at the last step i get the error sql1768n with reason code 7. I am out of ideas and don't understand why this is not working. What am I missing here?

    Thanks

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Try reversing the HADR service ports on the Standby Database.

    Also, I am not sure why you need to deactivate the Primary before starting HADR.

    Edit: I hope those ports you are using for HADR (55001, 55002) are not the DB2 instance port numbers. You need a separate set of HADR ports besides the DB2 instance ports.
    Last edited by Marcus_A; 05-20-10 at 12:04.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2008
    Posts
    96
    Quote Originally Posted by Marcus_A View Post
    Try reversing the HADR service ports on the Standby Database.
    Tried that still no luck. I get same error



    Also, I am not sure why you need to deactivate the Primary before starting HADR.
    I thought all the start hadr commands needs to be preceeded with deactivate database command. I tried without it and still the same error.

    Edit: I hope those ports you are using for HADR (55001, 55002) are not the DB2 instance port numbers. You need a separate set of HADR ports besides the DB2 instance ports.
    Yes, the hadr ports are different from the db2 instance ports.

  4. #4
    Join Date
    Jan 2008
    Posts
    96
    QUOTE]Try reversing the HADR service ports on the Standby Database.[/QUOTE]

    Did you mean using the port numbers instead of the service name?

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by rangupt View Post
    QUOTE]Try reversing the HADR service ports on the Standby Database.
    Did you mean using the port numbers instead of the service name?[/QUOTE]
    No, I meant reversing them on the standby. But I always use port numbers, instead of names (but I assume you have the names/ports set up correctly in /etc/services).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Did you backup the primary and restore it on the standby (without rolling forward) before changing the db cfg on the standby?
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Jan 2008
    Posts
    96
    Yes i have the names/ports setup correctly in the /etc/services.

    Doesn't the primary and standby HADR services have to be different. If i reverse the port numbers on standby they would be same as primary?

  8. #8
    Join Date
    Jan 2008
    Posts
    96
    Quote Originally Posted by Marcus_A View Post
    Did you backup the primary and restore it on the standby (without rolling forward) before changing the db cfg on the standby?
    Yes i did.

  9. #9
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Only thing I can suggest is you look up the error message and reason code and the manual, and try the suggested "User Response" items they list for that reason code.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  10. #10
    Join Date
    Jun 2009
    Posts
    272
    Please try using the port numbers instead of SVCE names and also give a try by removing the entries from the /etc/services file.

    whats the value of HADR_PEER_WINDOW ?.

    Also please make sure the db cfg paramaeters got applied to the database. db2 connect to database name; db2 get db cfg for dbname show detail | grep -i hadr; Make sure the values are same on both the sides

  11. #11
    Join Date
    Jan 2008
    Posts
    96
    The value of HADR_PEER_WINDOW is set to 0. should be greater than zero?

  12. #12
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can leave it at 0. That is not your problem.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  13. #13
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Check that servers can ping each other. Also, check for any errors in the db2diag.log on both servers (ie. are logs accessible).

  14. #14
    Join Date
    Jan 2008
    Posts
    96
    Yes the servers can ping each other. I have attached a snippet from the db2diag.log when i am trying to start the HADR on primary.
    Attached Files Attached Files

  15. #15
    Join Date
    Jan 2008
    Posts
    96
    I want to start from fresh. How can i unset the HADR db cfg variables? I restored the database to an image before i started the HADR work and for some reason the HADR configuration is still there?

Posting Permissions

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