Re: hacking V$MYSTAT into "V$MYSESSION"

From: Oleksandr Denysenko <odenysenko_at_gmail.com>
Date: Fri, 29 Mar 2019 20:29:57 +0200
Message-ID: <CAGrQTgM-_GhOPNnBHrJN+jGSY8_U3iJJYiV36zctwUkX-Bnzow_at_mail.gmail.com>



hi.

just re-read requirements
"(current and possibly other sessions from the same user)"

пт, 29 мар. 2019 г., 20:26 Norman Dunbar <oracle_at_dunbar-it.co.uk>:

> On 29/03/2019 13:39, Oleksandr Denysenko wrote:
> > Hi,
> >
> > like this one ?
> >
> > create view SYS.v_$mysession as select * from v$session where
> > username=user;
>
> Log in to the same user twice, or more, then run a select from the view
> again - I rather suspect it might fail.
>
> I would change the WHERE clause to something more selective, such as,
> for example, maybe:
>
> where sid = (select sid from v$mystat where rownum = 1)
>
> Or, grab some data from SYS_CONTEXT('USERENV', '???') that could be used.
>
> Or there might be something you can do with AUDSID (If that's the
> correct name for it) etc etc etc.
>
> Most of my databases have numerous connections to the same user which
> would fail the original view's code.
>
> (Unless I'm talking complete and utter nonsense (again) of course, I'm
> not sitting at or near a database at the moment.)
>
>
> Cheers,
> Norm.
>
> --
> Norman Dunbar
> Dunbar IT Consultants Ltd
>
> Registered address:
> 27a Lidget Hill
> Pudsey
> West Yorkshire
> United Kingdom
> LS28 7LG
>
> Company Number: 05132767
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 29 2019 - 19:29:57 CET

Original text of this message