Stops the database manager on the target member or all
members. In a DB2® pureScale® environment,
it is also used to stop the cluster caching facility (CF).
Scope
In a DB2 pureScale environment
or, a partitioned database environment, this command affects all members
that are listed in the db2nodes.cfg file, unless
either a DBPARTITIONNUM, MEMBER,
or CF parameter is specified.
The command
does not shut down the member if there are active database connections.
If there are no active database connections, but there are instance
attachments, then the instance attachments are forced off first and
then the member is stopped. This command also deactivates any outstanding
database activations before stopping the member. This command can
also be used to stop instance services on a given host.
This
command is not valid on a client.
Authorization
One of the following authorities:
Command syntax
>>-+-STOP--+-DATABASE MANAGER-+-+------------------------------->
| +-DB MANAGER-------+ |
| '-DBM--------------' |
'-db2stop--------------------'
>--+--------------------------------+--------------------------->
'-+----------------+--identifier-'
+-DBPARTITIONNUM-+
+-MEMBER---------+
'-CF-------------'
>--+----------------------------------+--+------------------+--->
'-INSTANCE ON--hostname--+-------+-' '-PROFILE--profile-'
'-FORCE-'
>--+---------------------------------+-------------------------->
'-DROP DBPARTITIONNUM--identifier-'
>--+-----------------------------------------------+------------>
'-FORCE--+------------------------------------+-'
'-+----------------+----identifier---'
+-DBPARTITIONNUM-+
+-MEMBER---------+
'-CF-------------'
>--+----------------------+------------------------------------><
'-QUIESCE--+---------+-'
'-minutes-'
Command parameters
- INSTANCE ON hostname
- Specifies to stop the DB2 instance
on a particular host of the DB2 pureScale instance
for maintenance operations. This command temporarily prevents the
host from being restarted with the global db2start command.
The host can no longer act as guest host for a restart light situation.
To restart the DB2 instance
on the host after maintenance operations have been completed, issue
the START DBM INSTANCE ON hostname command.
This command fails if active members or active cluster
caching facilities (CFs)
are running on the host. If used outside of a DB2 pureScale environment,
an SQL1695N error is returned.
- FORCE
- When specified, the FORCE parameter immediately
stops the DB2 instance on the
host. Any active member running on the host fails over to other active
hosts, or any active cluster caching facility (CF)
is forced to stop. A member that is failed over to another host is
known as a restart light member, meaning that it uses
minimal resources on the host and does not accept database connections.
For more information, see "Restart light."
- identifier
- Specifies the numeric identifier without having to specify the DBPARTITIONNUM, MEMBER,
or CF parameters.
- DBPARTITIONNUM identifier
- This parameter option is valid only in a partitioned database
environment. Specifies the member to be stopped. Valid values are
from 0 to 999 inclusive.
Note: If
the FORCE option is used without this parameter,
all applications on all database partitions are forced before all
the database partitions are stopped.
Note: The identifier value
must exist in the db2nodes.cfg file of the instance
owner. If no database partition number is specified, all database
partitions defined in the configuration file are stopped.
- MEMBER identifier
- Specifies the member to be stopped. In a DB2 pureScale environment,
valid values are from 0 to 127 inclusive.
- CF identifier
- This parameter option is valid only in a DB2 pureScale environment.
Specifies the cluster caching facility (CF)
to be stopped. Valid values are 128 and 129.
If used outside of a DB2 pureScale,
an SQL1695N error is returned.
- PROFILE profile
- This parameter option is valid only in a partitioned database
environment. Specifies the name of the profile file that was executed
at startup to define the DB2 environment
for those database partitions that were started. If a profile for
the START DATABASE MANAGER command was specified,
the same profile must be specified here. The profile file must reside
in the sqllib directory of the instance owner.
- DROP DBPARTITIONNUM identifier
- This parameter option is valid only in a partitioned database
environment. Specifies the database partition to be dropped from the db2nodes.cfg configuration
file.
Note: Before using the DROP DBPARTITIONNUM parameter,
run the DROP DBPARTITIONNUM VERIFY command to ensure
that there is no user data on this database partition environment.
- FORCE
- Specifies to use FORCE APPLICATION ALL when
stopping the database
manager at
each database partition.
- QUIESCE minutes
- This parameter option is valid only in a DB2 pureScale environment
and valid only for the MEMBER parameter clause.
It is used to stop active workload on a given member before the member
is shut down (it cannot be used against a cluster caching facility).
As opposed to a db2stop FORCE command
where active applications are interrupted immediately, quiesce affords
them a graceful exit by waiting until all applications on the member
have completed their active transactions. The optional minutes parameter
value specifies how long the command waits before it tells applications
to disconnect from the given member. Once this timeout is reached,
any active units of work remaining at the time are interrupted. If
no timeout is specified the command waits indefinitely until all active
applications have ended their unit of work before proceeding with
shutting down the member.
Important: To bring the member
back online, you need to issue the db2start command
against the member.
Valid values for the minutes parameter
value are from -1 to 1440 inclusive.
The default value is -1 which means the specified
member waits indefinitely until all active workload has ended. If
a value of 0 is specified then active applications
are interrupted immediately and, once they end, the member is shut
down.
Note: A db2stop QUIESCE command
is not interruptible. After you issue the command, no further DB2 commands may be run directly
against that member. If you want to query information about the quiesced
member, you need to issue the LIST APPLICATIONS GLOBAL SHOW
DETAIL command from another active member. If you want to
stop an application that is running on a quiesced member, you need
to issue the FORCE APPLICATION '(<app
handle>)' command from another active member.
Examples
The following example is sample
output from
db2stop issued against a DB2 instance with members 10, 20, and 30:
04-07-1997 10:32:53 10 0 SQL1064N DB2STOP processing was successful.
04-07-1997 10:32:54 20 0 SQL1064N DB2STOP processing was successful.
04-07-1997 10:32:55 30 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
Usage notes
On Microsoft Windows Vista
or later versions, you must execute this command from a DB2 command window running with full administrator
privileges.
It is not necessary to issue this command on a client
node. It is provided for compatibility with older clients, but it
has no effect on the database
manager.
Once
started, the database
manager instance
runs until the user stops it, even if all application programs that
were using it have ended.
If the database
manager is
stopped, a successful completion message is sent to the standard output
device. If an error occurs, processing stops, and an error message
is sent to the standard output device.
If the database
manager cannot
be stopped because application programs are still connected to databases,
use the FORCE APPLICATION command to disconnect
all users first, or reissue the STOP DATABASE MANAGER command
with the FORCE option.
The following information
applies to partitioned database environments only:
- If no parameters are specified, the database
manager is
stopped on each database partition listed in the configuration file.
The administration notification log might contain messages to indicate
that other database partitions are shutting down.
- Any database partitions added to the partitioned database environment
since the previous STOP DATABASE MANAGER command
was issued are updated in the db2nodes.cfg file.
- On UNIX operating systems,
if the value specified for the start_stop_time database
manager configuration
parameter is reached, all in-progress stops are interrupted, and message
SQL6037N is returned from each interrupted database partition to the $HOME/sqllib/log/db2stop.timestamp.log error
log file. Database partitions that are already stopped are not affected.
- The db2cshrc file is not supported and cannot
be specified as the value for the PROFILE parameter.
Attention: Do not use the UNIX kill command to terminate
the database
manager because
the command abruptly ends database
manager processes
without controlled termination and cleanup processing.