Command Reference

RESTART DATABASE

Restarts a database that has been abnormally terminated and left in an inconsistent state. At the successful completion of RESTART DATABASE, the application remains connected to the database if the user has CONNECT privilege.

Scope

This command affects only the node on which it is executed.

Authorization

None

Required Connection

This command establishes a database connection.

Command Syntax

>>-RESTART----+-DATABASE-+--database-alias---------------------->
              '-DB-------'
 
>-----+---------------------------------------+----------------->
      '-USER--username--+------------------+--'
                        '-USING--password--'
 
>-----+----------------------------------------------------------+>
      |                              .--------------------.      |
      |                              V                    |      |
      '-DROP PENDING TABLESPACES--(-----tablespace-name---+---)--'
 
>--------------------------------------------------------------><
 

Command Parameters

DATABASE database-alias
Identifies the database to restart.

USER username
Identifies the user name under which the database is to be restarted.

USING password
The password used to authenticate username. If the password is omitted, the user is prompted to enter it.

DROP PENDING TABLESPACES tablespace-name
Specifies that the database restart operation is to be successfully completed even if table space container problems are encountered.

If a problem occurs with a container for a specified table space during the restart process, the corresponding table space will not be available (it will be in drop pending state) after the restart operation. In the case of circular logging, a troubled table space will cause a restart failure. A list of troubled table space names can found in db2diag.log if a restart database operation fails because of container problems. If there is only one system temporary table space in the database, and it is in drop pending state, a new system temporary table space must be created immediately following a successful database restart operation.

Usage Notes

Execute this command if an attempt to connect to a database returns an error message, indicating that the database must be restarted. This action occurs only if the previous session with this database terminated abnormally (due to power failure, for example).

At the completion of RESTART DATABASE, a shared connection to the database is maintained if the user has CONNECT privilege, and an SQL warning is issued if any indoubt transactions exist. In this case, the database is still usable, but if the indoubt transactions are not resolved before the last connection to the database is dropped, another RESTART DATABASE must be issued before the database can be used again. Use LIST INDOUBT TRANSACTIONS to generate a list of indoubt transactions. For more information about indoubt transactions, see the Administration Guide.

If the database is only restarted on a single node within an MPP system, a message may be returned on a subsequent database query indicating that the database needs to be restarted. This occurs because the database partition on a node on which the query depends must also be restarted. Restarting the database on all nodes solves the problem.

See Also

CONNECT TO statement in the SQL Reference.


[ Top of Page | Previous Page | Next Page ]