如何检查最后连接的用户,在oracle中的时间?

loading...


-1

请告诉我当用户上次登录数据库时如何查找?请告诉我如何使用该命令检查此信息 .

loading...

2回答

  • 1

    启用审核 .

    然后审计连接 - 非常简单的命令

    audit connect
    

    Docs Link Here

    然后做一些连接 .

    然后查询sys.dba_audit_session -

    SELECT
        username,
        timestamp
    FROM
        sys.dba_audit_session
    WHERE
        username = 'HR' -- the user you care about
        AND action_name = 'LOGON'
    ORDER BY
        timestamp DESC
    FETCH FIRST 1 ROWS ONLY -- in 11g or older just also say where rownum < 2
    

  • 0

    试试这个:

    select username, machine, to_char(logon_time,'HH:MM:SS')
    from v$session 
    where username='SYS'  <- username
    
评论

暂时没有评论!