SHOW SNAPSHOT SETS¶
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.
语法¶
SHOW SNAPSHOT SETS
[ LIKE '<pattern>' ]
[ IN { ACCOUNT | DATABASE | DATABASE <db_name> | SCHEMA | SCHEMA <schema_name> } ]
参数¶
LIKE 'pattern'(可选)按对象名称筛选命令输出。筛选器使用 不区分大小写 的模式匹配,并支持 SQL 通配符(
%和_)。例如,以下模式返回 相同的 结果:
... LIKE '%testing%' ...... LIKE '%TESTING%' .... 默认:无值(不对输出应用筛选)。
[ IN { ACCOUNT | DATABASE | DATABASE db_name | SCHEMA | SCHEMA schema_name } ]如果您指定关键字
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:如果当前有数据库,那么:
如果当前存在架构,则该命令将检索当前数据库中当前架构的记录。
如果不存在当前架构,则该命令将检索当前数据库中所有架构的记录。
如果当前没有数据库,则该命令将检索账户中所有数据库和所有架构的记录。
使用说明¶
该命令 最多 返回指定对象类型的 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. |
|
Comment for snapshot set. |
|
Name of the role with the OWNERSHIP privilege on the snapshot set. |
|
Type of role with the OWNERSHIP privilege on the snapshot 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%';