Remove a Storage Group from an Archive
Use the nuocmd remove storage-group
command to remove the association of storage groups from archives.
Removing a storage group results in the archive no longer storing data for that storage group.
You cannot remove all archives associated with a storage group if the storage group has table partitions with data in them.
To remove a storage group from an archive, use the nuocmd remove storage-group
command.
This command takes the following arguments:
-
The name of the database.
-
The name of the storage group
-
The archive ID
Limitations
The following limitations apply when removing a storage group:
-
A storage group with data cannot be removed if no other archive is serving it.
-
A storage group cannot be removed if at least one of the archives serving it is not in
RUNNING
state.
A storage group can only be removed if it is not being used by any tables. Tables can only be garbage collected if they can not be seen by any transaction in the system. Given this requirement, there can be a long delay between dropping a table and the storage group becoming unused. For information on dropping tables, see DROP TABLE. |
Example
To review storage groups, run the nuocmd get storage-groups
command.
For example:
nuocmd get storage-groups --db-name companydata
StorageGroup(archive_states={}, db_name=companydata, id=1, leader_candidates=[], name=ALL, process_states={}, state=Available)
StorageGroup(archive_states={0: ADDED}, db_name=companydata, id=10, leader_candidates=[0], name=SGEAST, process_states={0: RUNNING}, state=Available)
StorageGroup(archive_states={1: ADDED}, db_name=companydata, id=11, leader_candidates=[5], name=SGWEST, process_states={5: RUNNING}, state=Available)
StorageGroup(archive_states={}, db_name=companydata, id=2, leader_candidates=[0, 5], name=UNPARTITIONED, process_states={0: RUNNING, 5: RUNNING}, state=Available)
To remove a storage group from archives, run nuocmd remove storage-group
command.
For example:
nuocmd remove storage-group --db-name companydata --sg-name sgwest --archive-ids 1
In this example, the storage group sgwest
is removed from the archive with archive-id 1
of the companydata
database.
Removing the association between a storage group and an archive when the archive is the last one servicing the storage group is possible only if the storage group is empty.
If the storage group is not empty, the state of the storage group will transition to PENDING_REMOVAL
.
To review the storage groups, run the nuocmd get storage-groups
command.
For example:
nuocmd get storage-groups --db-name companydata
StorageGroup(archive_states={}, db_name=companydata, id=1, leader_candidates=[], name=ALL, process_states={}, state=Available)
StorageGroup(archive_states={0: ADDED}, db_name=companydata, id=10, leader_candidates=[0], name=SGEAST, process_states={0: RUNNING}, state=Available)
StorageGroup(archive_states={1: PENDING_REMOVAL}, db_name=companydata, id=11, leader_candidates=[5], name=SGWEST, process_states={5: RUNNING}, state=Available)
StorageGroup(archive_states={}, db_name=companydata, id=2, leader_candidates=[0, 5], name=UNPARTITIONED, process_states={0: RUNNING, 5: RUNNING}, state=Available)