RETIRE_LOCATION
Makes the specified storage location inactive. To see a list of all of the storage locations in Vertica, refer to STORAGE_LOCATIONS.
Syntax
RETIRE_LOCATION ( 'path', 'node' [, enforce_storage_move ] )
Parameters
path |
Specifies where the storage location to retire resides. |
node |
The Vertica node where the location is available. A value of "" (an empty string) means to perform this operation on all nodes. |
enforce_storage_move |
[Optional] Use this to expedite dropping a location. If you set this argument to |
Privileges
Retiring a Shared Location
When you create a storage location in a shared HDFS location, Vertica creates subdirectories for each node to prevent conflicts. For example, suppose you create a shared storage location in /data. The location for v_vmartdb_node0001 is /data/v_vmartdb_node0001, the location for v_vmartdb_node0002 is /data/v_vmartdb_node0002, and so on. To retire a location on only one node, use the node-specific path such as /data/v_vmartdb_node0002. To retire a location on all nodes, use the same path that you used to create it (/data in this example).
Note: Vertica does not identify NFS as a shared file system.
Effects of Retiring a Storage Location
When you use this function, Vertica checks that the location is not the only storage for data and temp files. At least one location must exist on each node to store data and temp files. However, you can store both sorts of files in either the same location or separate locations.
Note: If a location is the last available storage for its associated objects, you cannot retire it unless you set enforce_storage_move
to true
When you retire a storage location:
- No new data is stored at the retired location, unless you first restore it with the RESTORE_LOCATION() function.
- By default, if the storage location being retired contains stored data, the data is not moved. Thus, you cannot drop the storage location. Instead, Vertica removes the stored data through one or more mergeouts. If you want to drop the location immediately after retiring it, add the enforce_storage_move parameter, using a value of
true
. - If the storage location being retired is used only for temp files or you use enforce_storage_move, you can drop the location. See Dropping Storage Locations in the Administrators Guide and the DROP_LOCATION() function.
Monitoring Storage Locations
Disk storage information that the database uses on each node appears in the V_MONITOR.DISK_STORAGE system table.
Examples
The following examples show two approaches to retiring a storage location.
You can specify that a storage location be dropped automatically at a future time:
=> SELECT RETIRE_LOCATION ('/data' , 'v_vmartdb_node0004');
You can also specify that a storage location be dropped immediately:
=> SELECT RETIRE_LOCATION ('/data' , 'v_vmartdb_node0004', true);