SHOW SNAPSHOT POLICIES --- Deprecated

Lists all the snapshot policies in your account for which you have access privileges.

こちらもご参照ください。

CREATE SNAPSHOT POLICY --- DeprecatedALTER SNAPSHOT POLICY --- DeprecatedDROP SNAPSHOT POLICY --- Deprecated

構文

SHOW SNAPSHOT POLICIES
   [ LIKE '<pattern>' ]
   [ IN { ACCOUNT | DATABASE | DATABASE <db_name> | SCHEMA | SCHEMA <schema_name> }
     [ STARTS WITH '<name_string>' ]
     [ LIMIT <rows> [ FROM '<name_string>' ]
   ]
Copy

パラメーター

LIKE 'pattern'

オプションで、オブジェクト名でコマンド出力をフィルタリングします。フィルターは、 SQL ワイルドカード文字(% および _)をサポートする、 大文字と小文字を区別しない パターンマッチングを使用します。

たとえば、次のパターンは 同じ 結果を返します。

... LIKE '%testing%' ...
... LIKE '%TESTING%' ...

. デフォルト: 値なし(フィルタリングは出力に非適用)。

[ IN ... ]

Optionally specifies the scope of the command. Specify one of the following:

キーワード ACCOUNT を指定すると、コマンドは、現在のアカウントのデータベースすべてにあるすべてのスキーマの記録を取得します。

キーワード DATABASE を指定すると、次のようになります。

  • db_name を指定すると、コマンドは、指定されたデータベースのスキーマすべての記録を取得します。

  • :samp:`{db_name}`を指定しない場合、以下のようになります:

    • 現在のデータベースがある場合、コマンドは、現在のデータベースにあるスキーマすべての記録を取得します。

    • 現在のデータベースがない場合、コマンドは、アカウントにあるすべてのデータベースとスキーマの記録を取得します。

キーワード SCHEMA を指定すると、次のようになります。

  • 修飾されたスキーマ名(例: my_database.my_schema)を指定すると、コマンドは、指定されたデータベースとスキーマの記録を取得します。

  • 修飾されていない schema_name を指定すると、次のようになります。

    • 現在のデータベースがある場合、コマンドは、現在のデータベースにある指定されたスキーマの記録を取得します。

    • 現在のデータベースがない場合、コマンドは、エラー SQL compilation error: Object does not exist, or operation cannot be performed を表示します。

  • :samp:`{schema_name}`を指定しない場合、以下のようになります:

    • 現在のデータベースがある場合は、次のようになります。

      • 現在のスキーマがある場合、コマンドは、現在のデータベースにある現在のスキーマの記録を取得します。

      • 現在のスキーマがない場合、コマンドは、現在のデータベースにあるスキーマすべての記録を取得します。

    • 現在のデータベースがない場合、コマンドは、アカウントにあるすべてのデータベースとすべてのスキーマの記録を取得します。

STARTS WITH 'name_string'

Optionally filters the command output based on the characters that appear at the beginning of the object name. The string must be enclosed in single quotes and is case sensitive.

For example, the following strings return different results:

... STARTS WITH 'B' ...
... STARTS WITH 'b' ...

. Default: No value (no filtering is applied to the output)

LIMIT rows [ FROM 'name_string' ]

Optionally limits the maximum number of rows returned, while also enabling "pagination" of the results. The actual number of rows returned might be less than the specified limit. For example, the number of existing objects is less than the specified limit.

The optional FROM 'name_string' subclause effectively serves as a "cursor" for the results. This enables fetching the specified number of rows following the first row whose object name matches the specified string:

  • The string must be enclosed in single quotes and is case sensitive.

  • The string does not have to include the full object name; partial names are supported.

Default: No value (no limit is applied to the output)

注釈

For SHOW commands that support both the FROM 'name_string' and STARTS WITH 'name_string' clauses, you can combine both of these clauses in the same statement. However, both conditions must be met or they cancel out each other and no results are returned.

In addition, objects are returned in lexicographic order by name, so FROM 'name_string' only returns rows with a higher lexicographic value than the rows returned by STARTS WITH 'name_string'.

For example:

  • ... STARTS WITH 'A' LIMIT ... FROM 'B' would return no results.

  • ... STARTS WITH 'B' LIMIT ... FROM 'A' would return no results.

  • ... STARTS WITH 'A' LIMIT ... FROM 'AB' would return results (if any rows match the input strings).

使用上の注意

  • コマンドは、コマンドを実行するために使用されるロールのアクセス権限によって決定された通り、指定されたオブジェクトタイプに対して 最大 1万件の記録を返します。1万件を超える記録は、フィルターを適用しても返されません。

    1万件を超える記録が存在する結果を表示するには、 Snowflake Information Schema で対応するビュー(存在する場合)をクエリします。

スナップショットポリシーがスナップショットセットに関連付けられているかどうかを確認するには、を使用します。 SHOWSNAPSHOTSETS コマンド。

注釈

スナップショットポリシーは、特定のスキーマとデータベース内にあるオブジェクトです。したがって、ポリシーは、それを含むスキーマとデータベースでこれらの操作が実行されるときに、複製、削除、削除解除などになります。スナップショットポリシーが任意のスナップショットセットに関連付けられているため、スナップショットポリシーをドロップできない場合は、ポリシーを含むスキーマまたはデータベースもドロップできません。

出力

説明

created_on

タイムスタンプスナップショットポリシーが作成されました。

name

スナップショットポリシーの名前。

database_name

スナップショットポリシーを含むデータベースの名前。

schema_name

スナップショットポリシーを含むスキーマの名前。

owner

のロールの名前 OWNERSHIP スナップショットポリシーの権限。

comment

スナップショットポリシーのコメント。

schedule

スナップショット作成のスケジュール。

expire_after_days

スナップショットの有効期限が切れるときのスナップショット作成後からの日数。

has_retention_lock

ポリシーに保持ロックが含まれているかどうかを示します。

ポリシーに保持ロックがある場合は Y、それ以外の場合は N

詳細については、保持ロック をご参照ください。

owner

フェールオーバーグループに対する OWNERSHIP 権限を持つロールの名前。

owner_role_type

スナップショットポリシーに対する OWNERSHIP 権限を持つロールのタイプ。

現在のアカウントで権限を持つすべてのスナップショットポリシーをリストします。

SHOW SNAPSHOT POLICIES IN ACCOUNT;
Copy