查看某时刻oracle客户端链接数以及客户端服务器的名称
发布时间:2020-12-12 16:12:06 所属栏目:百科 来源:网络整理
导读:1、查看oracle的链接数 select username,count(username) from v$session where username is not null group by username 这个时候你经常会遇到权限不足的提示,接下来看的过程中也有相同的提示,因此,我建议是登陆oracle服务器用sysdba的方式启动sqlplus,
1、查看oracle的链接数 select username,count(username) from v$session where username is not null group by username 这个时候你经常会遇到权限不足的提示,接下来看的过程中也有相同的提示,因此,我建议是登陆oracle服务器用sysdba的方式启动sqlplus,这样你的查询权限就天下无敌了 2、以oracle账号登陆oracle服务器,在命令行中输入 connect "/as sysdba"进入sqlplus,执行上边的sql,就能看到链接数了 3、我想看机器名咋办,默认的v$session中是没有的,那就创建触发器加上 create or replace trigger on_logon_trigger after logon on database begin dbms_application_info.set_client_info(sys_context('userenv','ip_address')); end; / 注意,创建触发器后边的那个斜线不是我手痒加上的,不加这个,你执行不了 4、加上触发器后再执行查看sql select sid,serial#,username,program,machine,client_info from v$session where username is not null order by username,machine; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |