The state
that a DB2® High Availability
Disaster Recovery (HADR) standby database is in determines what operations
it can perform. There are two recommended options for determining
the state of the standby: the db2pd command and
the MON_GET_HADR table function.
Procedure
To determine the state of an HADR standby database in a
primary-standby HADR database pair: - Issue the db2pd command with the -hadr parameter
from the primary database or the standby database.
- If you issue the command from the primary database, the command
returns a set of data for each standby in your HADR setup.
- If you issue the command from the standby database, the command
returns only a single set of data, because the standby is not aware
of any other standbys, even if your HADR setup is in multiple standby
mode.
- Issue a query using the MON_GET_HADR table function on the
primary database or the standby database:
db2 "select STANDBY_ID, HADR_STATE, from table (mon_get_hadr(NULL))"
The
following information is returned: STANDBY_ID HADR_STATE
---------- -----------------------
1 PEER
2 REMOTE_CATCHUP
3 REMOTE_CATCHUP
3 record(s) selected.
- If you issue the query to the primary database, the table function
returns a row of information for each standby in your HADR setup.
- If you issue the query to the standby database, the table function
returns only a single row of information because the standby is not
aware of any other standbys, even if your HADR setup is in multiple
standby mode.