Sie sind auf Seite 1von 4

-TRACE 7 -TOOLSTRACEPC 4044

This will trace SQLs inside of your application engine as well as peoplecode. Sa
ve the process definition and go ahead and run your program. To examine the trac
e files, just navigate to the process monitor, click details on your process, th
en View Log/Trace.
-TRACE output goes into Application Engine Trace (.AET)
-TOOLSTRACEPC output goes into the PeopleTools trace file (.trc)

PeopleSoft recommends setting this to 4044.


The following is a list of the Trace values and what they do and 4044 is combina
tion of set of values from below.
0 Disables tracing.
1 Initiates the Application Engine step trace.
2 Initiates the Application Engine SQL trace.
4 Initiates the trace for dedicated Temp Table Allocation to AET file.
8 not yet allocated
16 not yet allocated
32 not yet allocated
64 not yet allocated
128 Initiates the statement timings trace to file, which is similar to the
COBOL timings trace to file.
256 Initiates the PeopleCode Detail to the file for the Timings trace.
512 not yet allocated
1024 Initiates the statement timings trace, but, instead of writing to the tr
ace file, this trace stores the results in the following tables: PS_BAT_TIMINGS_
LOG and PS_BAT_TIMINGS_DTL.
2048 Adding this value requests a database optimizer trace file.
4096 Requests a database optimizer to be inserted in the Explain Plan Table o
f the current database.
8192 This value sets a trace for Integration Broker transform programs.

http://peoplesoft.wikidot.com/debugging
To run application engine in debug mode, run the following from the command line
of %PS_HOME%/bin/client/winx86. You may need to install peopletools locally fir
st.
psae.exe -CT DatabaseType -CD DatabaseInstance -CO OperatorID -CP OperatorPasswo
rd -R RunControl -I ProcessInstance -AI ApplicationEngineProgramName -DEBUG Y
The app engine will log into the database and present you with the following pro
mpt:
PeopleTools 8.48.12 - Application Engine
Copyright (c) 1988-2007 PeopleSoft, Inc.
All Rights Reserved
Application Engine Debugger - enter command or type ? for help.
{APPENGINENAME}.{SECTION}.{FIRST_STEP}>
Note if you get an error about the environment variable PS_SERVER_CFG not being
set, you will need to set up the following environment variables:
* PS_SERVDIR pointing to your process scheduler location (e.g. %PS_HOME%\app
serv\prcs\CS90)
* PS_SERVER_CFG pointing to your process scheduler configuration file (e.g.
%PS_SERVDIR%\psprcs.cfg)
Note that the following commands are available in the debugger:
Debug Commands:
(Q)uit Rollback work and end program
E(X)it Commit work and end program (valid between steps)
(C)ommit Commit work (valid between steps)
(B)reak Set or remove a break point
(L)ook Examine state record fields
(M)odify Change a state record field
(W)atch Set or remove a watch field
(S)tep over Execute current step or action and stop
Step (I)nto Go inside current step or called section and stop
Step (O)ut of Execute rest of step or called section and stop
(G)o Resume execution
(R)un to commit Resume execution and stop after next commit

PeopleCode
Tracing PeopleCode
In the set trace flags on the signon page use Each Statement or through PeopleTo
ols -> Utilities -> Debug -> Trace PeopleCode use Show Each to log all the Peopl
eCode that fires during your trace. This will tell you what PeopleCode and event
s are firing (and what is not firing) and is usually enough to give you an idea
of what is going on. The best thing is that this trace produces a much smaller l
og file than selecting most of the other PeopleCode trace settings, making the P
eopleCode trace manageable!
Writing to a log file
Here's a simple example of how to log to a file. Obivously its not a good idea t
o use hardcoded absolute paths so adjust this code accordingly.
&fileLog = GetFile("C:\temp\LOGFILE.log", "w", "a", %FilePath_Absolute);
&fileLog.WriteLine("Begin");
&fileLog.WriteLine("End");
&fileLog.Close();

http://peoplesoftexperts.blogspot.com/2008/07/configuration-settings-for-tracing
.html
Online Process
Set the following in psappsrv.cfg, or for a single user session in PIA using tra
ce=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 varia
bles. 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 <trace_input_file> <rpt_output_file> sys=no explain=<user_id>/<password>
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.

Das könnte Ihnen auch gefallen