DB2 Version 10.1 for Linux, UNIX, and Windows

ACTIVATE DATABASE command

Activates the specified database and starts up all necessary database services so that the database is available for connection and use by any application.

Scope

This command activates the target database on all members in the instance. If one or more of these members encounters an error during activation, a warning is returned. The database remains activated on all members on which the command succeeds.

A database is activated either implicitly or explicitly. The activation of a database driven by a first user connection is known as implicit activation. Activation of a database that is based on issuing the activate database command is known as explicit activation.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT

Required connection

None

Command syntax

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

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

Command parameters

DATABASE | DB database-alias
Specifies the alias of the database to be started.
USER username
Specifies the user starting the database.
USING password
Specifies the password for the user name.

Usage notes

Database administrators can use the ACTIVATE DATABASE command to start the selected databases. This eliminates any application time spent on database initialization. The ACTIVATE DATABASE command is the only way to explicitly activate a database.

Databases initialized by the ACTIVATE DATABASE command can be shut down by using the DEACTIVATE DATABASE or db2stop command.

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

If a database is started by issuing a CONNECT statement (or an implicit connect) and subsequently an ACTIVATE DATABASE command is issued for that same database, then the DEACTIVATE DATABASE command must be used to shut down that database. If the ACTIVATE DATABASE command was not used to start the database, the database will shut down when the last application disconnects. However, in a DB2® pureScale® environment, an active database on a member can only be deactivated on that member by issuing a DEACTIVATE DATABASE command.

In a DB2 pureScale environment, neither the ACTIVATE DATABASE command nor the CONNECT statement can be used to restart a database. In this case, the database is automatically restarted depending on the autorestart database configuration parameter. See the autorestart configuration parameter for database connection behavior when the target database is in an inconsistent state.