MOVE_RETIRED_LOCATION_DATA

Moves all data from either a single retired storage location or all retired storage locations in the database. This function migrates the data to non-retired storage locations based on the storage policies of the objects whose data is stored in the location.

Syntax

MOVE_RETIRED_LOCATION_DATA(['location_path'] ['node'])

Arguments

['location_path']

The path of the storage location as listed in the LOCATION_PATH column of the STORAGE_LOCATIONS system table. You must have previously marked this storage location as retired.

Default Value: If you do not supply a storage location path, this function moves data from all retired storage locations.

['node']

A specific node on which to move the retired storage location's data.

Default Value: If you do not specify a node, all nodes in the cluster move data from the retired location or locations. If a node does not define the storage location, this function returns an error.

Privileges

The user must be a superuser .

Usage Considerations

This function forces the Tuple Mover to move data out of the retired location or locations. Normally, the Tuple Mover only migrates data out of retired storage locations as it consolidates data into larger ROS containers. This function does not return until all of the data has moved off of the retired storage location or locations.

Examples

The following example:

  1. Queries the STORAGE_LOCATIONS system table to show which storage locations are retired.
  2. Queries the STORAGE_CONTAINERS system table to show the current location of the messages table, which is currently stored in the retired storage location named ssd.
  3. Calls MOVE_RETIRED_LOCATION_DATA to move the data off of the ssd storage location.
  4. Repeats the previous query to show the storage location of the messages table.
=> SELECT node_name, location_path, location_label, is_retired FROM STORAGE_LOCATIONS 
   WHERE is_retired = 't';
    node_name     |    location_path     | location_label | is_retired
------------------+----------------------+----------------+------------
 v_vmart_node0001 | /home/dbadmin/SSDLoc | ssd            | t
 v_vmart_node0002 | /home/dbadmin/SSDLoc | ssd            | t
 v_vmart_node0003 | /home/dbadmin/SSDLoc | ssd            | t
(3 rows)

=> SELECT node_name, total_row_count, storage_type, location_label FROM STORAGE_CONTAINERS 
   WHERE projection_name ILIKE 'messages%';
    node_name     | total_row_count | storage_type | location_label
------------------+-----------------+--------------+----------------
 v_vmart_node0001 |          333514 | ROS          | ssd
 v_vmart_node0001 |          333255 | ROS          | ssd
 v_vmart_node0002 |          333255 | ROS          | ssd
 v_vmart_node0002 |          333231 | ROS          | ssd
 v_vmart_node0003 |          333231 | ROS          | ssd
 v_vmart_node0003 |          333514 | ROS          | ssd
(6 rows)

=> SELECT MOVE_RETIRED_LOCATION_DATA('/home/dbadmin/SSDLoc');
          MOVE_RETIRED_LOCATION_DATA
-----------------------------------------------
 Move data off retired storage locations done

(1 row)

=> SELECT node_name, total_row_count, storage_type, location_label FROM storage_containers 
   WHERE projection_name ILIKE 'messages%';
    node_name     | total_row_count | storage_type | location_label
------------------+-----------------+--------------+----------------
 v_vmart_node0001 |          333255 | ROS          | base
 v_vmart_node0001 |          333514 | ROS          | base
 v_vmart_node0003 |          333514 | ROS          | base
 v_vmart_node0003 |          333231 | ROS          | base
 v_vmart_node0002 |          333231 | ROS          | base
 v_vmart_node0002 |          333255 | ROS          | base
(6 rows)

See Also