Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Tracking user sessions
In the spfile (init.ora) set audit_trail = db to enable auditing.
From a privileged account issue:
audit create session;
With this set up, Oracle will write a row into sys.aud$ as a session logs on, and update it with various statistics when the session logs off. The view dba_audit_session can than be queried on:
OS_USERNAME
USERNAME
USERHOST
TERMINAL
TIMESTAMP
ACTION_NAME LOGOFF_TIME LOGOFF_LREAD LOGOFF_PREAD LOGOFF_LWRITE LOGOFF_DLOCK
Note - you may want to delete data from aud$ on a regular basis. Especially since it is created in the SYSTEM tablespace.
To disable the audit, issue:
noaudit create session;
The overhead is relatively small - one insert at logon, one update at logoff. (Of course if you logon, execute one simple query and logoff, the overhead is a large fraction of the total work - you might want to view v$sysstat for the rate at which "logons cumulative" grows.
-- Regards Jonathan Lewis http://www.jlcomp.demon.co.uk/faq/ind_faq.html The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/seminar.html Public Appearances - schedule updated March 9th 2005 "slobodan the 3rd" <recursive68_at_hotmail.com> wrote in message news:93c8244b.0503300519.2ee871ec_at_posting.google.com...Received on Wed Mar 30 2005 - 08:15:33 CST
> Is there a way to track user sessions/usage over a period of
> weeeks/months. I'm looking to track when a user logins in and how long
> for, so I can generate stats on a particular users usage of the Oracle
> instance. The users are developers logging in using sqlplus typically.
> As far as I am aware there isn't a view that provides such info., is
> there a specific package that would give this sort of functionality ?
>
> TIA