Re: Getting Oracle connected sessions in the past

From: Tim Gorman <tim_at_evdbt.com>
Date: Wed, 27 Jul 2016 06:45:48 -0600
Message-ID: <73270d05-3218-6b97-02f6-e0099bd00f9c_at_evdbt.com>



Consider trying...

    SQL> select u.username, count(distinct     h.session_id||','||h.session_serial#) cnt

       2  from     dba_hist_active_sess_history    h,
       3           dba_users u
       4  where    u.user_id = h.user_id
       5  group by u.username
       6* order by cnt;


Bear in mind that the DBA_HIST_ACTIVE_SESS_HISTORY view (a.k.a. ASH) is not an audit trail but instead represents sampled data with an interval of 10 seconds, so it is quite possible that entire sessions lasting less than 10 seconds could be missed.

On 7/27/16 05:59, Luis Santos wrote:
> I was thinking about a smart query on DBA_HIST_ACTIVE_SESS_HISTORY,
> seeking for distinct USER_ID column.
>
> I have to be frank: I don´t have the skills to design such a query,
> and I´m looking for a ready, already developed one.
>
>
>
> /
> /
> /--/
> /Att/
> /Luis Santos
>
> /
> /
> /
>
> 2016-07-27 8:54 GMT-03:00 Howard Latham <howard.latham_at_gmail.com
> <mailto:howard.latham_at_gmail.com>>:
>
> You can use. If turned on the audit records
>
> On 27 Jul 2016 12:49, "Luis Santos" <lsantos_at_pobox.com
> <mailto:lsantos_at_pobox.com>> wrote:
>
> I was guessing if there´s not an awr table that contains such
> info. I´m aware of DBA_HIST_RESOURCE_LIMIT, but this is
> consolidated info.
>
> /
> /
> /--/
> /Att/
> /Luis Santos
>
> /
> /
> /
>
> 2016-07-27 8:39 GMT-03:00 S3v3n11 <neisdsa_at_gmail.com
> <mailto:neisdsa_at_gmail.com>>:
>
> dba_audit_session?
>
> On Wed, Jul 27, 2016 at 6:32 AM, Luis Santos
> <lsantos_at_pobox.com <mailto:lsantos_at_pobox.com>> wrote:
>
> This simple query shows connected users in the moment
> on an Oracle instance:
>
> *select username, count(*)
> from v$session
> group by username
> order by 2*
>
>
> Is there a way to get this info on a specific time in
> the past? I know flashback queries does not work for
> V$ views (and this is absolutely reasonable)...
> /
> /
> /--/
> /Att/
> /Luis Santos
>
> /
> /
> /
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jul 27 2016 - 14:45:48 CEST

Original text of this message