DB2 Version 9.7 for Linux, UNIX, and Windows

STOP DATABASE MANAGER command

Stops the current database manager instance. Unless explicitly stopped, the database manager continues to be active. This command does not stop the database manager instance if any applications are connected to databases. If there are no database connections, but there are instance attachments, it forces the instance attachments and stops the database manager. This command also deactivates any outstanding database activations before stopping the database manager.

In a partitioned database environment, this command stops the current database manager instance on a database partition or on all database partitions. When it stops the database manager on all database partitions, it uses the db2nodes.cfg configuration file to obtain information about each database partition.

This command can also be used to drop a database partition from the db2nodes.cfg file (partitioned database environments only).

This command is not valid on a client.

Scope

By default, and in a partitioned database environment, this command affects all database partitions that are listed in the db2nodes.cfg file.

Authorization

One of the following:
  • sysadm
  • sysctrl
  • sysmaint

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-+-STOP--+-DATABASE MANAGER-+-+--+------------------+--------->
   |       +-DB MANAGER-------+ |  '-PROFILE--profile-'   
   |       '-DBM--------------' |                         
   '-db2stop--------------------'                         

>--+------------------------------------------------+----------><
   +-DBPARTITIONNUM--db-partition-number------------+   
   +-DROP DBPARTITIONNUM--db-partition-number-------+   
   '-FORCE--+-------------------------------------+-'   
            '-DBPARTITIONNUM--db-partition-number-'     

Command parameters

PROFILE profile
Partitioned database environments only. 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.
DBPARTITIONNUM db-partition-number
Partitioned database environments only. Specifies the database partition to be stopped.

Valid values are from 0 to 999 inclusive, and must be in the db2nodes.cfg file. If no database partition number is specified, all database partitions defined in the configuration file are stopped.

DROP DBPARTITIONNUM db-partition-number
Partitioned database environments only. Specifies the database partition to be dropped from the db2nodes.cfg file.

Before using this parameter, run the DROP DBPARTITIONNUM VERIFY command to ensure that there is no user data on this database partition.

When this option is specified, all database partitions in the db2nodes.cfg file are stopped.

FORCE
Specifies to use FORCE APPLICATION ALL when stopping the database manager at each database partition.
DBPARTITIONNUM db-partition-number
Partitioned database environments only. Specifies the database partition to be stopped after all applications on that database partition have been forced to stop. If the FORCE option is used without this parameter, all applications on all database partitions are forced before all the database partitions are stopped.

Examples

The following is sample output from db2stop issued on a three-partition system with database partitions 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 will be updated in the db2nodes.cfg file.
  • On UNIX platforms, if the value specified for the start_stop_timedatabase 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: The UNIX kill command should not be used to terminate the database manager because it will abruptly end database manager processes without controlled termination and cleanup processing.