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.

另请参阅:

CREATE SNAPSHOT SET, ALTER SNAPSHOT SET, DROP SNAPSHOT SET

语法

SHOW SNAPSHOT SETS
   [ LIKE '<pattern>' ]
   [ IN { ACCOUNT | DATABASE | DATABASE <db_name> | SCHEMA | SCHEMA <schema_name> } ]
Copy

参数

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 中查询相应的视图(如果存在)。

输出

描述

created_on

Timestamp that the snapshot set was created.

name

Name of the snapshot set.

database_name

Name of the database that contains the snapshot set.

schema_name

Name of the schema that contains the snapshot set.

object_kind

Type of the object that the snapshot set is snapshotting.

object_name

Name of the object that the snapshot set is snapshotting.

object_database_name

Name of the database that contains the object being snapshotted by this snapshot set.

object_schema_name

Name of the schema that contains the object being snapshotted by this snapshot set.

snapshot_policy_name

Name of the snapshot policy attached to this snapshot set.

snapshot_policy_database_name

Name of the database that contains the snapshot policy.

snapshot_policy_schema_name

Name of the schema that contains the snapshot policy.

comment

Comment for snapshot set.

owner

Name of the role with the OWNERSHIP privilege on the snapshot set.

owner_role_type

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;
Copy

List snapshot sets that include T1 in the name:

SHOW SNAPSHOT SETS LIKE '%T1%';
Copy
语言: 中文