Tuesday, August 3, 2010

Configuration Settings for Tracing

Online Process

Set the following in psappsrv.cfg, or for a single user session in PIA using trace=y

“31” is the recommended value when tracing with “TraceSQL”.
“1984” is the recommended value when tracing with “TracePC”.

Batch Process

Application Engine

"135" is the recommended value when tracing with "TraceAE"

if peoplecode tracing is needed, please also set

TraceSQL= 31

TracePC = 1984

You can also do this in process definition of Application Engine to affect this for only 1 program.

Override options : Append : -TRACE 135 -TOOLSTRACESQL 31 -TOOLSTRACEPC 1984

To see which processes are set with this options, run this sql.

SELECT PRCSNAME, PARMLIST FROM PS_PRCSDEFN WHERE UPPER(PARMLIST) LIKE '%TRACE%' AND PRCSTYPE = 'Application Engine';

To generate Database Level Trace, Use TraceAE=2183. This will create file within the "UDUMP" directory on the database server.

It will contain details of each SQL statement that was executed on the database including its runtime execution plan. You can then use this as a input to tkprof for generating formatted trace report. However this will not capture bind variables. To capture bind variables, following trigger is needed.

CREATE OR REPLACE TRIGGER MYDB.SET_TRACE_POCALC

BEFORE UPDATE OF RUNSTATUS ON MYDB.PSPRCSRQST

FOR EACH ROW

WHEN ( NEW.runstatus = 7

AND OLD.runstatus != 7

AND NEW.prcstype = 'Application Engine'

AND NEW.prcsname = 'PO_PO_CALC'

)

BEGIN

EXECUTE IMMEDIATE

'ALTER SESSION SET TIMED_STATISTICS = TRUE';

EXECUTE IMMEDIATE

'ALTER SESSION SET MAX_DUMP_FILE_SIZE = UNLIMITED';

EXECUTE IMMEDIATE

'ALTER SESSION SET TRACEFILE_IDENTIFIER = ''POCALC''';

EXECUTE IMMEDIATE

'ALTER SESSION SET EVENTS = ''10046 TRACE NAME CONTEXT FOREVER, LEVEL 12''';

END;

/

Cobol Process

TraceSQL=128

SQR Process

A database level trigger is the only way for generating SQR trace.

Sample trigger script.

CREATE OR REPLACE TRIGGER MYDB.SET_TRACE_INS6000

BEFORE UPDATE OF RUNSTATUS ON MYDB.PSPRCSRQST

FOR EACH ROW

WHEN ( NEW.runstatus = 7

AND OLD.runstatus != 7

AND NEW.prcstype = 'SQR REPORT'

AND NEW.prcsname = 'INS6000'

)

BEGIN

EXECUTE IMMEDIATE

'ALTER SESSION SET TIMED_STATISTICS = TRUE';
EXECUTE IMMEDIATE

'ALTER SESSION SET MAX_DUMP_FILE_SIZE = UNLIMITED';
EXECUTE IMMEDIATE

'ALTER SESSION SET TRACEFILE_IDENTIFIER = ''INS6000''';
EXECUTE IMMEDIATE

'ALTER SESSION SET EVENTS = ''10046 TRACE NAME CONTEXT FOREVER, LEVEL 12''';

END;

/

Once the raw database trace is captured, execute the program “tkprof” with following sort options:

tkprof sys=no explain=/ sort=exeela,fchela,prscpu,execpu,fchcpu

For more information, Read peoplesoft resolution 201049233: E-ORACLE:10g Master Performance Solution for Oracle 10g and download the red paper attached to it.

Identify List of users who has minimized the Menu Pagelet

Sometimes user Minimizes the Menu Pagelet on PeopleSoft HRMS HomePage and do not know How to maximize it. Here is a query that can identify list of users who has minimized the Menu Pagelet.

PeopleSoft stores this information in PSPRUHTABPGLT Record.

It has a column PORTAL_MINIMIZE which has 2 values 0 (Maximize) and 1 (Minimize).

-- List of people who have maximized/minimized their Menu Pagelet
--PORTAL_MINIMIZE = 0 (Maximize)


select * from PSPRUHTABPGLT where PORTAL_OBJNAME_PGT = 'MENU' and PORTAL_MINIMIZE = 0
select b.oprid,b.oprdefndesc,b.lastsignondttm from PSPRUHTABPGLT a, PSOPRDEFN B where a.PORTAL_OBJNAME_PGT = 'MENU' and a.PORTAL_MINIMIZE = 0 and a.oprid = b.oprid


--PORTAL_MINIMIZE = 1 (Minimize)
select * from PSPRUHTABPGLT where PORTAL_OBJNAME_PGT = 'MENU' and PORTAL_MINIMIZE = 1
select b.oprid,b.oprdefndesc,b.lastsignondttm from PSPRUHTABPGLT a, PSOPRDEFN B where a.PORTAL_OBJNAME_PGT = 'MENU' and a.PORTAL_MINIMIZE = 1 and a.oprid = b.oprid

If there is no entry in this table, then it is always Maximized.

Here is a screenshot of How the minimized Menu Screen looks like.

menu_minimize

Could not sign on to database xxxx with user yyyy for app engine program

When trying to run appengine program from command line (psae), you are getting this message

“Could not sign on to database xxxx with user yyyy for app engine program”

One possible reason is that psae needs database name in upper case. If you are using lower case name then the above message appears.

Also PS_SERVER_CFG must contain the fully qualified name of a correctly configured Process Scheduler PSPRCS.CFG file

For e.g.

PS_SERVER_CFG=$PS_HOME/appserv/prcs//psprcs.cfg;export PS_SERVER_CFG

psae -CT ORACLE -CD dbname-CO userid -CP password -R runcontrolid -I 0 -AI

Also When PeopleSoft Application Engine runs from the command line, it resolves %PS_SERVDIR% to the value of the environment variable PS_SERVDIR instead of the parent directory of a Process Scheduler configuration.

Vertical Printing

SQR doesn't directly support rotating text or other elements, but some of its output formats do. Here are a couple examples using PostScript.








! Copyright 2004 Ray Ontko & Co. All rights reserved.

begin-program
print 'horizontal' (5,5)
print-direct printer=ps '270 rotate' ! Rotate 270 degrees
print-direct printer=ps '-792 -205 translate'


print 'vertical' (3,3)
print-direct printer=ps '90 rotate' ! Rotate back to 0
print-direct printer=ps '205 -792 translate'

print 'Horizontal again' (6,5)
print-direct printer=ps '/Courier findfont [12 0 0 -12 0 0] makefont setfont'
print 'Mirror Writing' (7,5)
end-program