Page 1 of 1

TKPROF

Posted: Mon Jun 04, 2007 7:25 am
by anu_uma
Hi all,

can anyone suggest me the uses and advantages of tkprof ( transient kernel profiler) and how to enable the SQL TRACE for an apps instance ???

I am not a technical person, so i need step by step explanation to do the SQL trace for an apps instance.

Regards,
Uma

Posted: Tue Jun 19, 2007 8:06 am
by ramasrith
hai anu,
first of all generate the trace file from the sql prompt
sql>alter session set sql_trace=true;
sql>select * from emp (take any table);
sql> show parameter user_dump
(Then it will show the user generated file location. Go to that location fr om OS user and type )

ls -ltr

select the last generated .trc file and type at the os level as

tkprof <filename.trc> <xyz.txt>
(filename.trc ---> generated trace file)
(xyz.txt ---> any filename)

vi xyz.txt
(u can view info as a readable form when u compare with .trc file
u can know all the info whats goingon inside the table when u issue a query)


Thank u ,
Ramu

Posted: Wed Jun 20, 2007 5:26 am
by anu_uma
Hi Ram,

Thanks for the detail explanation. Definetly someone will get benefited of your stuff.

Posted: Fri Jun 22, 2007 7:14 am
by pvsrskishore
Hai anu,

This is ramu's frnd kishore. Actually this is not even related to technical. This is done by DBA's. So it may not be useful for Functional or technical folks. But its gud to know.

Bye..

Nani

Posted: Fri Jun 22, 2007 8:54 am
by anu_uma
Hi,

Thanks for the clarifications... few places DBA's involvement is more and in few places technical handles these sort of things....

as per my exp, only technical people have been using TKProf - to apply patches, to run sql queries to take output for TAR's

Posted: Fri Jun 22, 2007 8:55 am
by anu_uma
Hi Kishore,

Are U a DBA ???



[quote]Hai anu,

This is ramu's frnd kishore. Actually this is not even related to technical. This is done by DBA's. So it may not be useful for Functional or technical folks. But its gud to know.

Bye..

Nani

<i><div align="right">Originally posted by pvsrskishore

Posted: Mon Jun 25, 2007 4:58 am
by ramaraomovva
Hi,

TKPROF : - It is a utility provided by oracle that formats SQL Trace files
into veru helpfull and readable reports. It is installed when
the database server software is installed.
Enabling SQL Trace: - AT THE INSTANCE LEVEL
SQL_TRACE = TRUE
TIMED_STATISTICS = TRUE(OPTINAL)
and
IN YOUR SESSION
ALTER SESSION SET SQL_TRACE = TRUE
IN ANOTHER SESSION
SYS.DBMA_SYSTEM.SET_SQL_TRACE_IN_SESSION
(<SID>, <SERIAL#>, TRUE)
and INVOKE TKPROF FROM THE OPERATING SYSTEM PROMPT LIKE THIS

TKPROF<TRACEFILE><OUTPUT FILE>\[EXPLAIN = <USERNAME/PW>]\
[SYS = N][INSERT = <FILENAME>]\[RECORD=<FILENAME>]
[SORT = <KEYWORD>]

bye.