SHOW SERVICE INSTANCES IN SERVICE¶
列出 服务 的实例。
命令输出通过显示每个服务实例的状态,能够清晰地呈现自动扩展和滚动升级的情况。
语法¶
SHOW SERVICE INSTANCES IN SERVICE <name>
参数¶
name指定要列出其实例的服务的标识符。
不支持带引号的特殊字符名称或区分大小写的名称。
输出¶
命令输出在以下列中提供服务实例的属性和元数据:
列 |
描述 |
|---|---|
|
在其中创建服务的数据库。 |
|
在其中创建服务的架构。 |
|
服务的名称。 |
|
以下各值之一,表示服务的当前状态:
请注意,此列中的值与 DESCRIBE SERVICE 输出中的 |
|
服务实例的 ID(这是从 0 开始的服务实例索引)。 |
|
以下各值表示服务实例的不同当前状态:
|
|
代表服务规范内容的唯一且不可变的标识符。 |
|
Snowflake 开始创建服务实例的时间。 |
|
Snowflake 确认服务实例在节点上运行的时间。 |
|
服务实例的 IP 地址。同一服务(或其他服务)的其他实例可以使用此 IP 地址来连接到特定的服务实例。 运行多个服务实例时,您可以通过以下方式在服务实例中实施 Leader 选举: |
访问控制要求¶
权限 |
对象 |
备注 |
|---|---|---|
以下任何一项权限:OWNERSHIP 或 MONITOR |
服务 |
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.
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
该命令不需要正在运行的仓库即可执行。
该命令仅返回当前用户的当前角色已获授至少一项访问权限的对象。
MANAGE GRANTS 访问权限隐式允许其持有者查看账户中的每个对象。默认情况下,只有账户管理员(具有 ACCOUNTADMIN 角色的用户)和安全管理员(具有 SECURITYADMIN 角色的用户)才具有 MANAGE GRANTS 权限。
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.
该命令 最多 返回指定对象类型的 1 万条记录,由用于执行命令的角色的访问权限决定。即使应用了筛选器,也不会返回任何超过 1 万条限制的记录。
要查看存在超过 1 万条记录的结果,请在 Snowflake Information Schema 中查询相应的视图(如果存在)。
示例¶
以下示例列出了会话的当前数据库和架构中的 echo_service 服务:
SHOW SERVICE INSTANCES IN SERVICE echo_service;
示例输出:
+---------------+-------------+--------------+----------------+-------------+--------+------------------------------------------------------------------+----------------------+----------------------+------------+
| database_name | schema_name | service_name | service_status | instance_id | status | spec_digest | creation_time | start_time | ip_address |
|---------------+-------------+--------------+----------------+-------------+--------+------------------------------------------------------------------+----------------------+----------------------+------------|
| TUTORIAL_DB | DATA_SCHEMA | ECHO_SERVICE | RUNNING | 0 | READY | 2831c241b8d64104fbc562d60764d7abd28602c70b6a8357341e8c8210b79da4 | 2025-04-25T06:01:32Z | 2025-04-25T06:01:32Z | 10.244.0.9 |
+---------------+-------------+--------------+----------------+-------------+--------+------------------------------------------------------------------+----------------------+----------------------+------------+