Start high availability disaster recovery (HADR) on the
standby server, and then on the primary server.
Procedure
- On the standby server, run the following command to deactivate
the database:
db2 deactivate db database
For example:
db2 deactivate db xmeta
- On the standby server, run the following command to start
HADR on the standby server:
db2 start hadr on db database as standby
For example:
db2 start hadr db xmeta as standby
The following message is displayed:
DB2000I The START HADR ON DATABASE command completed successfully
- On the standby server, run the following command to verify
the HADR role of the server:
db2 get snapshot for db on database | grep Role
For example:
db2 get snapshot for db on xmeta | grep Role
The following line is displayed:
Role = Standby
- On the primary server, run the following command to activate
the database:
For example:
db2 activate db xmeta
- On the primary server, run the following command to start
HADR on the primary server:
db2 start hadr on db database as primary
For example:
db2 start hadr db xmeta as primary
The following message is displayed:
DB2000I The START HADR ON DATABASE command completed successfully
- On the primary server, run the following command to verify
the HADR role of the server:
db2 get snapshot for db on database | grep Role
For example:
db2 get snapshot for db on xmeta | grep Role
The following line is displayed:
Role = Primary
- On each server, run the following command to verify that
the databases are synchronized:
db2 get snapshot for database on database | grep State
For example:
db2 get snapshot for database on xmeta | grep State
After the standby database makes the connection to the
primary database, the state is reported as Peer:
State = Peer