You are here: Reference Information > Command Line Tools > NuoDB Manager > Remove StorageGroup

Remove StorageGroup

This is a NuoDB Manager command. See NuoDB Manager.

Description

Remove from service a storage group on a specified storage manager. The following must be true to remove a storage group:

  1. The storage group is being removed from a storage manager, not from a transaction engine.
  2. The storage group name must exist in the database.
  3. The storage group must be serviced by the specified storage manager.
  4. The specified storage manager is not currently syncing.
  5. You are not trying to remove the ALL storage group from the storage manager.
  6. You are not trying to remove a storage group from a storage manager that services all storage groups.
  7. If the storage group is serviced by another SM in the database, then that SM must be in a running state and not syncing.
  8. If the storage group is not serviced by another SM in the database, then the storage group must not be used by any partitioned table in the database.

Syntax

remove storageGroup 
    name storage_group_name
    host sm_host
    pid process_id

Parameters

Interactive Example

Use the show storageGroups command (see Show StorageGroups) to see what storage groups the database is currently servicing.

nuodb [domain] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 27854 ] [ nodeId = 1 ] RUNNING
 
  [id=10] SG1 Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 27854 ] [ nodeId = 1 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:

Remove storage group SG1 from the SM running on 52.11.92.215:

nuodb [domain] > remove storageGroup
Storage group name: sg1
Host: 52.11.92.215
Process ID: 27854
Success
nuodb [domain] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 27854 ] [ nodeId = 1 ] RUNNING
 
  [id=10] SG1 Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:

Decommissioning a non-empty Storage Group.

You may also want to decommission a non-empty storage group, e.g. if all archives containing it were destroyed. Then any partitions in this storage group are inaccessible.

Remove storage group SG1 from the SM running on 52.11.92.215 with reference to stranded transactions

nuodb [domain] > remove storageGroup
Storage group name: sg1
Host: 52.11.92.215
Process ID: 27854
Success

// Resolve stranded transactions if it was the last remaining off-line SG //
//---TODO: This should only be called if the storage group was removed from//
//the database as a whole, not just from one archive.//
//And in that case it should be called on every node.//

Scripting Example

The same remove storageGroup command can be executed with --command as follows:

nuodbmgr --broker host --password password \
    --command "remove storageGroup name sg1 host 52.11.92.215 pid 27854"

Deleting a Storage Group

A storage group can only be deleted from the database if it was previously removed from all online SMs.To delete, see Delete StorageGroup.