SHOW SNAPSHOT SETS --- Deprecated

Lists all the snapshot sets for which you have access privileges. The scope of this command can be your entire account, or a specified database or schema.

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

CREATE SNAPSHOT SET --- DeprecatedALTER SNAPSHOT SET --- DeprecatedDROP SNAPSHOT SET --- Deprecated

構文

SHOW SNAPSHOT SETS
   [ 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 で対応するビュー(存在する場合)をクエリします。

出力

説明

created_on

スナップショットセットが作成されたときのタイムスタンプ。

name

スナップショットの名前。

database_name

シークレットを含むデータベースの名前。

schema_name

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

object_kind

スナップショットセットがスナップショットするオブジェクトの型。

object_name

スナップショットセットがスナップショットしているオブジェクトの名前。

object_database_name

このスナップショットセットによってスナップショットされるオブジェクトを含むデータベースの名前。

object_schema_name

このスナップショットセットによってスナップショットされるオブジェクトを含むスキーマの名前。

snapshot_policy_name

このスナップショットセットにアタッチされているスナップショットポリシーの名前。

snapshot_policy_database_name

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

snapshot_policy_schema_name

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

snapshot_policy_state

Current state of the snapshot policy.

owner_role

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

owner_role_type

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

comment

Comment for backup set.

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

SHOW SNAPSHOT SETS IN ACCOUNT;
Copy

名前に T1 を含むスナップショットセットをリストする。

SHOW SNAPSHOT SETS LIKE '%T1%';
Copy