Who’s running in parallel?

The below script will query the database for the users running parallel queries.

SELECT  case when  px.qcinst_id is NUll then username
             ELSE ‘ – ‘|| LOWER(SUBSTR(s.program,LENGTH(s.program)- 4, 4))
             end as “User name”
        , case when px.qcinst_id is NULL then ‘QC’ else ‘(Slave)’ end as  “QC/Slave”
        ,TO_CHAR(px.server_set) “Slave Set”
        ,TO_CHAR(s.SID) “SID”
        ,case when px.qcinst_id is NULL then TO_CHAR(s.SID) else to_char(px.qcsid) end as  “QC SID”
        ,px.req_degree “Requested DOP”
        ,px.DEGREE “Actual DOP”
        ,s.osuser “User_id”
        ,s.status
        ,s.schemaname “Schema”
    FROM v$px_session px
    JOIN v$session s on px.SID = s.SID
                    AND px.serial# = s.serial#
ORDER BY 5 ,1 DESC

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>