SHOW SESSIONS¶
The SHOW SESSIONS
statement shows the information of all the sessions. It can also show a specified session with its ID.
Precautions¶
When you log in to the database using Nebula Console, a session will be created. The client will execute the API release
to release the session and clear the session information when you run exit
after the operation ends.
If you exit the database in unexpected ways with the session_idle_timeout_secs
in nebula-graphd.conf undetermined, the session will not be released automatically.
For those sessions that are not automatically released, you need to delete them manually (TODO: coding).
Syntax¶
SHOW SESSIONS;
SHOW SESSION <Session_Id>;
Examples¶
nebula> SHOW SESSIONS;
+------------------+----------+--------------------+----------------------------+----------------------------+---------------+----------+----------------+
| SessionId | UserName | SpaceName | CreateTime | UpdateTime | GraphAddr | Timezone | ClientIp |
+------------------+----------+--------------------+----------------------------+----------------------------+---------------+----------+----------------+
| 1623305056644097 | "user1" | "" | 2021-06-10T06:04:16.644097 | 2021-06-10T06:04:16.638039 | "graphd:9669" | 0 | "172.22.xx.xx" |
+------------------+----------+--------------------+----------------------------+----------------------------+---------------+----------+----------------+
| 1623304491050858 | "root" | "basketballplayer" | 2021-06-10T05:54:51.50858 | 2021-06-10T06:17:31.5417 | "graphd:9669" | 0 | "172.22.xx.xx" |
+------------------+----------+--------------------+----------------------------+----------------------------+---------------+----------+----------------+
nebula> SHOW SESSION 1623304491050858;
+--------------+-----------------------------+
| VariableName | Value |
+--------------+-----------------------------+
| "SessionID" | 1623304491050858 |
+--------------+-----------------------------+
| "UserName" | "root" |
+--------------+-----------------------------+
| "SpaceName" | "basketballplayer" |
+--------------+-----------------------------+
| "CreateTime" | 2021-06-10T05:54:51.50858 |
+--------------+-----------------------------+
| "UpdateTime" | 2021-06-10T06:17:34.866137 |
+--------------+-----------------------------+
| "GraphAddr" | "graphd:9669" |
+--------------+-----------------------------+
| "Timezone" | 0 |
+--------------+-----------------------------+
| "ClientIp" | "172.22.xx.xx" |
+--------------+-----------------------------+
Parameter | Description |
---|---|
SessionId |
The session ID, namely the identifier of a session. |
UserName |
The username in a session. |
SpaceName |
The name of the graph space that the user uses currently. It is null ("" ) when you first log in because there is no specified graph space. |
CreateTime |
The time when the session is created, namely the time when the user logs in. The time zone is specified by timezone_name in the configuration file. |
UpdateTime |
The system will update the time when there is an operation. The time zone is specified by timezone_name in the configuration file. |
GraphAddr |
The IP address and port of the Graph server that hosts the session. |
Timezone |
A reserved parameter that has no specified meaning for now. |
ClientIp |
The IP address of the client. |
Last update: July 27, 2021