Skip to main content

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​

  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"
    );

Ask AI