column QCorSlave  format a6 heading "QC /|Slave"
column server_set format 99 heading "Slave|set"
column req_degree format 99 heading "Req|Deg"
column degree     format 99 heading "Act|Deg"
column wait_event format a30
select px.inst_id inst, s.sid, 
       decode(px.qcinst_id,NULL,username,' -'||lower(pp.SERVER_NAME)) username,
       decode(px.qcinst_id,NULL, 'QC', '-Slave') QCorSlave,
       px.server_set,
       substr(sw.event,1,30) wait_event ,
       px.req_degree, px.degree
  from gv$px_session px,
       gv$session s ,
       gv$px_process pp,
       gv$session_wait sw
 where px.sid=s.sid (+)
   and px.serial#=s.serial#(+)
   and px.inst_id = s.inst_id(+)
   and px.sid = pp.sid (+)
   and px.serial#=pp.serial#(+)
   and sw.sid = s.sid 
   and sw.inst_id = s.inst_id  
 order by decode(px.QCINST_ID,NULL,px.INST_ID,px.QCINST_ID),
          px.QCSID,
          decode(px.SERVER_GROUP,NULL,0,px.SERVER_GROUP),
          px.SERVER_SET,px.INST_ID;
