Friday, July 22, 2011

How to track PeopleSoft Process Scheduler Requests

Someone ran a Process Scheduler request and as a PeopleSoft administrator, you want to find how to see that running in the database.

Here is a SQL statement to track the same.
select  b.sid,b.serial#,
prcsinstance,
prcstype,prcsname,
to_char(rqstdttm,'mm-dd-yy hh24:mi:ss') Start_Date,
oprid,
decode(runstatus,1,'Cancel',
           2, 'Delete',
           3, 'Error',
           4, 'Hold',
           5, 'Queued',
           6, 'Initiated',
           7, 'Processing',
           8, 'Cancelled',
           9, 'Success',
           10,'No Success',
           11,'Posted',
           12,'Not Posted',
           13,'Resend',
           14,'Posting',
           15,'Generated') "Status",
origprcsinstance
from PSPRCSQUE a, v$session b
where runstatus='7'
and b.process=to_char(a.sessionidnum)
and b.client_info is not null

Expect the output as shown below.

    SID SERIAL# PRCSINSTANCE PRCSTYPE                      PRCSNAME     START_DATE        OPRID                Status     ORIGPRCSINSTANCE
------- ------- ------------ ------------------------------ ------------ ----------------- -------------------- ---------- ----------------
    917    8093       502333 COBOL SQL                      SFPGRPST     07-22-11 10:27:56 CNYADM               Processing           502333
   1806   60301       502320 COBOL SQL                      SFPGRPST     07-22-11 07:09:33 CNYADM               Processing           502320
   2688   33914       502324 Application Engine             CU_C_115A    07-22-11 09:55:13 CNYADM               Processing           502324
   1732    7710       502338 Application Engine             CU_C082C_TAX 07-22-11 11:07:10 CNYADM               Processing           502338
   1728    5964       502338 Application Engine             CU_C082C_TAX 07-22-11 11:07:10 CNYADM               Processing           502338

So, just in one screen, you can everything that is running along with database session to diagnose further.

Here is another SQL to check on the history for a given Application Engine request.
select
prcsinstance,
prcstype,prcsname,
to_char(begindttm,'mm-dd-yy hh24:mi:ss') Start_Date,
to_char(enddttm,'mm-dd-yy hh24:mi:ss') End_Date,
oprid,
decode(runstatus,1,'Cancel',
  2, 'Delete',
  3, 'Error',
  4, 'Hold',
  5, 'Queued',
  6, 'Initiated',
  7, 'Processing',
  8, 'Cancelled',
  9, 'Success',
  10,'No Success',
  11,'Posted',
  12,'Not Posted',
  13,'Resend',
  14,'Posting',
  15,'Generated') "Status",
origprcsinstance
from PSPRCSRQST 
where
prcsname like '&process_name%'
and begindttm > sysdate-3
order by 1 desc

You can enter the process name and also change the data(sysdate-3) to whatever you need.
This will give you the history of the process for the last three days.

Enter value for process_name: CU_INTR_THRD
PRCSINSTANCE PRCSTYPE                      PRCSNAME     START_DATE        END_DATE          OPRID                Status     ORIGPRCSINSTANCE
------------ ------------------------------ ------------ ----------------- ----------------- -------------------- ---------- ----------------
      502368 Application Engine             CU_INTR_THRD 07-22-11 13:39:52                   CNYADM               Processing           502368
      502362 Application Engine             CU_INTR_THRD 07-22-11 12:16:29 07-22-11 12:54:54 CNYADM               Success              502362

Please leave a comment if you have any specific question. I would be glad to answer that.

2 comments:

  1. Hi,

    For me with peopleSoft 8.8 with PT 8.49 the below query returns results:

    select b.sid,b.serial#,
    prcsinstance,
    prcstype,prcsname,
    to_char(rqstdttm,'mm-dd-yy hh24:mi:ss') Start_Date,
    oprid,
    decode(runstatus,1,'Cancel',
    2, 'Delete',
    3, 'Error',
    4, 'Hold',
    5, 'Queued',
    6, 'Initiated',
    7, 'Processing',
    8, 'Cancelled',
    9, 'Success',
    10,'No Success',
    11,'Posted',
    12,'Not Posted',
    13,'Resend',
    14,'Posting',
    15,'Generated') "Status",
    origprcsinstance
    from PSPRCSQUE a, v$session b
    where runstatus='7'
    and b.process=to_char(a.sessionidnum+1)
    and b.client_info is not null

    I have added 1 with sessionidnum value.
    Please advice why this is so .Thanks.

    ReplyDelete
    Replies
    1. Hello Bhaumik,
      It is a sheer co-incidence that by adding +1, you still got some result. Adding +1 will increase the
      process# that we are comparing to v$session.process. If there is a matching process# in v$session at that time, your sql would return the result. However, please keep in mind, this information will be in-correct. This will not be the correct SID for the AE request.

      For confirmation, please run the below SQL
      select sid,serial#,process,program from v$session where process in (select to_char(sessionidnum+1) from psprcsque)
      and then run the below SQL
      select sid,serial#,process,program from v$session where process in (select to_char(sessionidnum) from psprcsque)

      You will see different results with to_char(sessionidnum) and to_char(sessionidnum+1).

      Hope this helps. If you still have any unanswered questions, please feel free to reach me as many times.

      Delete