DESCRIBE SNAPSHOT

备注

Snowflake 的支持政策和服务级别协议 中规定的服务级别目前不包括此操作。

Describes the properties of a snapshot of a block storage volume.

DESCRIBE 可以缩写为 DESC。

另请参阅:

CREATE SNAPSHOTALTER SNAPSHOTDROP SNAPSHOTSHOW SNAPSHOTS

语法

{ DESC | DESCRIBE } SNAPSHOT <name>
Copy

参数

name

指定要描述的快照的标识符。

如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。

有关更多信息,请参阅 标识符要求

输出

命令的输出包括以下列,它们描述了对象的属性和元数据:

描述

name

快照的名称。

state

以下各值之一,表示快照的当前状态:

  • INITIALIZED:正在创建快照。

  • CREATED:快照已创建,可用于创建卷。

  • ERROR:快照创建失败。

database_name

在其中创建快照的数据库。

schema_name

在其中创建快照的架构。

service_name

从中创建快照的完全限定的服务名称。

volume_name

为其创建快照的指定服务实例中的卷。

instance

服务实例的 ID。

size

快照的大小(以 GB 为单位)。

comment

关于快照的常规注释。

owner

拥有快照的角色。

owner_role_type

拥有对象的角色类型是 ROLE 或 DATABASE_ROLE。

created_on

快照的创建日期和时间。

encryption

为创建快照的卷配置的加密类型。可能的值包括 SNOWFLAKE_SSESNOWFLAKE_FULL

访问控制要求

用于执行此操作的 角色 必须至少具有以下 权限

权限

对象

备注

OWNERSHIP 或 USAGE

快照

OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege).

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.

有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色

有关对 安全对象 执行 SQL 操作的相应角色和权限授予的一般信息,请参阅 访问控制概述

使用说明

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.

    When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type".

    You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.

示例

以下示例描述了名为 my_snapshot 的快照:

DESC SNAPSHOT my_snapshot;
Copy

输出:

+-------------+---------+---------------+-------------+----------------------------------------------------+-------------+----------+------+--------------+-----------+-----------------+-------------------------------+-------------------------------+---------------+
| name        | state   | database_name | schema_name | service_name                                       | volume_name | instance | size | comment      | owner     | owner_role_type | created_on                    | updated_on                    | encryption    |
|-------------+---------+---------------+-------------+----------------------------------------------------+-------------+----------+------+--------------+-----------+-----------------+-------------------------------+-------------------------------+---------------|
| MY_SNAPSHOT | CREATED | TUTORIAL_DB   | DATA_SCHEMA | TUTORIAL_DB.DATA_SCHEMA.MY_SERVICE_WITH_EBS_VOLUME | block-vol1  | 0        |   10 | new snapshot | TEST_ROLE | ROLE            | 2024-05-09 21:36:58.502 -0700 | 2024-05-09 21:38:03.424 -0700 | SNOWFLAKE_SSE |
+-------------+---------+---------------+-------------+----------------------------------------------------+-------------+----------+------+--------------+-----------+-----------------+-------------------------------+-------------------------------+---------------+
语言: 中文