DESCRIBE SECRET

描述密钥的属性。

DESCRIBE 可以缩写为 DESC。

另请参阅:

ALTER SECRETCREATE SECRETDROP SECRETSHOW SECRETS

语法

{ DESC | DESCRIBE } SECRET <name>
Copy

参数

name

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

输出

命令输出在以下列中提供密钥属性和元数据:

描述

created_on

创建密钥的日期和时间。

name

密钥的名称。

schema_name

包含密钥的架构的名称。

database_name

包含密钥的数据库的名称。

owner

拥有密钥的角色的名称。

comment

密钥的注释,如果没有指定注释,则显示 NULL。

secret_type

OAUTH2PASSWORDGENERICSYMMETRIC_KEY

username

存储在密钥中的用户名。

oauth_access_token_expiry_time

OAuth 访问令牌过期的时间戳字符串。

oauth_refresh_token_expiry_time

OAuth 刷新令牌过期的时间戳字符串,如果密钥没有存储这个值,则显示 NULL。

oauth_scopes

在以下情况下使用的以逗号分隔的范围列表:在 OAuth 客户端凭据流程期间,对集成具有 USAGE 权限的角色从 OAuth 服务器发出请求。如果没有范围,则显示 NULL。

integration_name

密钥中引用的外部 API 身份验证集成的名称,如果密钥没有引用外部 API 身份验证集成,则显示 NULL。

algorithm

用于 对称密钥 的算法。

key_length

用于 对称密钥 的密钥长度。

访问控制要求

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

权限

对象

备注

USAGE

密钥

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 操作的相应角色和权限授予的一般信息,请参阅 访问控制概述

使用说明

  • Snowflake 从不返回 PASSWORD 属性值。

  • 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.

    The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type, then specify "type" for the identifier.

示例

描述密钥:

DESC SECRET service_now_creds_pw;
Copy
语言: 中文