Note
This view is available starting with V3.1.2.
Purpose
This view displays information about open session cursors on all nodes.
Applicability
This view is applicable only to OceanBase Database in Oracle-compatible mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(46) | NO | The IP address of the server. |
| SVR_PORT | NUMBER(38) | NO | The port number of the server. |
| SADDR | VARCHAR2(8) | NO | The memory address of the session. |
| SID | NUMBER | NO | The session ID. |
| USER_NAME | VARCHAR2(30) | NO | The username. |
| ADDRESS | VARCHAR2(8) | NO | The SQL address. Together with the SQL hash, this field uniquely identifies an SQL statement. Currently, this field is NULL. |
| HASH_VALUE | NUMBER | NO | The SQL hash. Currently, this field is NULL. |
| SQL_ID | VARCHAR2(32) | NO | The SQL ID. |
| SQL_TEXT | VARCHAR2(60) | NO | The first 60 characters of the SQL text. |
| LAST_SQL_ACTIVE_TIME | DATE | NO | The time when the SQL statement was last executed. |
| SQL_EXEC_ID | NUMBER | NO | Currently, this field is NULL. |
| CURSOR_TYPE | VARCHAR2(30) | NO | The cursor type. Currently, this field contains two values:
|
| CHILD_ADDRESS | VARCHAR2(30) | NO | This field is not supported. |
| CON_ID | NUMBER | NO | The ID of the container to which the data belongs. The current value is 1. |
Sample query
Query information about open session cursors on all nodes.
obclient[SYS]> SELECT * FROM SYS.GV$OPEN_CURSOR;
The query result is as follows:
+----------------+----------+----------+------------+-----------+---------+------------+----------------------------------+--------------------------------------------+----------------------+-------------+-------------+---------------+--------+
| SVR_IP | SVR_PORT | SADDR | SID | USER_NAME | ADDRESS | HASH_VALUE | SQL_ID | SQL_TEXT | LAST_SQL_ACTIVE_TIME | SQL_EXEC_ID | CURSOR_TYPE | CHILD_ADDRESS | CON_ID |
+----------------+----------+----------+------------+-----------+---------+------------+----------------------------------+--------------------------------------------+----------------------+-------------+-------------+---------------+--------+
| 172.xx.xxx.xxx | 2882 | dab241f0 | 3221681162 | SYS | NULL | NULL | 1253DFE0FC404832728BD3791DD83943 | select * from GV$OPEN_CURSOR | 07-MAY-25 | NULL | OPEN | NULL | 1 |
| 172.xx.xxx.xxx | 2882 | dab40b70 | 3221724339 | SYS | NULL | NULL | NULL | ALTER SYSTEM SET arbitration_timeout='30s' | 07-MAY-25 | NULL | OPEN | NULL | 1 |
| 172.xx.xxx.xxx | 2882 | 2a852b70 | 3221557889 | SYS | NULL | NULL | NULL | select * from GV$OB_GLOBAL_TRANSACTION | 07-MAY-25 | NULL | OPEN | NULL | 1 |
+----------------+----------+----------+------------+-----------+---------+------------+----------------------------------+--------------------------------------------+----------------------+-------------+-------------+---------------+--------+
3 rows in set