Skip to main content

CREATE STORAGE POLICY

Description​

To create a storage policy, you must first create a storage resource, and then associate the created storage resource name when creating the migration policy. For details, refer to the RESOURCE section.

Syntax​

CREATE STORAGE POLICY <policy_name>
PROPERTIES(
"storage_resource" = "<storage_resource_name>"
[{, "cooldown_datetime" = "<cooldown_datetime>"
| , "cooldown_ttl" = "<cooldown_ttl>"}]
);

Required Parameters​

  1. <policy_name>: The name of the storage policy to be created
  2. <storage_resource_name>: The name of the associated storage resource. For details on how to create it, refer to the RESOURCE section

Optional Parameters​

  1. <cooldown_datetime>: Specifies the cooldown time for creating the data migration policy
  2. <cooldown_ttl>: Specifies the duration of hot data for creating the data migration policy

Access Control Requirements​

The prerequisite for successfully executing this SQL command is to have ADMIN_PRIV privileges. Refer to the privilege document.

PrivilegeObjectNotes
ADMIN_PRIVEntire cluster management privilegesAll privileges except NODE_PRIV

Examples​

  1. Create a data migration policy with a specified data cooldown time.

    CREATE STORAGE POLICY testPolicy
    PROPERTIES(
    "storage_resource" = "s3",
    "cooldown_datetime" = "2022-06-08 00:00:00"
    );
  2. Create a data migration policy with a specified duration of hot data

    CREATE STORAGE POLICY testPolicy
    PROPERTIES(
    "storage_resource" = "s3",
    "cooldown_ttl" = "1d"
    );