DB2 Version 9.7 for Linux, UNIX, and Windows

DEACTIVATE DATABASE command

Stops the specified database.

Scope

In an MPP system, this command deactivates the specified database on all database partitions in the system. If one or more of these database partitions encounters an error, a warning is returned. The database will be successfully deactivated on some database partitions, but might continue to be active on the nodes encountering the error.

Authorization

One of the following:
  • sysadm
  • sysctrl
  • sysmaint

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-DEACTIVATE--+-DATABASE-+--database-alias--------------------->
               '-DB-------'                   

>--+-------------------------------------+---------------------><
   '-USER--username--+-----------------+-'   
                     '-USING--password-'     

Command parameters

DATABASE database-alias
Specifies the alias of the database to be stopped.
USER username
Specifies the user stopping the database.
USING password
Specifies the password for the user ID.

Usage notes

Databases initialized by ACTIVATE DATABASE can be shut down by DEACTIVATE DATABASE or by db2stop. If a database was initialized by ACTIVATE DATABASE, the last application disconnecting from the database will not shut down the database, and DEACTIVATE DATABASE must be used. (In this case, db2stop will also shut down the database.)

The application issuing the DEACTIVATE DATABASE command cannot have an active database connection to any database.

The database can be inaccessible if the database was not explicitly activated, a client application performs frequent reconnections, or the time interval between issuing the DEACTIVATE DATABASE and ACTIVATE DATABASE commands is very short. Activate the database by issuing the ACTIVATE DATABASE command and then attempt to connect to the database.