If you are using the DB2® High
Availability Disaster Recovery (HADR) feature, stopping HADR operations
to perform maintenance on the primary or standby databases might be
necessary. Stop HADR operations only on the database that you are
performing maintenance. To stop using HADR completely, stop HADR on
both databases.
About this task
Warning: If you want to stop
the specified database but you still want it to maintain its role
as either an HADR primary or standby database, do not issue the STOP
HADR command. If you issue the STOP HADR command
the database will become a standard database and might require reinitialization
in order to resume operations as an HADR database. Instead, issue
the DEACTIVATE DATABASE command.
If you
issue the STOP HADR command against a standard
database, an error will be returned.
Procedure
To stop HADR operations on the primary or standby database:
- From the CLP, issue the STOP HADR command
on the database where you want to stop HADR operations.
In
the following example, HADR operations are stopped on database SOCKS:
STOP HADR ON DATABASE SOCKS
If
you issue this command against an inactive primary database, the database
switches to a standard database and remains offline.
If you
issue this command against an inactive standby database the database
switches to a standard database, is placed in rollforward pending
state, and remains offline.
If you issue this command on an
active primary database, logs stop being shipped to the standby database
and all HADR engine dispatchable units (EDUs) are shut down on the
primary database. The database switches to a standard database and
remains online. Transaction processing can continue. You can issue
the START HADR command with the AS PRIMARY option to switch the role
of the database back to primary database.
If you issue this
command on an active standby database, an error message is returned,
indicating that you must deactivate the standby database before attempting
to convert it to a standard database.
- From an application, call the db2HADRStop application
programming interface (API).
- From IBM® Data Studio,
open the task assistant for the STOP HADR command.