debug tuxedo services using dbx

来源:互联网 发布:网络快车加 编辑:程序博客网 时间:2024/06/03 14:01
 

1. find out theserver process id.

v490i1:/opt/app/tuxapp/tuxopq$ pgrepopfqdb

23859

23889

23890

We have 3 identical servers, the serverhave 2 copies as its backup.

 

2. find outwhich of the 3 servers will be the active process(normally the median pid number,it’s up to the internal load balance algorithm in Tuxedo), and attach dbx toit:

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)attach 23889

Attached to process 23889

stopped in __systemcall at0xfe120080

0xfe120080:__systemcall+0x0030:        ta      0x8

In fact, there is a way to predict whichwill be the active process to handle the next request rather than guessing.

(1) send a request to the service

(2) observe the output of ‘psr’ in tmadmin,see which opfqdb process handles this request. This server process is the onewe should attach dbx to.

another way is to modify your UBB and boot only one process to debug.

 

3. set thebreak point to get control on the server:

 (/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)file opfqpc.c

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)stop at 703

(2) stop at"opfqpc.c":703

 

4. send arequest to the server. It will be stopped when it reaches the breakpoint. Youhave got complete control over the server now!

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)cont     

stopped in OPFQ_ctl_DBselect atline 703 in file"opfqpc.c"

  703       strcpy(opfq->sqlstep,"PREPARESELECT OPFQ_QUE_CTL");      

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)print opfq

opfq = 0xffbf4218

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) print *opfq

*opfq = {

   itm_nbr       = 0.0

   city_cd       = "BJS"

   offc_nbr     = 187

    rsn_cd        = "RE"

    ori_rsn_cd    = "RE"

    rsn_cd_nbr    = 28

que_desc = "PSGR REBOOK"

    offc_count    = 0

    agt_nbr       = 0

    que_agt_nbr   = 8888

    que_pid       = 30426

    que_airl      = "1E"

    row           = 0

    que_offc_cd   = "TV"

    que_crt_dt_mf = "14SEP08094523"

    que_cont_typ  = 8

    que_itm_typ   = 1

    que_itm_count = 0

   txn_id        = "QE"

   run_id        = "*3K$YC"

   pnr_crt_dt    = ""

   que_cont      ="aaaaaaaaaaaaaaa/015FROM AGENT 8888 PID30426   PEK099  1559  14/09/08       "

   func          = ""

   que_ctl_count = 0

    que_ctl_nbr   = 0.0

    sqlstep       = 0x2630b8 ""

    sqlcode       = 0

    sqllog        = ""

    sqlerror      = ""

}

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)next     

stopped in OPFQ_ctl_DBselect atline 704 in file"opfqpc.c"

  704       opfq->sqlcode = sqlca.sqlcode;

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)next

stopped in OPFQ_ctl_DBselect atline 705 in file"opfqpc.c"

  705       CHECKSQL0OPFQ(return);  

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)print *opfq

*opfq = {

   itm_nbr       = 0.0

   city_cd       = "BJS"

   offc_nbr     = 187

    rsn_cd        = "RE"

    ori_rsn_cd    = "RE"

    rsn_cd_nbr    = 28

que_desc      = "PSGRREBOOK "                                                                   

   offc_count    = 0

   agt_nbr      = 0

    que_agt_nbr   = 8888

    que_pid       = 30426

    que_airl      = "1E"

    row           = 0

    que_offc_cd   = "TV"

    que_crt_dt_mf = "14SEP08094523"

    que_cont_typ  = 8

    que_itm_typ   = 1

    que_itm_count = 0

   txn_id        = "QE"

   run_id        = "*3K$YC"

   pnr_crt_dt    = ""

   que_cont      ="aaaaaaaaaaaaaaa/015FROM AGENT 8888 PID30426   PEK099  1559  14/09/08       "

   func          = ""

   que_ctl_count = 0

    que_ctl_nbr   = 0.0

    sqlstep       = 0x2630b8 "PREPARE SELECTOPFQ_QUE_CTL"

   sqlcode       = 0

   sqllog        = ""

   sqlerror      = ""

}

原创粉丝点击