Delete a Storage Group from a Database

A storage group goes permanently offline for the following two reasons:

  • The storage group is removed from all archives with no intent of adding it back to any archive.

  • All archives serving the storage group are damaged or lost.

A user-defined storage group that has gone permanently offline must be deleted. Deleting a storage group informs the database that it no longer needs to wait for the storage group to come back online and allows the database to resolve all stranded transactions that have been waiting for the storage group to come online.

To delete a permanently offline storage group from an archive, use the nuocmd delete storage-group command. This command takes the following arguments:

  • The name of the database.

  • The name of the storage group.

Example

To check the state of the storage group, run the nuocmd get storage-groups command. An offline storage group is indicated with state = Unavailable. For example:

nuocmd get storage-groups --db-name tpsgtest
StorageGroup(archive_states={}, db_name=tpsgtest, id=1, leader_candidates=[], name=ALL, process_states={}, state=Available)
StorageGroup(archive_states={0: ADDED}, db_name=tpsgtest, id=10, leader_candidates=[0], name=SGEAST, process_states={0: RUNNING}, state=Available)
StorageGroup(archive_states={}, db_name=tpsgtest, id=11, leader_candidates=[5], name=SGWEST, process_states={5: RUNNING}, state=Unavailable)
StorageGroup(archive_states={}, db_name=tpsgtest, id=2, leader_candidates=[0, 5], name=UNPARTITIONED, process_states={0: RUNNING, 5: RUNNING}, state=Available)

In this example, the database has one user-defined storage group SGWEST with state = Unavailable, indicating that it is offline.

To delete the offline storage group, run the nuocmd delete storage-group command. For example:

nuocmd delete storage-group --db-name tpsgtest --sg-name sgwest

To review the storage groups, run the nuocmd get storage-groups command. For example:

nuocmd get storage-groups --db-name tpsgtest
StorageGroup(archive_states={}, db_name=tpsgtest, id=1, leader_candidates=[], name=ALL, process_states={}, state=Available)
StorageGroup(archive_states={0: ADDED}, db_name=tpsgtest, id=10, leader_candidates=[0], name=SGEAST, process_states={0: RUNNING}, state=Available)
StorageGroup(archive_states={}, db_name=tpsgtest, id=2, leader_candidates=[0, 5], name=UNPARTITIONED, process_states={0: RUNNING, 5: RUNNING}, state=Available)

The storage group SGWEST is deleted from the database.

A storage group can only be deleted from the database if it was previously removed from all archives or if the archives serving the storage group were deleted. For more information, see Remove a Storage Group from an Archive.