Starts HADR operations for a database. This is a cluster-wide command in a DB2® pureScale® environment, so you can issue it on any member.
One of the following authorities:
Instance. The command establishes a database connection if one does not exist, and closes the database connection when the command completes.
>>-START HADR ON--+-DATABASE-+--database-alias------------------> '-DB-------' >--+--------------------------------------+---------------------> '-USER--user-name--+-----------------+-' '-USING--password-' >--AS--+-PRIMARY--+----------+-+------------------------------->< | '-BY FORCE-' | '-STANDBY---------------'
The following table shows database behavior in various conditions:
Database status | Behavior upon START HADR command with the AS PRIMARY option | Behavior upon START HADR command with the AS STANDBY option |
---|---|---|
Inactive standard database | Activated as HADR primary database. In a DB2 pureScale environment, only the local member is started. | Database starts as an standby database if it is in rollforward-pending mode (which can be the result of a restore or a split mirror) or in rollforward in-progress mode. Otherwise, an error is returned. |
Active standard database | Database enters HADR primary role. | Error message returned. |
Inactive primary database | Activated as HADR primary database. In a DB2 pureScale environment, only the local member is started. | After a failover, this reintegrates the failed primary into the HADR pair as the new standby database. Some restrictions apply. |
Active primary database | Warning message issued. | Error message returned. |
Inactive standby database | Error message returned. | Starts the database as the standby database. |
Active standby database | Error message returned. | Warning message issued. |
In a DB2 pureScale environment, whichever member you issue the START HADR command on is designated as the preferred replay member. This member is the first choice for replaying logs on the HADR standby database (only one standby member replays logs generated on all primary members). For a member on the primary cluster, this designation is relevant only if the primary becomes a standby database. For a member on the standby cluster, this designation means that when the standby database starts, replay service attempts to start on this member. Although the preferred replay member status is persistent (that is, it remains until the next START HADR command), if replay has moved to another standby member, replay does not automatically revert back to the preferred replay member when that member is available.
If the START HADR command returns success, the preferred replay member is updated. If the START HADR command returns failure, the preferred member might or might not have been updated, depending on how far the command execution went. You can rerun the command to make sure. If a database is already active and in the desired role, the START HADR command is a nop (no operation performed). It returns an error and the preferred replay member is not updated. To redesignate the preferred replay member when a database is already online, use the procedure described in "Changing the preferred replay member".
When the START HADR command is issued, the corresponding error codes might be generated: SQL1767N, SQL1769N, or SQL1770N with a reason code of 98. The reason code indicates that there is no installed license for HADR on the server where the command was issued. To correct the problem, install a valid HADR license using the db2licm or install a version of the server that contains a valid HADR license as part of its distribution.