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 --- Deprecated、 ALTER SNAPSHOT SET --- Deprecated、 DROP 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>' ]
]
パラメーター¶
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'andSTARTS 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 bySTARTS 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 で対応するビュー(存在する場合)をクエリします。
出力¶
列 |
説明 |
|---|---|
|
スナップショットセットが作成されたときのタイムスタンプ。 |
|
スナップショットの名前。 |
|
シークレットを含むデータベースの名前。 |
|
スナップショットセットを含むスキーマの名前。 |
|
スナップショットセットがスナップショットするオブジェクトの型。 |
|
スナップショットセットがスナップショットしているオブジェクトの名前。 |
|
このスナップショットセットによってスナップショットされるオブジェクトを含むデータベースの名前。 |
|
このスナップショットセットによってスナップショットされるオブジェクトを含むスキーマの名前。 |
|
このスナップショットセットにアタッチされているスナップショットポリシーの名前。 |
|
スナップショットポリシーを含むデータベースの名前。 |
|
スナップショットポリシーを含むスキーマの名前。 |
|
Current state of the snapshot policy. |
|
フェールオーバーグループに対する OWNERSHIP 権限を持つロールの名前。 |
|
スナップショットセットに対する OWNERSHIP 権限を持つロールのタイプ。 |
|
Comment for backup set. |
例¶
現在のアカウントで 権限を持つすべてのスナップショットセットをリストします。
SHOW SNAPSHOT SETS IN ACCOUNT;
名前に T1 を含むスナップショットセットをリストする。
SHOW SNAPSHOT SETS LIKE '%T1%';