常用sql语句-查看v$session中与客户端有关的会话信息

--Oracle用户名

select t.username,count(*) from v$session t where type<> 'BACKGROUND'  group by username order by 2 desc;

--操作系统客户端用户名

select t.osuser,count(*) from v$session t where type<> 'BACKGROUND'  group by osuser order by 2 desc;

--操作系统机器名称

select t.MACHINE,count(*) from v$session t where type<> 'BACKGROUND'  group by MACHINE order by 2 desc;

--操作系统程序名称

select t.PROGRAM,count(*) from v$session t where type<> 'BACKGROUND'  group by PROGRAM order by 2 desc;

--通过调用DBMS_APPLICATION_INFO.SET_MODULE过程,设置的当前执行模块的名称

select t.MODULE,count(*) from v$session t where type<> 'BACKGROUND'  group by MODULE order by 2 desc;

--通过调用DBMS_APPLICATION_INFO.SET_ACTION过程 设置的当前正在执行的动作的名称

select t.ACTION,count(*) from v$session t where type<> 'BACKGROUND'  group by ACTION order by 2 desc;

Related Posts