Sei sulla pagina 1di 14

21/12/2015

Document296559.1

FAQ:CommonTracingTechniquesinOracleEBusinessApplications11iandR12(DocID
296559.1)
InthisDocument
Purpose
QuestionsandAnswers

1a.Whatisatracefile?

Example#1:ORAError

Example#2:Rollback

1b.Whatarebindvariables?

Example#1:Binds

Example#2:Binds

2.HowtoEnableTraceIn...

2a.Forms

2b.ConcurrentProgram

Checkbox

DebugOptionsButton!(BindsandWaits)

SQLProgram(BindsandWaits)

2c.TraceALLuseractions

2d.Webbasedscreen

3.FindingTraceFiles?
3a.In11G:
3b.Before11G:
4.OtherTools

4a.UsingTKPROF

4b.UsingTraceAnalyzer

4c.SQLT

4d.RDA

4.Before11i?

5.TracingAPICalls

References

APPLIESTO:
OracleInventoryManagementVersion12.1.3to12.1.3[Release12.1]
OracleEBSApplicationsPerformanceVersion11.5.10.2to12.2[Release11.5.10to12.2]
Informationinthisdocumentappliestoanyplatform.
ALLPRODUCTACCESS
TKProfandTracing

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

1/14

21/12/2015

Document296559.1

PURPOSE
HerearesomecommonquestionsortipsaboutTracing,SQLTrace,TKProf,andTraceAnalyzerrelatedtotheOracle
EBusinessApplications11iandR12.

QUESTIONSANDANSWERS
1.Overview

1a.Whatisatracefile?
AtracefileisalogofSQLruninaparticularsessionorsessionsfocusedonselects,inserts,updates,anddeletes.A
tracefilecanbeusedinmanycircumstancesincludingreviewingperformance,findingtablesandviewsreferenced,or
findingtherootofanerror.Moredetailsabouttracefilescanbereadinthedatabaseuser'sguiderelatedtoyour
version.

Example#1:ORAError
ThefollowingisansnippetfromatracefilethathadanOraclestandarderror.Inthiscaseitisauniqueconstraint
violation,ORA1uniqueconstraint.Seetheline:ERROR#117:err=1tim=1443801753.TheERRORflagsthelineand
the'err=1'liststheOracleerrorasORA1:

=====================

PARSINGINCURSOR#117len=1828dep=1uid=173oct=2lid=173tim=1203661932011076hv=1015075934ad='cc6

INSERTINTOBOM_SUB_OPERATION_RESOURCES(OPERATION_SEQUENCE_ID,SUBSTITUTE_GROUP_NUM,RESOURCE_ID,SCH
REPLACEMENT_GROUP_NUM,ACTIVITY_ID,STANDARD_RATE_FLAG,ASSIGNED_UNITS,USAGE_RATE_OR_AMOUNT,USAGE_RA
SCHEDULE_FLAG,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,CREATED_BY,LAST_UPDATE_LOGIN,RESOUR
ATTRIBUTE_CATEGORY,REQUEST_ID,PROGRAM_APPLICATION_ID,PROGRAM_ID,PROGRAM_UPDATE_DATE,ATTRIBUTE1,A
ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATT
PRINCIPLE_FLAG,SETUP_ID,CHANGE_NOTICE,ACD_TYPE,ORIGINAL_SYSTEM_REFERENCE)SELECTDISTINCTA.OPERA
B.SUBSTITUTE_GROUP_NUM,D.RESOURCE_ID,B.SCHEDULE_SEQ_NUM,B.REPLACEMENT_GROUP_NUM,B.ACTIVITY_ID,B.S
B.ASSIGNED_UNITS,B.USAGE_RATE_OR_AMOUNT,B.USAGE_RATE_OR_AMOUNT_INVERSE,B.BASIS_TYPE,B.SCHEDULE_FLA
SYSDATE,:B4,NULL,B.RESOURCE_OFFSET_PERCENT,B.AUTOCHARGE_TYPE,B.ATTRIBUTE_CATEGORY,FND_GLOBAL.CO
FND_GLOBAL.CONC_PROGRAM_ID,SYSDATE,B.ATTRIBUTE1,B.ATTRIBUTE2,B.ATTRIBUTE3,B.ATTRIBUTE4,B.ATTRIBU
B.ATTRIBUTE8,B.ATTRIBUTE9,B.ATTRIBUTE10,B.ATTRIBUTE11,B.ATTRIBUTE12,B.ATTRIBUTE13,B.ATTRIBUTE14,
B.SETUP_ID,DECODE(:B2,1,B.CHANGE_NOTICE,:B3),DECODE(:B2,1,B.ACD_TYPE,1),B.ORIGINAL_SYSTE
FROMBOM_OPERATION_RESOURCESA,BOM_SUB_OPERATION_RESOURCESB,BOM_RESOURCESC,BOM_RESOURCESD
WHEREA.LAST_UPDATED_BY=B.OPERATION_SEQUENCE_IDANDB.RESOURCE_ID=C.RESOURCE_IDANDC.RESOURCE_COD
ANDD.ORGANIZATION_ID=:B1ANDNVL(D.DISABLE_DATE,SYSDATE+1)>SYSDATE

ENDOFSTMT

EXEC#117:c=2099681,e=2436776,p=315,cr=5416,cu=19,mis=0,r=0,dep=1,og=1,tim=1203661932011073

ERROR#117:err=1tim=1443801753

=====================

Example#2:Rollback
Anothercommonthingtolookforintracefilesarerollbacks.Thereareseveralformatsthatyoumightseefora
rollbackincludingtheword'rollback'ortextlike'XCTENDrlbk=1,rd_only=1'.
=====================

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

2/14

21/12/2015

Document296559.1

PARSINGINCURSOR#118len=30dep=1uid=173oct=45lid=173tim=1203661932011639hv=4099445834ad='0'
ROLLBACKTOBEGIN_ROUTING_COPY

ENDOFSTMT

EXEC#118:c=0,e=124,p=0,cr=0,cu=21,mis=0,r=0,dep=1,og=0,tim=1203661932011637

RPCEXEC:c=2105681,e=2524801

BINDS#116:

=====================

1b.Whatarebindvariables?
Abindvariableisasubstitutionvalueusedwithinatracefile.Toimproveperformance,theOracledatabasewillreuse
SQLsubstitutingvaluesforvariablesasnecessary.Forexample,thesameSQLstatementcouldberunforeach
ofyouremployees.TheemployeeidmightbeavariablethatischangedbeforeyouruneachSQL.Thiscouldbe
translatedtothedatabaseasabindvariablesothatthesameSQLcanbeusedeachtimebutthecorrectvariablecan
besubstitutedjustbeforetheSQLisrun.
Ifsomeonerequeststhatyouenablebindvariablesforyourtracefile,thiscausesthedatabasetodocumentthe
substitutionvariableswithinthetracefileaswellastheSQLrun.Forexample,wemayseethataselectstatementran
againsttheemployeetabletentimes,butwithoutthebinds,wewouldnotknowwhatemployeewasselectedeach
time.

Example#1:Binds
Hereisanexampleofatracefilewithbinds.Inthisexample,weseeaqueryagainstatablecalled
MTL_SYSTEM_ITEMS_VL.Bindvariablesareusedinthewhereclausetosubstituteforthefollowing":num",
":SEGMENT1",and":FND_FLEX_WHERE_BIND_0".

=====================

