FORCE APPLICATION command using the ADMIN_CMD procedure
The FORCE APPLICATION command forces local or remote users or applications off the system to allow for maintenance on a server.
Scope
This command affects all database partitions that are listed in the $HOME/sqllib/db2nodes.cfg file.
In a partitioned database environment, this command does not have to be issued from the coordinator database partition of the application being forced. It can be issued from any database partition server in the partitioned database environment.
Authorization
- SYSADM
- SYSCTRL
- SYSMAINT
Required connection
Database
Command syntax
Command parameters
-
FORCE APPLICATION
-
-
ALL
- All applications will be disconnected from the database server. This might close the connection the ADMIN_CMD procedure is running on, which causes an SQL1224N error to be returned for the ADMIN_CMD procedure once the force operation is completed successfully. application-handle
- Specifies the agent to be terminated. List the values using the LIST APPLICATIONS command.
MODE ASYNC
- The command does not wait for all specified users to be terminated before returning; it returns
as soon as the function has been successfully issued or an error (such as invalid syntax) is
discovered.
This is the only mode that is currently supported.
Examples
CALL SYSPROC.ADMIN_CMD( 'force application ( 41408, 55458 )' )
Usage notes
The database manager remains active so that subsequent database manager operations can be handled without the need for db2start.
To preserve database integrity, only users who are idling or executing interruptible database operations can be terminated.
- users creating a database
- system applications
After a FORCE APPLICATION has been issued, the database will still accept requests to connect. Additional forces might be required to completely force all users off.
Command execution status is returned in the SQLCA resulting from the CALL statement.