QUIESCE DATABASE command using the ADMIN_CMD procedure

Forces all users off the specified database and puts it into a quiesced mode.

While the database is in quiesced mode, you can perform administrative tasks on it. After administrative tasks are complete, use the UNQUIESCE command to activate the database and allow other users to connect to the database without having to shut down and perform another database start.

In this mode, only users with authority in this restricted mode are allowed to connect to the database. Users with SYSADM and DBADM authority always have access to a database while it is quiesced.

Scope

QUIESCE DATABASE results in all objects in the database being in the quiesced mode. Only the allowed user or group and SYSADM, SYSMAINT, DBADM, or SYSCTRL will be able to access the database or its objects.

If a database is in the SUSPEND_WRITE state, it cannot be put in quiesced mode.

Authorization

One of the following authorities:

For database level quiesce:
  • SYSADM
  • DBADM

Required connection

Database

Command syntax

Read syntax diagramSkip visual syntax diagramQUIESCE DATABASEDB IMMEDIATEDEFERWITH TIMEOUTminutesFORCE CONNECTIONS

Command parameters

DEFER
Wait for applications until they commit the current unit of work.
WITH TIMEOUT minutes
Specifies a time, in minutes, to wait for applications to commit the current unit of work. If no value is specified, in a single-partition database environment, the default value is 10 minutes. In a partitioned database environment the value specified by the start_stop_time database manager configuration parameter will be used.
IMMEDIATE
Do not wait for the transactions to be committed, immediately roll back the transactions.
FORCE CONNECTIONS
Force the connections off.
DATABASE
Quiesce the database. All objects in the database will be placed in quiesced mode. Only specified users in specified groups and users with SYSADM, SYSMAINT, DBADM and SYSCTRL authority will be able to access to the database or its objects.

Example

Force off all users with connections to the database.
CALL SYSPROC.ADMIN_CMD( 'quiesce db immediate' )
  • This command will force all users off the database if the FORCE CONNECTIONS option is supplied. FORCE CONNECTIONS is the default behavior; the parameter is allowed in the command for compatibility reasons.
  • The command will be synchronized with the FORCE CONNECTIONS and will only complete once the FORCE CONNECTIONS has completed.

Usage notes

  • After QUIESCE DATABASE, users with SYSADM, SYSMAINT, SYSCTRL, or DBADM authority, and GRANT or REVOKE privileges can designate who will be able to connect. This information will be stored permanently in the database catalog tables.

    For example,

    grant quiesce_connect on database to username/groupname
    revoke quiesce_connect on database from username/groupname
  • Command execution status is returned in the SQLCA resulting from the CALL statement.
  • In a Db2® pureScale® environment, after quiescing a database and restarting the instance, the database will remain quiesced across all members. An explicit UNQUIESCE DATABASE command is required to remove the quiesce state.
  • In a Db2 pureScale environment, after quiescing an instance and restarting the instance, the instance will remain quiesced across all members. An explicit UNQUIESCE INSTANCE command is required to remove the quiesce state.