Professional Documents
Culture Documents
Richard Crespo
racrespo@us.ibm.com
Dave Daun
djdaun@us.ibm.com
Tom Hepner
hep@us.ibm.com
Topics
What is HADR
Why use HADR
Types of HADR Synchronization
Configuring HADR
Validating HADR configuration
TSM Recover on HADR copy
HADR Failover
What is HADR
High availability disaster recovery (HADR) is a data replication feature that
provides a high availability solution for both partial and complete site
failures. HADR protects against data loss by replicating changes from a
source database (primary) to a target database (standby).
DB
transactions
Backup
data
Client
Primary
Heartbeat
Standby
Choose the best sync mode for your business need: sync, nearSync,
async, superAsync
Sync
NearSync
Async
SuperAsync
into memory.
2. Transactions are written to the logs on the primary.
3. Transactions are sent to the standby.
4. Transactions are received into memory then written to the
logs on the standby
5. Acknowledgement is sent from standby to primary that it has
received the transaction and has written them to the log.
6. Transaction is considered complete and next transaction
may take place.
10
Configuring HADR
Synchronizing time
It is very important that the time on the primary and
standby servers have their time in sync. Having the
times out of sync will create problems for the log being
sent to the standby server.
12
su - tsminst1
db2 backup db tsmdb1 to /space/mx/hadrtest
Do not start the server (do not issue the dsmserv command).
2. Restore the primary TSM host database to the server on the standby
host.
Stop the Tivoli Storage Manager server if it is running.
su - tsminst1
db2 drop db tsmdb1
13
Try and keep port number consistent with other port numbers
used by DB2.
14
15
Parameter
Description
hadr_local_host
hadr_local_svc
hadr_remote_host
hadr_remote_inst
hadr_remote_svc
hadr_syncmode
hadr_timeout
16
17
Starting HADR
Start HADR on the secondary server. Issue the following commands:
su - tsminst1
db2 start hadr on db tsmdb1 as standby
18
Monitoring HADR
To check the status of HADR use the db2pd command:
db2pd hadr db tsmdb1
HADR_ROLE = PRIMARY
REPLAY_TYPE = PHYSICAL
HADR_SYNCMODE = SYNC
STANDBY_ID = 1
LOG_STREAM_ID = 0
HADR_STATE = PEER
PRIMARY_MEMBER_HOST = host.primaryname.com
PRIMARY_INSTANCE = tsminst1
PRIMARY_MEMBER = 0
STANDBY_MEMBER_HOST = host.standbyname.com
STANDBY_INSTANCE = tsminst1
STANDBY_MEMBER = 0
HADR_CONNECT_STATUS = CONNECTED
HADR_CONNECT_STATUS_TIME = 06/08/2011 13:38:10.199479 (1307565490)
HEARTBEAT_INTERVAL(seconds) = 25
HADR_TIMEOUT(seconds) = 100
19
TSM Configuration
This solution only give you the ability to recover data from the
standby server in case of a failure of the primary.
21
22
Failover Types
Failovers are done when you need to have your standby database
take over the role of the primary database. There are 2 types of
failovers that can be performed with HARD.
Graceful a planed failover general done when both the primary
and standby are available and running fine.
Forced Usually performed when the primary is unavailable and
you want to start up TSM on the standby
23
Performing a Failover
If the need arises to have the standby server take over for the primary you will need
to perform a failover. When ever possible try and perform a graceful but if you must
you may do a forced takeover. For a graceful failover complete section A and B
below, for forced complete section B only.
A.
Halt TSM
2.
B.
su - tsminst1
db2 start hadr on db tsmdb1 as standby
su - tsminst1
db2 takeover hadr on db tsmdb1 by force
Verify each server has correct role with db2pd command.
Start TSM with DSMSERV command.
To switch roles back to the original configuration perform the same steps above but
substitute primary for standby and standby for primary.
24
25
Final Thoughts
HADR is easy to setup
You already have it with TSM 6.x
A lot of thought should go into what sync level you use.
Considerations for running on HADR standby for an extended
period of time.
26
Questions ?
27