DB2 Version 10.1 for Linux, UNIX, and Windows

Database activation and deactivation in a high availability disaster recovery (HADR) environment

If a standard database is started by a client connection, the database is shut down when the last client disconnects. If an HADR primary database is started by a client connection, it is equivalent to starting the database by using the ACTIVATE DATABASE command. To shut down an HADR primary database that was started by a client connection, you need to explicitly issue the DEACTIVATE DATABASE command.

On a standard database in rollforward pending state, the ACTIVATE DATABASE and DEACTIVATE DATABASE commands are not applicable. You can only continue rollforward, stop rollforward, or use the START HADR command to start the database as an HADR standby database. Once a database is started as an HADR standby, you can use the ACTIVATE DATABASE and DEACTIVATE DATABASE commands to start and stop the database.

Activate a primary database using the following methods:
Deactivate a primary database using the following methods:
Activate a standby database using the following methods:
Deactivate a standby database using the following methods:

Recommended order for shutting down an HADR pair

Warning: Although the STOP HADR command can be used to stop HADR on the primary or the standby, or both, it should be used with caution. If you want to stop the specified database but still want it to maintain its role as either an HADR primary or a standby database, do not issue the STOP HADR command. If you issue the STOP HADR command, the database becomes a standard database and might require reinitialization in order to resume operations as an HADR database. Instead, issue the DEACTIVATE DATABASE command.

If you only want to shut down the HADR operation, this is the recommended way of shutting down the HADR pair:

  1. Deactivate the primary database
  2. Stop DB2 on the primary database
  3. Deactivate the standby database
  4. Stop DB2 on the standby database