Wednesday, February 4, 2015

Start and stop HADR DB2 database

Here are the steps to STOP HADR DB2 database:
-------------------------------------------------

1. Deactivate HADR on standby database:

db2 deactivate db DB2DB01
DB20000I  The DEACTIVATE DATABASE command completed successfully.

2. Stop HADR on standby database:

db2 STOP HADR ON DB DB2DB01
DB20000I  The STOP HADR ON DATABASE command completed successfully.


Similar scripts you would need to run on primary database as well:

1. Deactivate HADR on Primary  database:
db2 deactivate db DB2DB01
DB20000I  The DEACTIVATE DATABASE command completed successfully

2. Stop HADR on Primary database:
db2 stop hadr on database DB2DB01 as primary
DB20000I  The STOP HADR ON DATABASE command completed successfully.

Here are the steps to START HADR DB2 database:
-------------------------------------------------

1. Activate HADR on standby database:

 db2 activate db DB2DB01
 DB20000I  The ACTIVATE DATABASE command completed successfully.    
      
2. Start HADR on standby database:
      
 db2 START HADR ON DB DB2DB01 AS STANDBY
 DB20000I  The START HADR ON DATABASE command completed successfully.

Samilar scripts you would need to run on primary database as well:

1. Activate HADR on Primary database:

db2 activate db DB2DB01
DB20000I  The ACTIVATE DATABASE command completed successfully.

2. Start HADR on Primary database:

db2 start hadr on database DB2DB01 as primary
DB20000I  The START HADR ON DATABASE command completed successfully.