DESCRIBE SNAPSHOT¶
备注
Snowflake 的支持政策和服务级别协议 中规定的服务级别目前不包括此操作。
Describes the properties of a snapshot of a block storage volume.
DESCRIBE 可以缩写为 DESC。
语法¶
{ DESC | DESCRIBE } SNAPSHOT <name>
参数¶
name指定要描述的快照的标识符。
如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
有关更多信息,请参阅 标识符要求。
输出¶
命令的输出包括以下列,它们描述了对象的属性和元数据:
列 |
描述 |
|---|---|
|
快照的名称。 |
|
以下各值之一,表示快照的当前状态:
|
|
在其中创建快照的数据库。 |
|
在其中创建快照的架构。 |
|
从中创建快照的完全限定的服务名称。 |
|
为其创建快照的指定服务实例中的卷。 |
|
服务实例的 ID。 |
|
快照的大小(以 GB 为单位)。 |
|
关于快照的常规注释。 |
|
拥有快照的角色。 |
|
拥有对象的角色类型是 ROLE 或 DATABASE_ROLE。 |
|
快照的创建日期和时间。 |
|
为创建快照的卷配置的加密类型。可能的值包括 |
访问控制要求¶
权限 |
对象 |
备注 |
|---|---|---|
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.
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
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, specifySELECT "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;
输出:
+-------------+---------+---------------+-------------+----------------------------------------------------+-------------+----------+------+--------------+-----------+-----------------+-------------------------------+-------------------------------+---------------+
| 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 |
+-------------+---------+---------------+-------------+----------------------------------------------------+-------------+----------+------+--------------+-----------+-----------------+-------------------------------+-------------------------------+---------------+