【Oracle】gv$px_session 檢視介紹

楊奇龍發表於2012-04-08
在rac 系統中可以使用gv$px_session檢視來檢視系統中正在執行的並行sql的一些資訊,該檢視的欄位如下:
Column Datatype Description
INSTANCE NUMBER         rac中的節點號
SADDR  RAW(4 | 8) Session 地址
SID   NUMBER    Session identifier
SERIAL#   NUMBER    Session serial number
QCSID  NUMBER    並行協調程式的sid
QCSERIAL# NUMBER  並行協調程式的sid的序列號
QCINST_ID NUMBER  parallel coordinator所在的instance id
SERVER_GROUP NUMBER The logical group of servers to which this cluster database process belongs
SERVER_SET NUMBER The logical set of servers to which this cluster database process belongs. A single server group will have at most two server sets.
SERVER# NUMBER The logical number of the cluster database process within a server set
DEGREE NUMBER 實際是使用的並行度
REQ_DEGREE NUMBER 使用者在語句中指定要求的並行度,並且優先於其他資源,使用者,負載均衡要求減少的值(load balancing reductions)

主要使用的是QCSID,SID,SERIAL# 比如:其中QCSID是發起並行操作的session ID
ops$admin@yangdb>select * from gv$px_session;
   INST_ID SADDR                   SID    SERIAL#      QCSID  QCSERIAL#  QCINST_ID SERVER_GROUP SERVER_SET    SERVER#     DEGREE REQ_DEGREE
---------- ---------------- ---------- ---------- ---------- ---------- ---------- ------------ ---------- ---------- ---------- ----------
         1 0000000A10B86320        969      58951       1111      27913          1            1          1          1          2          2
         1 0000000A58C349F8       1111      27913       1111
         2 0000000A10C180C0       1298      41171       1111      27913          1            1          1          2          2          2
例子中的(1111,27913)會話執行的sql有DEGREE為2,(969,58951)在節點1 上執行,(1298,41171)在節點2上執行!         
檢視並行會話的等待事件:
ops$admin@yangdb>select p.inst_id,p.sid,p.qcsid,s.event,s.p1,s.p2,s.p3
  2  from gv$px_session p,
  3       gv$session_wait s
  4  where p.qcsid=&sid
  5    and s.sid=p.sid
  6    and p.inst_id=s.inst_id;
Enter value for sid: 1063
old   4: where p.qcsid=&sid
new   4: where p.qcsid=1063

   INST_ID        SID      QCSID EVENT                                                                    P1         P2         P3
---------- ---------- ---------- ---------------------------------------------------------------- ---------- ---------- ----------
         1          3       1063 PX Deq Credit: send blkd                                          268566527          1 4.4023E+10
         1        246       1063 PX Deq: Execution Msg                                             268566527        915 4.4022E+10
         1        396       1063 PX Deq: Execution Msg                                             268566527        912 4.4022E+10
         1       1063       1063 db file sequential read                                                 485    1900503          1
         1       1498       1063 PX Deq: Execution Msg                                             268566527        749 4.4022E+10

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-720663/,如需轉載,請註明出處,否則將追究法律責任。

相關文章