Destroy a Database (dbDestroy)
The dbDestroy
command destroys the specified database. All data and schema contained in the database are irretrievably lost.
ttGridAdmin dbDestroy name [-instance hostname[.instancename]] [-nowait | -wait [timeout]]
Options
The dbDestroy
command has the options:
Option | Description |
---|---|
|
Name of the database to destroy. |
|
If specified, database element(s) will be destroyed only on the specified instance(s), but elements will remain on all other instances of the grid. The elements to destroy must have been previously evicted or removed from the database distribution map or never added to the distribution map. The You can use this option only once, specifying a single instance, in a single command. |
|
The command initiates a state change that is recorded in the active management instance of the grid. The The In a large grid, it is not typical or generally advisable to use |
Examples
This example destroys a database without waiting for the elements to be destroyed on all instances. A subsequent attempt to check status indicates that the database was successfully destroyed.
% ttGridAdmin dbDestroy database1 Database database1 destroy started ... % ttGridAdmin dbStatus database1 Error 2: Database database1 does not exist
This example destroys two of the four elements in the database. Both elements are from the same replica set and had previously been evicted.
% ttGridAdmin dbDestroy database1 -instance mysys3host.griddata1 Database database1 instance mysys3host.griddata1 destroy started % ttGridAdmin dbDestroy database1 -instance mysys4host.griddata2 Database database1 instance mysys4host.griddata2 destroy started % ttGridAdmin dbStatus database1 -all Database database1 summary status as of Tue Jan 9 16:04:16 PST 2021 created,unloaded,closed Completely created elements: 2 (of 4) Completely loaded elements: 0 (of 4) Completely created replica sets: 1 (of 1) Completely loaded replica sets: 0 (of 1) Open elements: 0 (of 2) Database database1 element level status as of Tue Jan 9 16:04:16 PST 2021 Host Instance Elem Status Date/Time of Event Message ---------- --------- ---- --------- ------------------- ------- mysys3host griddata1 1 destroyed 2021-01-09 16:04:02 mysys4host griddata2 2 destroyed 2021-01-09 16:04:01 mysys5host griddata3 3 unloaded 2021-01-09 16:01:25 mysys6host griddata4 4 unloaded 2021-01-09 16:01:01 Database database1 Replica Set status as of Tue Jan 9 16:04:16 PST 2021 RS DS Elem Host Instance Status Date/Time of Event Message -- -- ---- ---------- --------- -------- ------------------- ------- 1 1 3 mysys5host griddata3 unloaded 2021-01-09 16:01:25 1 2 4 mysys6host griddata4 unloaded 2021-01-09 16:01:01 Database database1 Data Space Group status as of Tue Jan 9 16:04:16 PST 2021 DS RS Elem Host Instance Status Date/Time of Event Message -- -- ---- ---------- --------- -------- ------------------- ------- 1 1 3 mysys5host griddata3 unloaded 2021-01-09 16:01:25 2 1 4 mysys6host griddata4 unloaded 2021-01-09 16:01:01
Notes
-
The database must be unloaded or unloading.
-
If you run
dbDestroy
asynchronously (without waiting), you can use thedbStatus
command to see when the database is removed. -
A typical use case for the
-instance
option is after an element of the database failed and was evicted or removed from the database distribution map. Then usingdbDestroy
with-instance
recovers the disk space of the failed element.