Infolinks

Saturday 21 July 2012

Extract trace file in oracle apps

Extract trace file in oracle apps

How to extract the trace file of a concurrent program?

Following steps need to be performed:

1. Setup the profile value at user level with the following value

Profile name: "Initialization SQL Statement - Custom"
User: abc
Profile value:
BEGIN FND_CTL.FND_SESS_CTL('','','TRUE','TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER = abc MAX_DUMP_FILE_SIZE = 5000000 EVENTS ='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'||'''');END;

2. Now on ward all the trace will be tracked in the .trc file. Find out where the trace file resides in the DB.

Go to Help -> Diagnosics -> Trace. enable trace. After doing so, a pop up will show the server path where the trace will get create..

usually .trc file will get created in DB server. The file path may be say "/u01/app/oracle/admin/RAC11D/udump/RAC11D_ora_17181_abc.trc". the path will be stored along with the trc file name. usually the value in the profile value TRACEFILE_IDENTIFIER=AKONDURU is used in the trace file naming

3. Now we have enabled trace for your user login. So what ever you do. say run a concurrent program. how the concurrent program is executed? the sql queries executed. how the control is going... every thing is tracked in the trace file.


4. Log in to the DB server. extract the file and convert to readable format.

Go to the following path in the DB server -> '/u01/app/oracle/admin/RAC11D/udump/'. Identify the file name which is prompted while enabling the trace (look point 2).

the .trc file is not readable. You have to convert it (tkprof) to make it readable. use the following command to do so.


tkprof (input).trc output.txt EXPLAIN=()

where input.trc is the trace file and output.txt is in readable format

5. After you get the trace file. make sure to remove the profile value that you have set for the profile : "Initialization SQL Statement - Custom".. else the system will go on creating a huge trace file.

No comments:

Post a Comment