DB2 Version 9.7 for Linux, UNIX, and Windows

RESTART DATABASE command

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

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

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

>--+-----------------------------------------------------+------>
   |                              .-,---------------.    |   
   |                              V                 |    |   
   '-DROP PENDING TABLESPACES--(----tablespace-name-+--)-'   

>--+--------------+--------------------------------------------><
   '-WRITE RESUME-'   

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. If a table space is in the drop-pending state, the only possible action is to drop the table space.

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 the administration notification 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.

WRITE RESUME
Allows you to force a database restart on databases that failed while I/O writes were suspended. Before performing crash recovery, this option will resume I/O writes by removing the SUSPEND_WRITE state from every table space in the database.

The WRITE RESUME option can also be used in the case where the connection used to suspend I/O writes is currently hung and all subsequent connection attempts are also hanging. When used in this circumstance, RESTART DATABASE will resume I/O writes to the database without performing crash recovery. RESTART DATABASE with the WRITE RESUME option will only perform crash recovery when you use it after a database crash. The WRITE RESUME parameter can only be applied to the primary database, not to mirrored databases.

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).

On a partitioned database system, in order to resolve the indoubt transactions, the RESTART DATABASE command should be issued on all nodes, as in the example below:

db2_all "db2 restart database database-alias"

If the database is only restarted on a single node within an MPP system, a message might 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.