SHOW SESSIONS

SHOW SESSIONS语句显示所有会话信息,也可以指定会话ID进行查看。

注意事项

使用Nebula Console登录数据库时,会创建一个会话,操作结束执行exit退出登录时,客户端会调用API release,释放会话并清除会话信息。

如果没有正常退出,且没有在配置文件nebula-graphd.conf设置空闲会话超时时间(session_idle_timeout_secs),会话不会自动释放。

对于未自动释放的会话,需要手动删除指定会话(TODO: coding)。

语法

  1. SHOW SESSIONS;
  2. SHOW SESSION <Session_Id>;

示例

  1. nebula> SHOW SESSIONS;
  2. +------------------+----------+--------------------+----------------------------+----------------------------+------------------+----------+--------------------+
  3. | SessionId | UserName | SpaceName | CreateTime | UpdateTime | GraphAddr | Timezone | ClientIp |
  4. +------------------+----------+--------------------+----------------------------+----------------------------+------------------+----------+--------------------+
  5. | 1635128818397714 | "root" | "test" | 2021-10-25T02:26:58.397714 | 2021-10-25T08:31:31.846846 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  6. | 1635254859271703 | "root" | "basketballplayer" | 2021-10-26T13:27:39.271703 | 2021-10-26T13:51:38.277704 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  7. | 1634871229727322 | "root" | "basketballplayer" | 2021-10-22T02:53:49.727322 | 2021-10-22T02:53:56.564001 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  8. | 1635750725840229 | "root" | "basketballplayer" | 2021-11-01T07:12:05.840229 | 2021-11-01T09:42:36.883617 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  9. | 1635299224732060 | "root" | "basketballplayer" | 2021-10-27T01:47:04.732060 | 2021-10-27T09:04:31.741126 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  10. | 1634628999765689 | "root" | "" | 2021-10-19T07:36:39.765689 | 2021-10-19T07:36:39.768064 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  11. | 1634886296595136 | "root" | "basketballplayer" | 2021-10-22T07:04:56.595136 | 2021-10-22T09:48:20.299364 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  12. | 1634629179882439 | "root" | "basketballplayer" | 2021-10-19T07:39:39.882439 | 2021-10-19T09:34:52.153145 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  13. | 1635246158961634 | "root" | "basketballplayer" | 2021-10-26T11:02:38.961634 | 2021-10-26T11:02:51.250897 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  14. | 1634785346839017 | "root" | "basketballplayer" | 2021-10-21T03:02:26.839017 | 2021-10-21T11:07:40.911329 | "127.0.0.1:9669" | 0 | "::ffff:127.0.0.1" |
  15. +------------------+----------+--------------------+----------------------------+----------------------------+------------------+----------+--------------------+
  16. nebula> SHOW SESSION 1635254859271703;
  17. +--------------+----------------------------+
  18. | VariableName | Value |
  19. +--------------+----------------------------+
  20. | "SessionID" | 1635254859271703 |
  21. | "UserName" | "root" |
  22. | "SpaceName" | "basketballplayer" |
  23. | "CreateTime" | 2021-10-26T13:27:39.271703 |
  24. | "UpdateTime" | 2021-10-26T13:51:38.277704 |
  25. | "GraphAddr" | "127.0.0.1:9669" |
  26. | "Timezone" | 0 |
  27. | "ClientIp" | "::ffff:127.0.0.1" |
  28. +--------------+----------------------------+
参数说明
SessionId会话ID,唯一标识一个会话。
UserName会话的登录用户名称。
SpaceName用户当前所使用的图空间。刚登录时为空(“”)。
CreateTime会话的创建时间,即用户认证登录的时间。时区为配置文件中timezone_name指定的时区。
UpdateTime用户有执行操作时,会更新此时间。时区为配置文件中timezone_name指定的时区。
GraphAddr会话的Graph服务地址和端口。
Timezone保留参数,暂无意义。
ClientIp会话的客户端IP地址。

最后更新: November 1, 2021