查询Oracle当前所有连接信息:
SELECT
s.sid AS 会话ID,
s.serial# AS 序列号,
s.username AS 用户名,
s.osuser AS 操作系统用户,
s.machine AS 客户端机器,
s.program AS 客户端程序,
s.status AS 会话状态,
s.sql_id AS 正在执行的SQL_ID,
t.sql_text AS 正在执行的SQL文本
FROM
v$session s
LEFT JOIN
v$sql t
ON
s.sql_id = t.sql_id;
查询MySQL当前所有连接信息:
SELECT
id AS 连接ID,
user AS 用户名,
host AS 客户端主机,
db AS 数据库,
command AS 命令,
time AS 运行时间,
state AS 状态,
info AS 查询信息
FROM
information_schema.processlist;
在这两个查询中,我为每个字段添加了中文别名,以提高查询结果的可读性文章来源地址https://www.toymoban.com/news/detail-662182.html
文章来源:https://www.toymoban.com/news/detail-662182.html
到了这里,关于查询Oracle和MySQL数据库中当前所有连接信息的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!