QUIESCE command

The QUIESCE command forces all users off either the specified instance or database across all members and puts them into a quiesced mode.

While the instance or database is in quiesced mode, you can perform administrative tasks on it. After administrative tasks are complete, use the UNQUIESCE command to activate the instance or database and allow other users to connect to the database.

In this mode, only users with authority in this restricted mode are allowed to attach or connect to the instance or database. Users with SYSADM, SYSMAINT, and SYSCTRL authority always have access to an instance while it is quiesced, and 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.

QUIESCE INSTANCE instance-name means the instance and the databases in the instance instance-name will be in quiesced mode. The instance will be accessible just for SYSADM, SYSMAINT, and SYSCTRL and allowed user or group.

If an instance is in quiesced mode, a database in the instance cannot be put in quiesced mode.

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
For instance level quiesce:
  • SYSADM
  • SYSCTRL

Required connection

Database

(Database connection is not required for an instance quiesce.)

Command syntax

Read syntax diagramSkip visual syntax diagramQUIESCE DATABASEDB IMMEDIATEDEFERWITH TIMEOUTminutesFORCE CONNECTIONS
Read syntax diagramSkip visual syntax diagramQUIESCE INSTANCEinstance-nameUSERuser-nameGROUPgroup-nameRESTRICTED ACCESSIMMEDIATEDEFERWITH 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.
INSTANCE instance-name
The instance instance-name and the databases in the instance will be placed in quiesced mode. The instance will be accessible only to users with SYSADM, SYSMAINT, and SYSCTRL authority and specified users in specified groups.

The databases within the quiesced instance will be activated to do authorization checking for all connect attempts to the database. This is necessary to determine if the connecting user ID has DBADM authority; this authority is stored in the database catalog and the database must be activated to determine if the user ID has it. To prevent this authorization checking from happening, specify the RESTRICTED ACCESS option.

USER user-name
Specifies the name of a user who will be allowed access to the instance while it is quiesced.
GROUP group-name
Specifies the name of a group that will be allowed access to the instance while the instance is quiesced.
RESTRICTED ACCESS
Specify this option to prevent authorization checking for all connect attempts to the databases of a quiesced instance to determine if the user ID has DBADM authority. Instance-level authorization checking can still occur; checking a user ID for SYSADM, SYSCTRL, or SYSMAINT authority does not require a database to be activated.
Note: This command option is available in Db2® Version 9.7 Fix Pack 2 and later fix packs.

Examples

In the following example, the default behavior is to force connections, so it does not need to be explicitly stated and can be removed from this example.

db2 quiesce instance crankarm user frank immediate force connections  

The following example forces off all users with connections to the database.

db2 quiesce db immediate
  • The first example will quiesce the instance crankarm, while allowing user frank to continue using the database.

    The second example will quiesce the database you are attached to, preventing access by all users except those with one of the following authorities: SYSADM, SYSMAINT, SYSCTRL, or DBADM.

  • This command will force all users off the database or instance if 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 INSTANCE, only users with SYSADM, SYSMAINT, or SYSCTRL authority or a user name and group name provided as parameters to the command can connect to the instance.
  • The RESTRICTED ACCESS option will prevent the databases within the quiesced instance from being activated to do authorization checking. Any user ID trying to connect to a database, which has DBADM authority or QUIESCE_CONNECT privilege on the database, will not be allowed to connect. Only user IDs which have SYSADM, SYSCTRL, or SYSMAINT authority and the user or group specified with the command will be allowed to connect to the database.
  • The RESTRICTED ACCESS option should be used when there is a need to have exclusive connections to a database within the quiesced instance. Such cases can include making an offline backup or performing other maintenance activities.
  • 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
  • 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.