If you are using the DB2® High
Availability Disaster Recovery (HADR) feature, performing maintenance
on the two DB2 database systems,
the primary and the standby, can be more complicated than performing
maintenance on one standalone database server. If you need to stop
HADR to perform maintenance, use the STOP HADR command to stop HADR
functionality. If you are performing maintenance on the standby database
system only, you only need to stop HADR on the standby database.
To stop using HADR completely, you can 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.
- From the Control Center, expand the object tree until you
find the database for which you want to manage HADR. Right-click
the database and click High Availability Disaster Recovery→Manage
in the pop-up menu. The Manage High Availability Disaster Recovery
window opens.
- Click Stop HADR. The Stop HADR window opens.
- If you want to stop HADR on one database only, clear
the check box for the other database.
- If only one database is started (either the primary
database or the standby database), the name of that database is displayed
in the Stop HADR window.
- Click OK. The window closes. A progress indicator might
open to indicate when the command is running. When it completes,
you will get a notification indicating whether or not it is successful.
Additional information is provided through the contextual
help facility within the Control Center.