PARSINGINCURSOR#78len=785dep=0uid=173oct=3lid=173tim=1203661928858323hv=3885565797ad='d16ab
SELECTENABLED_FLAG,SUMMARY_FLAG,NVL(TO_CHAR(START_DATE_ACTIVE,'J'),0),NVL(TO_CHAR(END_DATE_ACTIVE
DESCRIPTION,PRIMARY_UOM_CODE,LOCATION_CONTROL_CODE,RESTRICT_LOCATORS_CODE,RESTRICT_SUBINVENTORIES_
INVENTORY_ASSET_FLAG,product_family_item_id,BOM_ITEM_TYPE,SERIAL_NUMBER_CONTROL_CODE,INVENTORY_ITE
FROMMTL_SYSTEM_ITEMS_VLWHEREORGANIZATION_ID=:numANDSEGMENT1=:SEGMENT1

AND(bom_enabled_flag='Y'Andbom_item_type<>3Andpick_components_flag='N'Andeng_item_flag
Andnotexists(SelectnullFrombom_operational_routingsborWherebor.assembly_item_id=inventory_i
Andbor.organization_id=:FND_FLEX_WHERE_BIND_0Andbor.alternate_routing_designatorisnullAndbor.
Andeam_item_typeISNULL)

ENDOFSTMT

EXEC#78:c=0,e=108,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1203661928858320

FETCH#78:c=0,e=76,p=0,cr=10,cu=0,mis=0,r=1,dep=0,og=1,tim=1203661928858425

BINDS#78:

kkscoacd
Bind#0

oacdty=02mxl=22(22)mxlc=00mal=00scl=00pre=00

oacflg=01fl2=1000000frm=00csi=00siz=2056off=0

kxsbbbfp=2a9cff79f0bln=22avl=03flg=05

value=101

Bind#1

oacdty=01mxl=32(15)mxlc=00mal=00scl=00pre=00
oacflg=01fl2=1000000frm=01csi=873siz=0off=24

kxsbbbfp=2a9cff7a08bln=32avl=09flg=01

value="MRS6814MC"

Bind#2

oacdty=01mxl=2000(255)mxlc=00mal=00scl=00pre=00

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

3/14

21/12/2015

Document296559.1

oacflg=01fl2=1000000frm=01csi=873siz=0off=56

kxsbbbfp=2a9cff7a28bln=2000avl=03flg=01

value="101"

EXEC#78:c=0,e=81,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1203661928859390

FETCH#78:c=0,e=36,p=0,cr=10,cu=0,mis=0,r=1,dep=0,og=1,tim=1203661928859438

=====================

Example#2:Binds
Hereisanotherexamplewhereyouseethebindnumbers.Thisismorecommon.Notethatthebindsareoffbyone
bind#0goeswiththevariable:b1,bind#1goeswithvariable:b2,etc.

=====================

PARSINGINCURSOR#128len=863dep=0uid=173oct=6lid=173tim=1203661928862922hv=1516422370ad='d1d9

UPDATEBOM_OPERATIONAL_ROUTINGSSETROUTING_SEQUENCE_ID=:b1,ASSEMBLY_ITEM_ID=:b2,ORGANIZATION_ID=
LAST_UPDATE_DATE=:b5,LAST_UPDATED_BY=:b6,LAST_UPDATE_LOGIN=:b7WHEREROWID=:b8

ENDOFSTMT

PARSE#128:c=0,e=442,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=1203661928862919

BINDS#128:

kkscoacd
Bind#0

oacdty=02mxl=23(22)mxlc=00mal=00scl=00pre=00

oacflg=03fl2=1000000frm=00csi=00siz=2200off=0

kxsbbbfp=2a9cff7cd8bln=23avl=04flg=05

value=30020

Bind#1

oacdty=02mxl=23(22)mxlc=00mal=00scl=00pre=00
oacflg=03fl2=1000000frm=00csi=00siz=0off=24

kxsbbbfp=2a9cff7cf0bln=23avl=04flg=01

value=13003

Bind#2

oacdty=02mxl=23(22)mxlc=00mal=00scl=00pre=00
oacflg=03fl2=1000000frm=00csi=00siz=0off=48

kxsbbbfp=2a9cff7d08bln=23avl=03flg=01

value=101

Bind#3

oacdty=01mxl=2000(255)mxlc=00mal=00scl=00pre=00

oacflg=03fl2=1000000frm=01csi=873siz=0off=72

kxsbbbfp=2a9cff7d20bln=2000avl=00flg=01

Bind#4

oacdty=12mxl=07(07)mxlc=00mal=00scl=00pre=00

oacflg=03fl2=1000000frm=00csi=00siz=0off=2072

kxsbbbfp=2a9cff84f0bln=07avl=07flg=01

value="1/21/20098:56:55"

Bind#5

oacdty=02mxl=23(22)mxlc=00mal=00scl=00pre=00

oacflg=03fl2=1000000frm=00csi=00siz=0off=2080

kxsbbbfp=2a9cff84f8bln=23avl=03flg=01

value=1555

Bind#6

oacdty=02mxl=23(22)mxlc=00mal=00scl=00pre=00

oacflg=03fl2=1000000frm=00csi=00siz=0off=2104

kxsbbbfp=2a9cff8510bln=23avl=04flg=01

value=370867

Bind#7

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

4/14

21/12/2015

Document296559.1

oacdty=01mxl=32(18)mxlc=00mal=00scl=00pre=00

oacflg=03fl2=1000000frm=01csi=873siz=0off=2168

kxsbbbfp=2a9cfef550bln=32avl=18flg=01

value="AABDb6AAiAAAGBqAA3"

=====================

2.HowtoEnableTraceIn...
2a.Forms
HowdoesoneenabletraceintheOracleApplicationscreens/forms?
OnecanenabletracethroughtheformsbyusingtheHelpmenu,choosingthediagnosticsmenu,traceandthen
selectingtheappropriatetraceforyourneeds.Mostcommonlyifdebugginganerror,youshouldatleastprovidetrace
withbinds.Whendebuggingaperformanceissue,youmayconsiderusingtracewithbindsandwaits.
Forexample,thefollowingisthenavigationtoenabletraceinaform:
1.GototheOracleApplications
2.Login
3.Opentheformwheretheerroroccursbutdonotyetcausetheerror.
4.EnableSQL*TracebychoosingHelp>Diagnostics>Trace>Tracewithbinds
5.Amessageappearsindicatingthatthetracewillberecorded
6.Notethefilenameandlocationofthefile
7.Nowreproducetheerror.
8.Oncetheerroroccurs,disabletraceassoonaspossible.
9.DisableSQL*TracebychoosingHelp>Diagnostics>Trace>Traceoff
10.Thesamefilenameandlocationwillbenotedincaseyouneeditagain.
11.Retrievethetracefile.

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

5/14

21/12/2015

Document296559.1

2b.ConcurrentProgram
Howdoesoneenabletraceforaconcurrentprogram?

Note:ForR12.1andhigher,theconcurrentprogramsubmissionscreennowhasa"DebugOptions"buttonwhere
youcanenabletrace.MakesureyouhavethePatch8743459describedinNote1273539.1forthistowork.
Withoutthepatchitwillnotwork.

Checkbox
Withsystemadministrationprivileges,asimplewaytoenabletraceinaconcurrentprogramistoreviewthe
concurrentprogramdefinitionandselecttraceenabled.Thiswillenabletracewithoutbindsforallusersthatrunthe
program.
Forexample,thefollowingstepscouldbeused.
1.GotoSysadmin>Concurrent>Program>Define
2.Querytheconcurrentprogram
3.Checkthetraceboxtoenabletrace
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

6/14

21/12/2015

Document296559.1

Ifyourequirebindvariablesforyourtracefilefromaconcurrentprogram,amoresophisticatedmethodisrequiredas
notedbelow.

DebugOptionsButton!(BindsandWaits)
WhensubmittingaconcurrentprograminR12.1andhigher,theconcurrentprogramsubmissionscreenhasa"Debug
Options"buttonwhereyoucanenabletrace.ThebuttonopensawindowwithvariousSQLTracingoptionsincluding
BindsandWaits.Theselectionappliesjusttothecurrentrunoftheprogram.

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

7/14

21/12/2015

Document296559.1

Note:MakesureyouhavethepatchdescribedinNote1273539.1forthistowork.

SQLProgram(BindsandWaits)
HowdoesoneenabletraceforaconcurrentprogramINCLUDINGbindvariablesandwaits?
NOTE:SeeNote301372.1foranothermethodusingtheProfile"Concurrent:AllowDebugging"for11.5.10and
R12.x.
Tracecanbeenabledforaconcurrentprogrambyenablingtraceontheprogramdefinitionforallusersasnoted
above,butthisdoesnotincludebindvariablesorwaittimes.Toenabletracewithbindvariablesforaconcurrent
program,youmayconsiderthefollowingapproachthatusesthebdescriptforconcurrentprogramtracingwithbinds
andwaitsusingevent10046atlevel12.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

8/14

21/12/2015

Document296559.1

***Thismethodwillenabletracewithbindsforallnewsessionsandconnections
1.Downloadandreviewthescript,bde_system_event_10046.sql,fromNote.179848.1.
2.Runthescriptandpressenterwhenprompted:
SQL>bde_system_event_10046.sql

3.Returntotheapplication
4.Executetheconcurrentprogram
5.Monitortheprogramuntilitbeginstorun
6.ReturntoSQL*Plusandpressentertocanceltracingnewprograms

2c.TraceALLuseractions
Howdoesoneenabletraceforallactionsthatoccurforauser?
Onecanenabletraceforallactionsthatausertakesbysettingaprofileoptionfortheuser.SeeNote170223.1for
detailedscreenshots.ThiswillfunctionwhentheuserlogsintotheOracleApplicationsformsorwhenloggingintothe
SelfServiceWebApplications.ThismethodusesanEventTrace.
Theinstructionsforenablingtheeventtracefollow:
a.Firstenabletraceforaspecificuser:
BringuptheCoreapplicationSystemAdministratorresponsibility
MovetoProfile/System
CheckofftheUSERboxandenteryourusernamethatyouareusingwhengettingtheerror
Searchonthefollowingprofileoption'InitializationSQLStatementCustom'
Pleasesetthisattheuserlevelwiththefollowingstring:
BEGINFND_CTL.FND_SESS_CTL('','','','TRUE','','ALTERSESSIONSET
TRACEFILE_IDENTIFIER='||''''||'4269824.999'||''''||'EVENTS='||''''||'10046TRACENAME
CONTEXTFOREVER,LEVEL12'||'''')END

(CutandpastetheabovesqlstatementintotheUserLevelprofileoption:"InitializationSQLCustom")
Thismustbeonecompletelineoftextsomaybebesttocopythestringintonotepadpriortoputtingitintothe
profile.
b.Oncetheprofileisset,pleasechangeresponsibilitiesanddirectlygoandreproducetheproblem.
Tolocatethetracefile,usethefollowingsqlinsqlplus:
SQL>selectname,valuefromv$parameterwherenamelike'user_dump_dest'

Thevalueisthelocationofthetracefileonthedatabaseserver
Pleasemovetothisdirectoryandsearchforthefilehaving4269824.999inthefilename
ThisisthetracefilecreatedpleasetkprofanduploadBOTHtherawandtkproftracefiletoMyOracleSupport.
c.EnsurethattheprofileoptionisunsetbeforeexitingtheApplication.
Thisisaveryimportantstep.Ifthisisnotunset,unnecessarytracefileswillbegenerated.
d.NotethatasimilartechniquecanbeusedforenablingtracewithbindsforauserinSQL*Plus.Thecommands
wouldlooklikethefollowing:
SQL>ALTERSESSIONSETTRACEFILE_IDENTIFIER='577'EVENTS='10046TRACENAMECONTEXT
FOREVER,LEVEL12'

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

9/14

21/12/2015

Document296559.1

SQL>select'x'fromdualoranySQLthatyouwanttotrace

SQL>altersessionsetsql_trace=false

2d.Webbasedscreen
Howdoesoneenabletraceforawebbasedscreenlikefoundintheselfserviceapplications?
Youhaveafewoptionswithwebbasedscreens.YoucanuseDiagnostics>Enabletrace.

Oryoucanusethesamemethodasnotedabovein"Howdoesoneenabletraceforallactionsthatoccurforauser?"
AlsoreviewNote.245974.1,section"10.HowToGenerateandRetrieveTraceFilesinSSA(SelfServiceApplications)".
Section10discussestechniquesavailablewithinSelfServicefordebuggingandtracing.

3.FindingTraceFiles?
Howdoesonefindatracefile?
Sometracefileslikeinformsarespecifiedwhenyouenableanddisabletrace.Othersareabittrickiertoidentify.In
concurrentprogramsforexample,theuserisnotgiventhetracefilenumberandlocation.Itiscommonforpeopleto
lookforthelastupdatedtracefilesortouseUNIXfunctionslike'grep'toparsethetracefileslookingfortheone
relatedtotheirconcurrentprogram.However,thefollowingSQLcanbeusedtoassistinidentifyingthetracefile
associatedtoaconcurrentprogram.TheSQLpromptstheuserfortherequestidandoutputsthetracefilenameand
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

10/14

21/12/2015

Document296559.1

location.
Warning:SomeusershavepointedoutthatthisSQLdoesnotalwayspointouttheexactfilenameandlocation.On
amultinodedatabaseenvironment,theusermightnotknowwhatmachinetolookat.Also,theconstructionofthe
actualfilenamemaybedifferentonyourenvironmentasthisisconfigurable.Ifyourfilenamesareconfigured
differently,youmaywanttousenumberpartofthefilename(theprocessid),thensearchforfilesinyourtrace
directorywiththesameid.Atrickthatmayhelpyoufindthecorrecttracefiledirectoryistoenabletraceviathe
ApplicationuserusingHelp>Diagnostics>Trace>TraceOn.Thiswillpopupawindowindicatingthedirectory
wheretracefilesarewritten.
Finally,theoracle_process_idisselectedfromv$processsothisIDisonlyavailableduringruntimeoftheprocess.
Itgetsclearedshortlyaftertheprocessterminated.Thenyoucannotfindthetracefileforaconcurrentprogram
anymore.Therefore,youshouldrunthisSQLshortlyafterrunningtheconcurrentprogram.

3a.In11G:
ThisPL/SQLdoesnotlinktotheConcurrentRequestIdbutattemptstopointtothedirectorywheretracefilesare
locatedbasedonyourdatabaseversion:
SetServeroutputON

DECLARE

DB_VersionVARCHAR2(2)

Trace_locationVARCHAR2(240)

BEGIN

SELECTSUBSTR(vi.version,1,INSTR(vi.version,'.')1)INTODB_VersionFROMv$instancevi

IFTO_NUMBER(DB_Version)>=11THEN

/*FollowingLineincludedasExecuteImmediateasV$DIAG_INFOdoesnotexistinDBVersions
priorto11g*/

EXECUTEIMMEDIATE'SELECTvalueFROMV$DIAG_INFOWHERENAME=''DiagTrace'''INTO
Trace_location

ELSE

SELECTvalueINTOTrace_locationFROMv$parameterWHEREname='user_dump_dest'

ENDIF

dbms_output.put_line('TraceFileshouldbelocatedinthedirectory:'||trace_location)

END

3b.Before11G:
ThisSQLattemptstolookupthetracefilenameandlocationbasedontherequestid.Thisisnolongeraccuratein11G
andhigher.
SQL>

prompt

acceptrequestprompt'Pleaseentertheconcurrentrequestidfortheappropriate
concurrentprogram:'

prompt

columntraceidformata8

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

11/14

21/12/2015

Document296559.1

columntracenameformata80

columnuser_concurrent_program_nameformata40

columnexecnameformata15

columnenable_traceformata12

setlines80
setpages22
setheadoff

SELECT'Requestid:'||request_id,

'Traceid:'||oracle_Process_id,

'TraceFlag:'||req.enable_trace,

'TraceName:

'||dest.value||'/'||lower(dbnm.value)||'_ora_'||oracle_process_id||'.trc',

'Prog.Name:'||prog.user_concurrent_program_name,

'FileName:'||execname.execution_file_name||execname.subroutine_name,

'Status:'||decode(phase_code,'R','Running')

||''||decode(status_code,'R','Normal'),

'SIDSerial:'||ses.sid||','||ses.serial#,

'Module:'||ses.module

fromfnd_concurrent_requestsreq,v$sessionses,v$processproc,

v$parameterdest,v$parameterdbnm,fnd_concurrent_programs_vlprog,

fnd_executablesexecname

wherereq.request_id=&request

andreq.oracle_process_id=proc.spid(+)

andproc.addr=ses.paddr(+)

anddest.name='user_dump_dest'

anddbnm.name='db_name'

andreq.concurrent_program_id=prog.concurrent_program_id

andreq.program_application_id=prog.application_id

andprog.application_id=execname.application_id

andprog.executable_id=execname.executable_id

4.OtherTools
Arethereanyothertoolsthatcanassistinreviewingtracefiles(whatisTraceAnalyzer)?

4a.UsingTKPROF
AtracefilecanbereviewedusingTKPROF.TKPROFreformatstherawdatasothatitiseasiertoreview.TheTKPROF
commandsarenormallyrunattheoperatingsystemcommandprompt.Thiswillbesignifiedwitha$asthisisa
commonpromptinUNIX.
1.Retrievethetracefile.
2.IssueacommandlikethefollowingtocreateaTKPROFversionofthetracefile.Theexplainoptionwilllooktosee
howeachqueryishandledbythedatabaseintermsofwhattablesandindexesarereferenced.
$tkprof<filename.trc><output_filename>sys=noexplain=apps/<password>

However,TKPROFdoesnottakeintoaccountbindvariables.Therefore,theseareignoredintheoutput.Whenyou
needtoanalyzebindvariables,considerusingTraceAnalyzer.
AhandytechniquewhentroubleshootingperformanceissuesistouseTKPROFtolookatthelongestrunningqueries.
Sincetracefilesrelatedtoperformancecanbehuge,onemightspendhourslookingthroughtheresultstofindthe
queriescausingtheissue.Ifyousortthefilebythelongestrunningqueriesfirst,itmakesitmucheasierto
investigate.Thefollowingexamplesortsbylongestrunningqueriesfirstwiththesortoptionsselectedas
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

12/14

21/12/2015

Document296559.1

"sort='(prsela,exeela,fchela)'"andlimitstheresultstothe"Top10"longrunningquerieswiththe"print=10"
command:
$tkprof<filename.trc><output_filename>sys=noexplain=apps/<password>

sort='(prsela,exeela,fchela)'print=10

4b.UsingTraceAnalyzer
PleaserefertoNote224270.1:TraceAnalyzer
TraceAnalyzerreformatstherawdatasothatitiseasiertoreview.ItisamorepowerfultoolthanTKPROF.It
translatesthingslikebindvariablesandmakethemeasytofind.
1.DownloadTraceAnalyzerfromNote224270.1
2.InstalltraceanalyzerinSQL:
SQL>startTRCACREA.sql

3.Retrievethetracefile.
4.InSQL*Plus,issueacommandlikethefollowingtocreateaTraceAnalyzerversionofthetracefile:
SQL>startTRCANLZR.sqlUDUMPvis015_ora_22854.trc

4c.SQLT
PleaserefertoNote215187.1fordetailsonSQLTXPLAIN(SQLT).

4d.RDA
IsRDAAnothertechniqueforfinding/supplyingtracefiles?
CheckouttheRDAoutputthatcangrabthelasttracefileandyoucouldthenuploadtheRDAtotheServiceRequest.
Note559800.1HowToRunApplicationCollectionTool(ACT/RDA)DiagnosticsTest?
...4e.AWR
SeeNote748642.1WhatisAWR(Automaticworkloadrepository)andHowtogeneratetheAWRreport?

4.Before11i?
Willthesetechniquesworkinpreviousversionsbefore11i(Forexample,10.7and11.0.3)?
ManyofthesametechniqueswillworkinpreviousversionsoftheOracleApplications.However,therearesome
limitationsforexample,in10.7and11.0.3,theapplicationdidnotindicatethetracefilenamewhenauserenabled
traceusingHelp>Diagnostics>Trace.Also,thepreviousversionsoftheapplicationdidnotallowfortheuserto
enabletracewithbindsusingtheHelp>Diagnosticsnavigationpath.
Seealso:Note171647.1TracingOracleApplicationsusingEvent10046in10.7,11.0,and11i

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

13/14

21/12/2015

Document296559.1

5.TracingAPICalls
SeeNote869386.1.

REFERENCES
NOTE:115698.1:117129.1
NOTE:130182.1:142898.1
NOTE:179848.1:224270.1
NOTE:1007808.6:100964.1
NOTE:76338.1:869386.1
NOTE:245974.1:279132.1
NOTE:301372.1:38018.1
Didn'tfindwhatyouarelookingfor?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=ho4csv1e5_465&id=296559.1

14/14

Potrebbero piacerti anche