Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: User connect time
The data dictionary view V$SESSION contains the logon_time
of every currently connected user session, so the difference
between SYSDATE and that column will be the user's connect
time, in days. You'll need SELECT privileges on
SYS.V$SESSION or the SELECT ANY TABLE system privilege to
select from this table.
If you want a record of all logins, similar to what
you might get via last(1) on a unix system, you'll need to
enable auditing.
To do this, you need to create the objects the auditing
subsystem needs by running
$ORACLE_HOME/rdbms/admin/cataudit.sql as SYS. Then you
need to enable auditing to the database tables by setting
the initialization parameter audit_trail to TRUE in the
initialization file (initSID.ora).
Then you need to specify what you want audited using the AUDIT
command. For example, in your case, you'd want to do
AUDIT SESSION.
Once that's done, you can SELECT from the DBA_AUDIT_SESSION
data dictionary view, where the TIMESTAMP column is the
logon time and LOGOFF_TIME is the logoff time.
-- This answer is courtesy of QuestionExchange.com http://www.questionexchange.com/servlet3/qx.usenetGuest.showUsenetGuest?ans_id=13125&cus_id=USENETReceived on Thu Apr 13 2000 - 00:00:00 CDT
![]() |
![]() |