1. find out the server process id.
v490i1:/opt/app/tuxapp/tuxopq$ pgrep opfqdb
23859
23889
23890
We have 3 identical servers, the server have 2 copies as its backup.
2. find out which 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 to it:
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) attach 23889
Attached to process 23889
stopped in __systemcall at 0xfe120080
0xfe120080: __systemcall+0x0030: ta 0x8
In fact, there is a way to predict which will 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 one we should attach dbx to.
another way is to modify your UBB and boot only one process to debug.
3. set the break 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 a request to the server. It will be stopped when it reaches the breakpoint. You have got complete control over the server now!
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) cont
stopped in OPFQ_ctl_DBselect at line 703 in file "opfqpc.c"
703 strcpy(opfq->sqlstep,"PREPARE SELECT 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 at line 704 in file "opfqpc.c"
704 opfq->sqlcode = sqlca.sqlcode;
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) next
stopped in OPFQ_ctl_DBselect at line 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 = "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 "PREPARE SELECT OPFQ_QUE_CTL"
sqlcode = 0
sqllog = ""
sqlerror = ""
}