CREATE STORAGE POLICY
Note:
Storage policies describe self-managed local-to-remote tiering. They do not configure warehouse object storage or cluster caches in VeloDB Cloud. See storage layout for the Cloud storage model. The statement syntax is retained for compatibility reference.
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 testPolicyPROPERTIES("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 testPolicyPROPERTIES("storage_resource" = "s3","cooldown_ttl" = "1d");