Unload a Database (dbUnload)

The dbUnload command unloads the specified database from memory.

ttGridAdmin dbUnload name 
                     [-nowait | -wait [timeout]]
                     [-force]

Note:

If a dbUnload command is issued while a transaction is in progress, the command will not wait for the transaction to complete. Data may be lost as a result.

Options

The dbUnload command has the options:

Option Description

name

Name of the database to unload.

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

-force

If Durability=0 and at least one replica set is completely down, this option allows the unload to proceed anyway.

Important: Using this option will likely result in data loss.

(Tipically, to prevent data loss, a database with Durability=0 cannot be unloaded unless at least one element from every replica set is loaded.)

Examples

This example unloads a database without waiting for the elements to be unloaded on all instances, then checks status (after the database was successfully unloaded).

% ttGridAdmin dbUnload database1
Database database1 unload started
...
% ttGridAdmin dbStatus database1
Database database1 summary status as of Mon Nov 13 18:52:47 PST 2017
 
created,unloaded,closed
Completely created elements: 4 (of 4)
Completely loaded elements: 0 (of 4)
Completely created replica sets: 0 (of 0)
Completely loaded replica sets: 0 (of 0)
 
Open elements: 0 (of 4)

Notes

  • Do not begin any transactions after issuing a dbUnload command.

  • All connections to the database must be closed.

  • The database must be closed.

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