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β
<policy_name>
: The name of the storage policy to be created<storage_resource_name>
: The name of the associated storage resource. For details on how to create it, refer to the RESOURCE section
Optional Parametersβ
<cooldown_datetime>
: Specifies the cooldown time for creating the data migration policy<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.
Privilege | Object | Notes |
---|---|---|
ADMIN_PRIV | Entire cluster management privileges | All privileges except NODE_PRIV |
Examplesβ
-
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"
); -
Create a data migration policy with a specified duration of hot data
CREATE STORAGE POLICY testPolicy
PROPERTIES(
"storage_resource" = "s3",
"cooldown_ttl" = "1d"
);