メインコンテンツまでスキップ
バージョン: 4.x

SHOW STORAGE POLICY

デスクリプション

すべての/指定されたストレージポリシーに関連付けられたTableとパーティションを表示します。

Syntax

SHOW STORAGE POLICY [ USING [ FOR <storage_policy_name> ] ]

必須パラメータ

<storage_policy_name>

表示するストレージポリシーの名前。

このSQLコマンドを正常に実行するための前提条件は、ADMIN_PRIV権限を持つことです。権限ドキュメントを参照してください。

Privilege (Privilege)Object (Object)注釈 (注釈)
ADMIN_PRIVクラスタ全体の管理権限NODE_PRIVを除くすべての権限

  1. 有効化されたストレージポリシーを持つすべてのオブジェクトを表示する。

    show storage policy using;
    +-----------------------+-----------------------------------------+----------------------------------------+------------+
    | PolicyName | Database | Table | Partitions |
    +-----------------------+-----------------------------------------+----------------------------------------+------------+
    | test_storage_policy | regression_test_cold_heat_separation_p2 | table_with_storage_policy_1 | ALL |
    | test_storage_policy | regression_test_cold_heat_separation_p2 | partition_with_multiple_storage_policy | p201701 |
    | test_storage_policy_2 | regression_test_cold_heat_separation_p2 | partition_with_multiple_storage_policy | p201702 |
    | test_storage_policy_2 | regression_test_cold_heat_separation_p2 | table_with_storage_policy_2 | ALL |
    | test_policy | db2 | db2_test_1 | ALL |
    +-----------------------+-----------------------------------------+----------------------------------------+------------+
  2. ストレージポリシー test_storage_policy を使用してオブジェクトを表示します。

    show storage policy using for test_storage_policy;
    +---------------------+-----------+---------------------------------+------------+
    | PolicyName | Database | Table | Partitions |
    +---------------------+-----------+---------------------------------+------------+
    | test_storage_policy | db_1 | partition_with_storage_policy_1 | p201701 |
    | test_storage_policy | db_1 | table_with_storage_policy_1 | ALL |
    +---------------------+-----------+---------------------------------+------------+
  3. すべてのストレージポリシーのプロパティを表示します。

    show storage policy;
    +-------------+----------+---------+---------+-----------------+------------------+-------------+
    | PolicyName | Id | Version | タイプ | StorageResource | CooldownDatetime | CooldownTtl |
    +-------------+----------+---------+---------+-----------------+------------------+-------------+
    | test_policy | 14589252 | 0 | STORAGE | remote_s3 | -1 | 300 |
    | dev_policy | 14589521 | 0 | STORAGE | remote_s3 | -1 | 3000 |
    +-------------+----------+---------+---------+-----------------+------------------+-------------+