1. Enable archive logging
update db cfg for sample using logarchmeth1 DISK:/tmp/samplearchlogs
2. Check that there is either no firewall between the two servers or if there is a firewall, then the following ports must be open:
523 (for DB2 DAS), main DB2 port (50000) and two ports for HADR
3. Create das instance on both servers if not already done
ls128 is primary and ls129 is standby
4. Catalog admin node on primary
db2 catalog admin tcpip node standadm remote ls129.in.ibm.com remote_instance db2inst1 system ls129.in.ibm.com
5. Catalog remote tcpip node and standby database
db2 catalog tcpip node db2_std remote ls129.in.ibm.com server 50000
db2 catalog database sample as sam_std at node db2_std
6. Catalog admin node on standby
db2 catalog admin tcpip node primadm remote ls128.in.ibm.com remote_instance db2inst1 system ls128.in.ibm.com
7. Catalog remote tcpip node and primary database
db2 catalog tcpip node db2_pri remote ls128.in.ibm.com server 50000
db2 catalog database sample as sam_pri at node db2_pri
8. Verify that svcename is set to 50000 on both instances.
9. Verify that db2comm is set to tcpip on both
10. We want to log all index creation, re-creation and re-organization so set LOGINDEXBUILD on
db2 update db cfg for sample using LOGINDEXBUILD ON
11. Backup db on primary and restore on secondary
db2 backup database sample compress
db2 restore database sample replace history file
12. Configure ACR on both servers (Automatic Client Reroute). Optional but recommended.
On primary,
db2 update alternate server for database sample using hostname ls129.in.ibm.com port 50000
On standby,
db2 update alternate server for database sample using hostname ls128.in.ibm.com port 50000
13. Update the services file on both primary and standby with following entries.
# HADR entries
db2_hadr_1 55001/tcp
db2_hadr_2 55002/tcp
14. Update db config params for primary
update db cfg for sample using hadr_local_host ls128
update db cfg for sample using hadr_local_svc db2_hadr_1
update db cfg for sample using hadr_remote_host ls129
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 sync
update db cfg for sample using hadr_timeout 3
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
15. Update db config params on standby
update db cfg for sample using hadr_local_host ls129
update db cfg for sample using hadr_local_svc db2_hadr_2
update db cfg for sample using hadr_remote_host ls128
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 sync
update db cfg for sample using hadr_timeout 3
update db cfg for sample using hadr_peer_window 120
16. Start HADR on standby
db2 deactivate db sample
db2 start hadr on database sample as standby
17. Start HADR on primary
db2 deactivate db sample
db2 start hadr on db sample as primary