IBM Support

How to resolve SQL1768N reason code 5 "Invalid service name for the hadr_local_svc configuration parameter."

Technote (troubleshooting)


Problem(Abstract)

When trying to start the standby database, after setting up HADR, and you receive SQL1768N reason code 5 "Invalid service name for the hadr_local_svc configuration parameter."

db2 start hadr on database <database name> as standby

SQL1768N "Invalid service name for the hadr_local_svc configuration parameter." Reason code = 5.

Cause

Either a port in /etc/services has not been established correctly, or there is an issue with the database configuration parameter HADR_LOCAL_SVC.

Diagnosing the problem

Review all your UPDATE DB CFG commands for both primary and standby, and validate with the /etc/services file.

Resolving the problem

In this example, on the PRIMARY database server, here are the applicable UPDATE DB CFG commands:

db2 UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_SVC hadr_service_primary
db2 UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_SVC hadr_service_standby
db2 UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_INST db2inst1
db2 UPDATE DB CFG FOR SAMPLE USING HADR_TIMEOUT 120
db2 UPDATE DB CFG FOR SAMPLE USING HADR_SYNCMODE NEARSYNC

And here are the applicable UPDATE DB CFG commands on the STANDBY database server:

db2 UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_SVC hadr_service_standby
db2 UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_SVC hadr_service_primary
db2 UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_INST db2inst1
db2 UPDATE DB CFG FOR SAMPLE USING HADR_TIMEOUT 120
db2 UPDATE DB CFG FOR SAMPLE USING HADR_SYNCMODE NEARSYNC

In /etc/services on the primary server, hadr_service_primary and hadr_service_standby resolve to:

hadr_service_primary 51012/tc
hadr_service_standby 51013/tc

and vice versa on the standby server. The missing 'p' is the issue. You can resolve by correcting the /etc/services, like so:

hadr_service_primary 51012/tcp
hadr_service_standby 51013/tcp

If after the change the "db2 start hadr on database <database name> as standby" receives the same error, edit the HADR_LOCAL_SVC and HADR_REMOTE_SVC on both primary and standby database servers to reference the port number instead. Example on the primary database server:

db2 UPDATE DB CFG FOR SAMPLE USING HADR_LOCAL_SVC 51012
db2 UPDATE DB CFG FOR SAMPLE USING HADR_REMOTE_SVC 51013

Related information

Step by Step Procedure to set up HADR replication betwe

Document information

More support for: DB2 for Linux, UNIX and Windows
High Availability - HADR

Software version: 9.7, 10.1, 10.5

Operating system(s): AIX, HP-UX, Linux, Solaris

Software edition: Advanced Enterprise Server, Enterprise Server

Reference #: 1694894

Modified date: 19 January 2015