If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Unable to start HADR on primary

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-20-10, 10:38
rangupt rangupt is offline
Registered User
 
Join Date: Jan 2008
Posts: 96
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
Reply With Quote
  #2 (permalink)  
Old 05-20-10, 10:55
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 05-20-10 at 11:04.
Reply With Quote
  #3 (permalink)  
Old 05-20-10, 11:16
rangupt rangupt is offline
Registered User
 
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



Quote:
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.

Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 05-20-10, 11:18
rangupt rangupt is offline
Registered User
 
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?
Reply With Quote
  #5 (permalink)  
Old 05-20-10, 11:53
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #6 (permalink)  
Old 05-20-10, 12:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #7 (permalink)  
Old 05-20-10, 12:13
rangupt rangupt is offline
Registered User
 
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?
Reply With Quote
  #8 (permalink)  
Old 05-20-10, 12:13
rangupt rangupt is offline
Registered User
 
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.
Reply With Quote
  #9 (permalink)  
Old 05-20-10, 16:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #10 (permalink)  
Old 05-20-10, 17:50
blazer789 blazer789 is offline
Registered User
 
Join Date: Jun 2009
Posts: 221
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
Reply With Quote
  #11 (permalink)  
Old 05-20-10, 18:20
rangupt rangupt is offline
Registered User
 
Join Date: Jan 2008
Posts: 96
The value of HADR_PEER_WINDOW is set to 0. should be greater than zero?
Reply With Quote
  #12 (permalink)  
Old 05-20-10, 19:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #13 (permalink)  
Old 05-20-10, 20:42
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Check that servers can ping each other. Also, check for any errors in the db2diag.log on both servers (ie. are logs accessible).
Reply With Quote
  #14 (permalink)  
Old 05-21-10, 09:53
rangupt rangupt is offline
Registered User
 
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
File Type: txt db2diag.txt (4.8 KB, 123 views)
Reply With Quote
  #15 (permalink)  
Old 05-21-10, 10:20
rangupt rangupt is offline
Registered User
 
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On