Benutzer-Werkzeuge

Webseiten-Werkzeuge


dba:rac_parallel_query

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
dba:rac_parallel_query [2010/10/05 11:44] gpipperrdba:rac_parallel_query [2010/10/05 11:49] gpipperr
Zeile 19: Zeile 19:
 Script für die Analyse: Script für die Analyse:
 <code parallel.sql> <code parallel.sql>
 +
 col username for a12 col username for a12
 col "QC SID" for A6 col "QC SID" for A6
Zeile 33: Zeile 34:
 col wait_event format a30 col wait_event format a30
  
-select +SELECT   DECODE (px.qcinst_id 
-decode(px.qcinst_id,NULL,username +               , NULL, username 
-' - '||lower(substr(pp.SERVER_NAME, +               , ' - ' || LOWER (SUBSTR (pp.server_name 
-length(pp.SERVER_NAME)-4,4) ) )"Username", +                                       , LENGTH (pp.server_name) - 4 
-decode(px.qcinst_id,NULL, 'QC', '(Slave)') "QC/Slave" , +                                       , 4 
-to_char( px.server_set) "SlaveSet", +                                        )) 
-to_char(s.sid) "SID", +                ) "Username" 
-to_char(px.inst_id) "Slave INST", +       , DECODE (px.qcinst_id 
-decode(sw.state,'WAITING', 'WAIT', 'NOT WAIT' ) as STATE,      +               , NULL, 'QC' 
-case  sw.state WHEN 'WAITING' THEN substr(sw.event,1,30) ELSE NULL end as wait_event , +               , '(Slave)' 
-decode(px.qcinst_id, NULL ,to_char(s.sid) ,px.qcsid) "QC SID", +                ) "QC/Slave" 
-to_char(px.qcinst_id) "QC INST", +       , TO_CHAR (px.server_set) "SlaveSet" 
-px.req_degree "Req. DOP", +       , TO_CHAR (s.SID) "SID" 
-px.degree "Actual DOP" +       , TO_CHAR (px.inst_id) "Slave INST" 
-from gv$px_session px, +       , DECODE (sw.state 
-gv$session s , +               , 'WAITING', 'WAIT' 
-gv$px_process pp, +               , 'NOT WAIT' 
-gv$session_wait sw +                AS state 
-where px.sid=s.sid (+) +       , CASE sw.state 
-and px.serial#=s.serial#(+) +            WHEN 'WAITING' 
-and px.inst_id = s.inst_id(+) +               THEN SUBSTR (sw.event 
-and px.sid = pp.sid (+) +                          , 1 
-and px.serial#=pp.serial#(+) +                          , 30 
-and sw.sid = s.sid   +                           ) 
-and sw.inst_id = s.inst_id    +            ELSE NULL 
-order by +         END AS wait_event 
-  decode(px.QCINST_ID NULL, px.INST_ID px.QCINST_ID), +       , DECODE (px.qcinst_id 
-  px.QCSID, +               , NULL, TO_CHAR (s.SID) 
-  decode(px.SERVER_GROUP, NULL, 0, px.SERVER_GROUP) +               , px.qcsid 
-  px.SERVER_SET,  +                ) "QC SID" 
-  px.INST_ID+       , TO_CHAR (px.qcinst_id) "QC INST" 
 +       , px.req_degree "Req. DOP" 
 +       , px.DEGREE "Actual DOP" 
 +    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
 / /
  
Zeile 69: Zeile 91:
 col wait_event format a30 col wait_event format a30
  
-select  +SELECT   sw.SID AS rcvsid 
-  sw.SID as RCVSID, +       , DECODE (pp.server_name 
-  decode(pp.server_name,  +               , NULL, 'A QC' 
-         NULL, 'A QC',  +               , pp.server_name 
-         pp.server_name) as RCVR, +                AS rcvr 
-  sw.inst_id as RCVRINST, +       , sw.inst_id AS rcvrinst 
-case  sw.state WHEN 'WAITING' THEN substr(sw.event,1,30) ELSE NULL end as wait_event , +       , CASE sw.state 
-  decode(bitand(p1, 65535), +            WHEN 'WAITING' 
-         65535, 'QC',  +               THEN SUBSTR (sw.event 
-         'P'||to_char(bitand(p1, 65535),'fm000')) as SNDR, +                          , 1 
-  bitand(p1, 16711680) - 65535 as SNDRINST, +                          , 30 
-  decode(bitand(p1, 65535), +                           ) 
-         65535, ps.qcsid, +            ELSE NULL 
-         (select  +         END AS wait_event 
-            sid  +       , DECODE (BITAND (p1, 65535) 
-          from  +               , 65535, 'QC' 
-            gv$px_process  +               , 'P' || TO_CHAR (BITAND (p1, 65535), 'fm000') 
-          where  +                AS sndr 
-            server_name = 'P'||to_char(bitand(sw.p1, 65535),'fm000'and +       , BITAND (p1, 16711680) - 65535 AS sndrinst 
-            inst_id = bitand(sw.p1, 16711680) - 65535) +       , DECODE (BITAND (p1, 65535) 
-        as SNDRSID, +               , 65535, ps.qcsid 
-   decode(sw.state,'WAITING', 'WAIT', 'NOT WAIT' ) as STATE      +               , (SELECT SID 
-from  +                    FROM gv$px_process 
-  gv$session_wait sw, +                   WHERE server_name = 'P' || TO_CHAR (BITAND (sw.p1, 65535), 'fm000'
-  gv$px_process pp, +                     AND inst_id = BITAND (sw.p1, 16711680) - 65535) 
-  gv$px_session ps +                AS sndrsid 
-where +       , DECODE (sw.state 
-  sw.sid = pp.sid (+) and +               , 'WAITING', 'WAIT' 
-  sw.inst_id = pp.inst_id (+) and  +               , 'NOT WAIT' 
-  sw.sid = ps.sid (+) and +                ) AS state 
-  sw.inst_id = ps.inst_id (+) and  +    FROM gv$session_wait sw, gv$px_process pp, gv$px_session ps 
-  p1text  = 'sleeptime/senderid' and +   WHERE sw.SID = pp.SID(+) 
-  bitand(p1, 268435456) = 268435456 +     AND sw.inst_id = pp.inst_id(+) 
-order by +     AND sw.SID = ps.SID(+) 
-  decode(ps.QCINST_ID NULL, ps.INST_ID ps.QCINST_ID), +     AND sw.inst_id = ps.inst_id(+) 
-  ps.QCSID, +     AND p1text = 'sleeptime/senderid' 
-  decode(ps.SERVER_GROUP, NULL, 0, ps.SERVER_GROUP) +     AND BITAND (p1, 268435456) = 268435456 
-  ps.SERVER_SET,  +ORDER BY DECODE (ps.qcinst_id 
-  ps.INST_ID+               , NULL, ps.inst_id 
 +               , ps.qcinst_id 
 +                
 +       , ps.qcsid 
 +       , DECODE (ps.server_group 
 +               , NULL, 0 
 +               , ps.server_group 
 +                
 +       , ps.server_set 
 +       , ps.inst_id
 / /
  
Zeile 121: Zeile 152:
 col "target" for A30 col "target" for A30
  
-select +SELECT   DECODE (px.qcinst_id 
-decode(px.qcinst_id,NULL,username +               , NULL, username 
-' - '||lower(substr(pp.SERVER_NAME, +               , ' - ' || LOWER (SUBSTR (pp.server_name 
-length(pp.SERVER_NAME)-4,4) ) )"Username", +                                       , LENGTH (pp.server_name) - 4 
-decode(px.qcinst_id,NULL, 'QC', '(Slave)') "QC/Slave" , +                                       , 4 
-to_char( px.server_set) "SlaveSet", +                                        )) 
-to_char(px.inst_id) "Slave INST", +                ) "Username" 
-substr(opname,1,30)  operation_name, +       , DECODE (px.qcinst_id 
-substr(target,1,30) target, +               , NULL, 'QC' 
-sofar+               , '(Slave)' 
-totalwork+                ) "QC/Slave" 
-units+       , TO_CHAR (px.server_set) "SlaveSet" 
-start_time+       , TO_CHAR (px.inst_id) "Slave INST" 
-timestamp+       , SUBSTR (opname 
-decode(px.qcinst_id, NULL ,to_char(s.sid) ,px.qcsid) "QC SID", +               , 1 
-to_char(px.qcinst_id) "QC INST" +               , 30 
-from gv$px_session px, +                ) operation_name 
-gv$px_process pp, +       , SUBSTR (target 
-gv$session_longops s  +               , 1 
-where px.sid=s.sid  +               , 30 
-and px.serial#=s.serial# +                ) target 
-and px.inst_id = s.inst_id +       sofar 
-and px.sid = pp.sid (+) +       totalwork 
-and px.serial#=pp.serial#(+) +       units 
-order by +       start_time 
-  decode(px.QCINST_ID NULL, px.INST_ID px.QCINST_ID), +       TIMESTAMP 
-  px.QCSID, +       , DECODE (px.qcinst_id 
-  decode(px.SERVER_GROUP, NULL, 0, px.SERVER_GROUP) +               , NULL, TO_CHAR (s.SID) 
-  px.SERVER_SET,  +               , px.qcsid 
-  px.INST_ID+                ) "QC SID" 
 +       , TO_CHAR (px.qcinst_id) "QC INST" 
 +    FROM gv$px_session px, gv$px_process pp, gv$session_longops s 
 +   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#(+) 
 +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
  
 </code> </code>
dba/rac_parallel_query.txt · Zuletzt geändert: 2014/04/02 12:56 von gpipperr