Oracle 数据库,使用 sql 或 em 查找所有活动数据库会话(对于所有用户)登录时间(从什么时候开始)的简单方法是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4949207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle Database, What is an easy way to find all active db sessions (for all users) log in time (since when) using sql or em?
提问by magqq
Oracle DBAs, What is an easy way to find all active db sessions (for all users) log in time (since when)? I checked the sys view v$session and v$active_session_history, could not get that infor I want. I also checked on em client and em, seems no pages are showing it.
Oracle DBA,找到所有活动数据库会话(对于所有用户)登录时间(从什么时候开始)的简单方法是什么?我检查了系统视图 v$session 和 v$active_session_history,无法获得我想要的信息。我还检查了 em 客户端和 em,似乎没有页面显示它。
回答by Justin Cave
What, exactly, do you mean by "active"? If you mean Oracle's definition of active-- that the session is executing a SQL statement at this exact instant in time, I would think
您所说的“主动”究竟是什么意思?如果你的意思是 Oracle 对活动的定义——会话正在这个确切的时刻执行 SQL 语句,我会认为
SELECT username, status, logon_time
FROM v$session
WHERE status = 'ACTIVE'
If you have a different definition of "active" or if you are trying to determine the front-end user name in a three-tier application, can you explain your requirements a bit more?
如果您对“活动”有不同的定义,或者您正在尝试确定三层应用程序中的前端用户名,您能否再解释一下您的要求?