RE: hacking V$MYSTAT into "V$MYSESSION"
Date: Sun, 31 Mar 2019 21:36:21 -0400
Message-ID: <000901d4e82b$57aed3a0$070c7ae0$_at_rsiz.com>
and (no disagreement, just and…) gv$session if RAC with allowing non-local px.
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Sayan Malakshinov
Sent: Friday, March 29, 2019 5:42 PM
To: Luis Santos
Cc: odenysenko_at_gmail.com; oracle_at_dunbar-it.co.uk; ORACLE-L
Subject: Re: hacking V$MYSTAT into "V$MYSESSION"
In case of parallel queries you can have more than 1 session :)
Simple example:
declare
cursor c is select/*+ parallel(4) */ * from all_objects;
crow c%rowtype;
begin
open c;
fetch c into crow;
for r in (select s.sid,s.serial#,px.qcsid,px.qcserial# from v$session s, v$px_session px where s.audsid=userenv('sessionid') and s.sid=px.sid) loop
dbms_output.put_line('Sid:'|| r.sid ||', serial#:'|| r.serial# ||' qcsid='|| r.qcsid);
end loop;
end;
/
or another example - just just one simple query:
with v as (select/*+ parallel(4) materialize */ count(*) from all_objects)
select/*+ parallel(8) */
px.sid,px.serial#,qcsid,qcserial#
,s.*
from v,v$session s, v$px_session px
where
s.audsid=userenv('sessionid')
and s.sid=px.sid(+)
and s.serial#=px.serial#
/
On Fri, Mar 29, 2019 at 10:54 PM Luis Santos <lsantos_at_pobox.com> wrote:
Sounds reasonable, but V$SESSION is not V$SESSIONS... :-)
from mobile
Em sex, 29 de mar de 2019 15:43, Oleksandr Denysenko <odenysenko_at_gmail.com> escreveu:
I think v$mysession is really good for my current session,
but v$mysessions is good for all my(current user) sessions.
пт, 29 мар. 2019 г., 20:39 Norman Dunbar <oracle_at_dunbar-it.co.uk>:
On 29/03/2019 18:29, Oleksandr Denysenko wrote:> hi.
>
> just re-read requirements
> "(current and possibly other sessions from the same user)"
I sit corrected, thank you very much. Apologies.
Note to self, remember to read the text before jumping in with both feet!
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 -- Best regards, Sayan Malakshinov Oracle performance tuning engineer Oracle ACE Associate http://orasql.org -- http://www.freelists.org/webpage/oracle-lReceived on Mon Apr 01 2019 - 03:36:21 CEST