连接系统表说明

描述

A pseudo table, generated to present information about all current connections to the NuoDB database. Only users with the SYSTEM.DBA privilege can view all connections for all users. Users that have not been granted the SYSTEM.DBA privilege will only see the connections for their user.

Client applications should never contain code that accesses SYSTEM pseudo tables as they are subject to, and furthermore likely to, change from release to release.

领域

字段名称 类型 描述

Sqlstring.

细绳

The SQL statement being executed. If the connection is currently active, but no statement is executing, the Sqlstring. is presented as an empty string.

数数

整数

A number n, indicating that this is the nth statement executed on this connection.

运行

big

microSeconds中指定的语句执行的持续时间。

用户

细绳

用于数据库连接的SQL用户。

架构

细绳

数据库连接的当前SQL模式。

numparam.

整数

The number of SQL parameters specified in the query. This is 0 if no parameters were specified or if no statement is executing.

参数

细绳

参数字符串“表示查询中指定参数的字符串。表示每个参数的字符串是格式:

n/type/value

在哪里:

n 是从0开始的参数的数量

type is the type of the variable, for example, 整数, 细绳.

value 该值是否传入参数。

每个参数字符串由空格分隔。例如:

numparam.            PARAMS
--------- ----------------------------
    2     0/string/'hello' 1/integer/

康涅狄格州

big

在数据库中所有连接中唯一的连接标识符。

打开

整数

使用此连接创建的打开语句的数量。

处理

整数

An identifier, unique only to the specific connection, that represents the executing statement. 处理 is -1 when there is no statement running on the connection.

OpenResults.

整数

此连接的打开结果集的数量。

nodeid.

整数

连接客户端的TE的标识符。

execid.

数字

A unique identifier generated for this SQL statement, specifically for use with the 杀死声明 command. execid. will be 0 when 处理 is -1, meaning that there is no statement running on the connection.

Transid.

big

The identifier for the transaction being run on the connection. This value can be used to query SYSTEM.TRANSACTIONS by ID.

跨行星

big

连接的当前开放事务的持续时间在微秒中指定。

autocommitflags.

整数

按以下值的按位映射

0x1

autocommit正在开启。

0x2

延迟AutoCommit,意味着Defer在读取操作上提交,直到结果集关闭或发生下一个操作。

0x4

AutoCommit被暂停。

isolationlevel.

整数

指定连接的事务隔离级别:

2

READ COMMITTED

4

REPEATABLE READ

7

CONSISTENT READ

8

SERIALIZABLE

客户

细绳

指定连接客户端的IP地址。由于Nuodb 2.3.2,TE将通过它用于与客户端通信的套接字提供信息。

Prior to NuoDB 2.3.2, you could set this with a connection property called clientHost.

ClientProcessid.

细绳

指定连接客户端的进程ID(PID)。这可以由驱动程序自动设置(如nuodb 2.3.2为c为the++, .NET, and Python drivers.) Otherwise, this must be given as the client connection property clientProcessID. See 连接属性 想要查询更多的信息。

ClientInfo.

细绳

Specifies the client information for the connecting client. This must be given as the client connection property clientInfo. See 连接属性 想要查询更多的信息。

autocommitspmode.

布尔基

ON or OFF. See 放 AUTOCOMMIT_SP_MODE at .

回滚码头

细绳

Either TRANSACTION, PROCEDURE, or OFF. See 放 ROLLBACK MODE at .

executionstack.

细绳

执行堆栈列详细介绍了当前正在运行的过程中的所有嵌套呼叫。堆栈顶部的当前执行语句显示在此列的顶部。

创造了

时间戳

使用NOODB建立此连接的日期和时间。

lastexecuted

时间戳

此连接上次执行SQL的日期和时间。

sqlengine.

细绳

连接使用的SQL引擎。

索引

没有任何

例子

The following example shows two rows in SYSTEM.CONNECTIONS. The second row represents the "选择 * FROM system.connections" query itself. The first row represents a SQL statement executing on another client with two parameters in the query. We use 放 OUTPUT VERTICAL because there are many columns in SYSTEM.CONNECTIONS and it is more readable if displayed this way.

In the row for the first query, we see this is the first statement run on this connection, the query has been running 2016795 microseconds, the SQL user is DBA 和 current schema is 用户, the parameters entered for the query were 'A%' and 16, etc. The autocommitflags. is set to 3 which means autocommit is on but deferred on read operations until the result set is closed or the next operation occurs. The transaction isolation level is SERIALIZABLE.

 OUTPUT VERTICAL;

选择 * FROM system.connections;
==================================== Row #1 ====================================Sqlstring.: select * from hugetable where lastname like ? and id > ?;
COUNT: 1运行: 2016795
用户: DBA
SCHEMA: 用户numparam.: 2参数: 0/细绳/A% 1/细绳/16康涅狄格州: 21474836521
打开: 2处理: 9OpenResults.: 1nodeid.: 5execid.: 166020696839479623685Transid.: 4548485跨行星: 2016689autocommitflags.: 7isolationlevel.: 8客户: 127.0.0.1ClientProcessid.: 38483ClientInfo.: nuosql
AUTOCOMMITSPMODE: FALSE回滚码头: procedureexecutionstack.:
CREATED: 2018-04-19 10:26:15.616959lastexecuted: 2018-04-19 10:39:53.891211sqlengine.: Scalar
==================================== Row #2 ====================================Sqlstring.: var x = 0; while (x < 10) execute immediate 'insert into employees.titles values (?), (?), (?);' using values 1, 2, x; x = x + 1; end_while;
COUNT: 2运行: 9214554
用户: DBA
SCHEMA: 用户numparam.: 0参数:
CONNID: 21474836522
打开: 2处理: 1OpenResults.: 1nodeid.: 5execid.: 18446744254098178053Transid.: 4548357跨行星: 9214479autocommitflags.: 5isolationlevel.: 8客户: 127.0.0.1ClientProcessid.: 38872ClientInfo.: nuosql
AUTOCOMMITSPMODE: FALSE回滚码头: procedureexecutionstack.: Procedure "SAMPLE.PROC" line 1: insert into sample.b select msleep(1000) from dual
Procedure "EMPLOYEES.PROC2" line 1: call sample.proc()
Trigger "EMPLOYEES.TITLES.TRIG1" line 1: call proc2(NEW.f1)
line 1: execute immediate 'insert into employees.titles values (?), (?), (?);' using values 1, 2, x
CREATED: 2018-04-19 10:38:18.631389lastexecuted: 2018-04-19 10:39:46.691568sqlengine.: Scalar
==================================== Row #3 ====================================Sqlstring.: 选择 * FROM system.connections;
COUNT: 4运行: 159
用户: DBA
SCHEMA: 用户numparam.: 0参数:
CONNID: 21474836523
打开: 1处理: 1OpenResults.: 0nodeid.: 5execid.: 18446744258393145349Transid.: 4548613跨行星: 81autocommitflags.: 1isolationlevel.: 8客户: 127.0.0.1ClientProcessid.: 38873ClientInfo.: nuosql
AUTOCOMMITSPMODE: FALSE回滚码头: procedureexecutionstack.:
CREATED: 2018-04-19 10:38:23.287194lastexecuted: 2018-04-19 10:39:55.906553sqlengine.: Scalar