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,则该命令将检索指定数据库的所有架构的记录。If you don't specify a
db_name, then:如果存在当前数据库,则该命令将检索当前数据库中所有架构的记录。
如果当前没有数据库,则该命令将检索账户中所有数据库和架构的记录。
如果您指定关键字
SCHEMA,那么:If you specify a qualified schema name (for example,
my_database.my_schema), then the command retrieves records for the specified database and schema.如果您指定了未限定的
schema_name,那么:如果存在当前数据库,则该命令将检索当前数据库中指定架构的记录。
如果当前没有数据库,则该命令会显示错误
SQL compilation error: Object does not exist, or operation cannot be performed。
If you don't specify a
schema_name, then:如果当前有数据库,那么:
如果当前存在架构,则该命令将检索当前数据库中当前架构的记录。
如果不存在当前架构,则该命令将检索当前数据库中所有架构的记录。
如果当前没有数据库,则该命令将检索账户中所有数据库和所有架构的记录。
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 中查询相应的视图(如果存在)。
输出¶
列 |
描述 |
|---|---|
|
Timestamp that the snapshot set was created. |
|
Name of the snapshot set. |
|
Name of the database that contains the snapshot set. |
|
Name of the schema that contains the snapshot set. |
|
Type of the object that the snapshot set is snapshotting. |
|
Name of the object that the snapshot set is snapshotting. |
|
Name of the database that contains the object being snapshotted by this snapshot set. |
|
Name of the schema that contains the object being snapshotted by this snapshot set. |
|
Name of the snapshot policy attached to this snapshot set. |
|
Name of the database that contains the snapshot policy. |
|
Name of the schema that contains the snapshot policy. |
|
Current state of the snapshot policy. |
|
Name of the role with the OWNERSHIP privilege on the snapshot set. |
|
Type of role with the OWNERSHIP privilege on the snapshot set. |
|
Comment for backup set. |
示例¶
List all snapshot sets that you have privileges for in the current account:
SHOW SNAPSHOT SETS IN ACCOUNT;
List snapshot sets that include T1 in the name:
SHOW SNAPSHOT SETS LIKE '%T1%';