Close a Database (dbClose)

The dbClose command closes the database so that applications can no longer connect to it.

ttGridAdmin dbClose name 
                    [-nowait | -wait [timeout]]

Options

The dbClose command has the options:

Option Description

name

Name of the database to close.

-nowait | -wait [timeout]

The command initiates a state change that is recorded in the active management instance of the grid.

The -nowait option causes the command to return immediately without waiting for the state change. This is the default behavior.

The -wait option causes the command to wait for the state change to complete, when the database element has been closed on each instance in the grid. You can optionally subject the wait to a limit of timeout seconds. Otherwise, or if timeout is set to 0, there is no limit.

In a large grid, it is not typical or generally advisable to use -wait. If you do, it is advisable to set a timeout. (See Database Management Operations.)

Examples

This example closes a database without waiting for the elements to be closed on all instances, then checks status (after the database was successfully closed):

% ttGridAdmin dbClose database1
Database database1 close started
...
% ttGridAdmin dbStatus database1
Database database1 summary status as of Mon Nov 13 19:27:48 PST 2017
 
created,loaded-complete,closed
Completely created elements: 4 (of 4)
Completely loaded elements: 4 (of 4)
Completely created replica sets: 2 (of 2)
Completely loaded replica sets: 2 (of 2)
 
Open elements: 0 (of 4)

Notes

  • After the command has completed, the database is still loaded but is closed to connections. Only the instance administrator can connect to a closed database.

  • If you run dbClose asynchronously (without waiting), you can use the dbStatus command to see when the database is closed.

  • The command does not close existing database connections. Any previously open connections must be terminated independently.

  • If a database has been closed with dbClose, attempting to close it again typically results in an error. However, if any element is in "close failed" state, you can retry dbClose. Doing so will change any element in "close failed" state to "opened" state, which will result in TimesTen Scaleout trying to close it again.