【oracle】查看当前连接到Oracle数据库的用户名等相关信息

                    查看当前连接到Oracle数据库的用户名等相关信息

 

select SID,AUDSID,USER#,USERNAME,STATUS,SCHEMANAME,
    OSUSER,MACHINE,TERMINAL,PROGRAM,MODULE,LOGON_TIME,PREV_EXEC_START as "last_time",
    BLOCKING_SESSION_STATUS as "bss",SERVICE_NAME,SQL_ID
    from v$session
    where audsid not in (0)
    order by LOGON_TIME desc;

注:其中PREV_EXEC_START as "last_time"为用户最后一次活动的时间;
    LOGON_TIME为用户登录时间;
   

 

你可能感兴趣的:(Oracle)