Sql trace - tkprof

Hi..
My requirement is to
run a sql trace, with binds, replicate the issue in the SQL Report Wizard and then upload both the raw trace and tkprof'd output.
Can anyone give me in detail explanation for the above?
Rgds
Geeta Mutyaboyina

You might find [url http://forums.oracle.com/forums/thread.jspa?threadID=501834&tstart=0]this link useful.
Regards,
Rob.

Similar Messages

  • SQL TRACE/TKPROF VS SQL ACCESS ADVISOR

    Hi All,
    Can anyone please tell me what's the exact difference between SQL TRACE/TKPROF and SQL ACCESS ADVISOR in Oracle 10g.(By showing some examples)
    And also why should I go for SQL ACCESS ADVISOR ?? (Since I have used the former all these days) :)
    Why can't I still use SQL TRACE/TKPROF.
    Please if anyone can pour light on this. Thanks in Advance.
    Regards,
    Marlon.

    Better go through below link........
    http://www.remote-dba.net/oracle10g_tuning/t_sqlaccess_advisor.htm_
    -Ek

  • SQL Trace(tkprof) option in TOAD

    I am getting insufficient privilages error for the same.
    Pl help me.

    There is a hidden parameter called tracefiles_public that you can normally convince the DBAs to set for development instances that will set the umask for trace files to be globally readable then you can either:
    (1) get access to the server machine at the o/s level and copy across your trace files and trace them locally
    (2) telnet/ssh/something on to the server and trace them there
    (3) If you search this forum there are postings on how to use external tables/utl_file to open the remote .trc file on the server and transfer it to your client.
    If you can't get tracefiles_public (search asktom.oracle.com for some reinforcements if you need some backup to get permissions) then you'll need to bug the DBAs regularly to get read permissions on specific trace files. In general experience you won't need to bug them for more than 3 trace file permission changes before they give you access, unless it is a locked down prod box.

  • SQL Trace and TKprof

    Hello,
    Can someone tell me what is SQL trance and TKprof?
    when we will apply and what need of this?
    why i should give alter session set sql trace = true?
    if someone could give me an idea of what is a TKprof do, would be apprecaited.

    if someone could give me an idea of what is a TKprof doThe doc has an idea : http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#PFGRF01010
    Nicolas.

  • Sql trace and tkprof result

    When I use sql trace and tkprof. After I use tkprof, I get the result statistics. However, I don't understand one point that I see many queries which I didn't run. I mean how come these queries executed? and by who?
    thanks

    some could be recursive sql statemets run by oracle. Post some example what you are running and what you are seeing?
    The SQL statements can be listed in a TKPROF report in the order of how much resource they used, if desired. Also, recursive SQL statements issued by the SYS user to manage the data dictionary can be included or excluded.
    How to Use and Understand the TKPROF utility

  • OCCI/ODBC application sql trace failure...

    Hi,
    I was doing the sql*net trace for an OCCI/ODBC Application writen in c++. I have an InstantClient on my PC. I was trying to access the Oracle through my C++ program to
    compare the performance of OCCI and ODBC.
    I was using the Oracle 10g(ver10.2.0.1.0 ), Oracle instant cilent(win32-10.2.0.3-20061115), and VS 8.0.
    TNSNAMES.ora:
    ORCL =  
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    (SID = ORCL)
    LISTENER.ORA:(It was created by net manager.)
    SID_LIST_LISTENER =
      (SID_LIST =
      (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (ORACLE_HOME = F:\oracle\product\10.1.0\Db_3)
      (SID_NAME = ORCL)
    LISTENER =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = HOST_NAME)(PORT = 1521))
    The sqlnet.ora file was writen to trace the client sql. Fortunately, my C++ program can access the oracle and get my result back successfully. In the same time, the trace files
    can be created, but when using the tkprof tool to explain it, it comes to the file with useless information.
    One of the *.trc file explaind by tkprof tool:
    Sort options: default
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    Trace file: ora21763.trc
    Trace file compatibility: 8.00.04
    Sort options: default
    1 session in tracefile.
    0 user SQL statements in trace file.
    0 internal SQL statements in trace file.
    0 SQL statements in trace file.
    0 unique SQL statements in trace file.
    327 lines in trace file.
    Finally, I got TNS-12518 TNS-12564 error. I tried to add DIRECT_HANDOFF_TTC_LISTENER=OFF, but it didnt work. I traced the listener, the error occured in the listener.trc "
    ntt2err: soc 464 error " and " nsbequeath: error reading REDIR/NSE msg".
    I just cann't get the right trace file and cann't sovle the two errors(TNS-12518 TNS-12564). Can somebody give me some advices, please.

    Hi,
    The TKPROF facility accepts as input an SQL trace file generated when SQL Trace has been turned on for the system or a session, not a SQL*NET trace file. A SQL*Net trace file is a dump of raw data packets and communications at the SQL*NET layer. If you want to get performance statistics from SQL beign executed by your application, then you need to turn on SQL Trace not SQL*MET tracing.
    To enable SQL trace at the system level, you need to execute:
    alter system set SQL_TRACE=TRUE
    The NS-12518 TNS-12564 normally means you are running into some sort of resource deletion issue. This can be caused by various things. Make sure you are properly cleaning up and closing sessions in your application.
    Are you performing some sort of stress test or have you just written a Multi-threaded test harness that executes different types of SQL with OCCI/ODBC?
    HTH
    J.B.

  • Explain plan not displayed in sql trace file

    Hello,
    I don't understand why in sql trace file, after tkprof transformation, for several queries the explain plan is displayed and for several queries, no explain plan is displayed.
    How can I have the explain plan for all queries?
    Thanks for your help.

    Was this a trace started on an already running task? Was the trace stopped before the task completed? Did the trace file reach its set size limit before the task compled?
    In all three cases above you would have cursors that were not closed and stats information not written to the trace file resulting in incomplete data for some SQL.
    HTH -- Mark D Powell --

  • Ability to perform ALTER SESSION SET SQL TRACE but not all alter clauses

    I see that in order to run the ALTER SESSION SET SQL TRACE command, the user should be explicitly granted alter session privilege as the CREATE SESSION privilege alone is not enough. Is there a way to grant the ability to perform ALTER SESSION SET SQL TRACE but not the other clauses such as GUARD, PARALLEL & RESUMABLE?.
    Thanks
    Sathya

    If you are using Oracle 10g and above, you can use DBMS_SESSION.session_trace_enable procedure,
    it doesn't require alter session system privilege.
    Simple example:
    SQL> connect test/test@//192.168.1.2:1521/xe
    Connected.
    SQL> alter session set tracefile_identifier='my_id';
    Session altered.
    SQL> alter session set sql_trace = true
      2  ;
    alter session set sql_trace = true
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> execute dbms_session.session_trace_enable;
    PL/SQL procedure successfully completed.
    SQL> select * from user_sys_privs;
    USERNAME                 PRIVILEGE                    ADM
    TEST                      CREATE PROCEDURE                NO
    TEST                      CREATE TABLE                    NO
    TEST                      CREATE SEQUENCE                    NO
    TEST                      CREATE TRIGGER                    NO
    TEST                      SELECT ANY DICTIONARY               NO
    TEST                      CREATE SYNONYM                    NO
    TEST                      UNLIMITED TABLESPACE               NO
    7 rows selected.
    SQL> execute dbms_session.session_trace_disable;
    PL/SQL procedure successfully completed.
    SQL> disconnect
    Disconnected from Oracle Database 10g Release 10.2.0.1.0 - Productionand here is result from tkprof:
    TKPROF: Release 10.2.0.1.0 - Production on So Paź 23 00:53:07 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Trace file: xe_ora_176_my_id.trc
    ( ---- cut ---- )
    select *
    from
    user_sys_privs
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.08       0.08          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.01       0.01          0         15          0           7
    total        4      0.09       0.09          0         15          0           7
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 61 
    Rows     Row Source Operation
          7  HASH GROUP BY (cr=15 pr=0 pw=0 time=11494 us)
          7   CONCATENATION  (cr=15 pr=0 pw=0 time=4913 us)
          0    MERGE JOIN CARTESIAN (cr=4 pr=0 pw=0 time=1169 us)
          0     NESTED LOOPS  (cr=4 pr=0 pw=0 time=793 us)
          0      TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=592 us)
          0      INDEX RANGE SCAN I_SYSTEM_PRIVILEGE_MAP (cr=0 pr=0 pw=0 time=0 us)(object id 312)
          0     BUFFER SORT (cr=0 pr=0 pw=0 time=0 us)
          0      TABLE ACCESS FULL USER$ (cr=0 pr=0 pw=0 time=0 us)
          7    NESTED LOOPS  (cr=11 pr=0 pw=0 time=3429 us)
          9     HASH JOIN  (cr=9 pr=0 pw=0 time=2705 us)
          9      TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=512 us)
         63      TABLE ACCESS FULL USER$ (cr=5 pr=0 pw=0 time=914 us)
          7     INDEX RANGE SCAN I_SYSTEM_PRIVILEGE_MAP (cr=2 pr=0 pw=0 time=510 us)(object id 312)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2       20.64         20.65
    BEGIN dbms_session.session_trace_disable; END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.00          0          0          0           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 61 

  • SQL trace query parameters

    Hi,
    I'm sending SQL queries to Oracle through JDBC, and I want to debug these SQL queries with SQL trace.
    My problem is when i want to view the trace files via tkprof, my queryies do not show the parameters.
    For example: SELECT * FROM mytable WHERE mycolumn = :1
    I would like to see the value of :1.
    How can i do that?
    Thanks

    user610868 wrote:
    Hi,
    I'm sending SQL queries to Oracle through JDBC, and I want to debug these SQL queries with SQL trace.
    My problem is when i want to view the trace files via tkprof, my queryies do not show the parameters.
    For example: SELECT * FROM mytable WHERE mycolumn = :1
    I would like to see the value of :1.
    How can i do that?
    Thankstrace level must be set to 4 to capture BIND variable values

  • CLIENT 에서 SQL TRACE 뜨기

    제품 : ORACLE SERVER
    작성날짜 : 2002-05-07
    PURPOSE
    Client에서 SQL trace를 뜨는 방법
    EXPLANATION
    오라클을 사용하는 tool 에서 sql trace 를 사용하고자 하면
    alter session set sql_trace=true ; 를 사용한다.
    또는 dbms_session.set_sql_trace (true) 사용한다.
    이는 forms 를 비롯하여 precompiler 를 포함한다.
    또 이의 반대는
    alter session set sql_trace= false ; 를 사용한다.
    또는 dbms_session.set_sql_trace (false) 사용한다.
    이 때 실행된 결과는 user_dump_dest 에 쌓이는데 , file 이름은 process 번호를
    참고한다.
    그러나 MTS 의 경우 trace file 의 구분이 모호해지므로 client를 connect 시
    dedicate 로 붙여 trace 를 사용하여야 하며, 만일 다른 session 에서 다른
    session의 것을 trace 뜨고 싶으면,
    dbms_system.set_sql_trace_in_session 을 사용할 수 있다.
    EXAMPLE
    이의 사용법은 다음과 같다.
    1. Setup
    catproc.sql 에서 생성되는 package 와는 달리 dbms_system 의
    public synonym 은 생성되지 않고 권한도 부여되지 않는다.
    DB 생성 초기에 SYS user 만 reference 할 수 있으므로 이 package 를
    사용할 user에게 권한을 부여한다.
    예제 : GRANT EXECUTE ON DBMS_SYSTEM to username;
    2. v$session 으로부터 SID 와 serial 번호를 부여한다.
    SQL> select sid, serial#, osuser, username
    2> from v$session;
    SID SERIAL# OSUSER USERNAME
    7 66 <osLogin> <oracleUserName>
    3. 원하는 session 에서 SQL trace 를 setting 한다.
    exec sys.dbms_system.set_sql_trace_in_session
    (12,16631,TRUE);
    또는 pl/sql procedure 에서:
    begin
    sys.dbms_session.set_sql_trace ((<sid>,<serial>,TRUE);
    end
    4. session 에서 SQL Trace 를 끝마친다. 이 결과는 user_dump_dest에
    쌓인다.
    exec sys.dbms_system.set_sql_trace_in_session
    (<sid>,<serial>,FALSE);
    또는 pl/sql procedure 에서
    begin
    sys.dbms_session.set_sql_trace (<sid>,<serial>,FALSE);
    end
    만일 os user 가 khpark 인 client 에서 실행하는 sql 의 trace 를 뜨고
    싶으면
    svrmgrl> select sid,serial#,osuser from v$session
    where osuser='KHPARK';
    sid serial# osuser
    =================================================
    8 12 khpark
    svrmgr>execute dbms_system.set_sql_trace_in_session (8,12,TRUE);
    이렇게 하면 udump 에 trace file 이 생기므로 이를 이용하여 tkprof 를 수행한다.
    REFERENCE DOCUMENT
    ---------------------

    Hello Carl,
    SQL Trace and SQL Profiler are deprecated since SQL Server 2012 which means that at any future version it might not be available anymore. Have you considered using Extended Events - Microsoft.SqlServer.Management.XEvent
    Namespace?
    Ivan Donev MCT and MCSE Data Platform
    I've spent a fair bit of time reading about XEvents - eventually I won't need SQL 2008 support anymore and I can stop using Trace - but I'm not seeing anything remotely close to TraceServer.  What I see is an elaborate infrastructure for efficiently
    collecting information about high volume OLTP workloads with minimal server impact.  That's all well and good, but of no use to me at all.  What I'm looking for is real-time information about OLAP database processing that I can embed in my app to
    provide detailed metrics on same.  
    Presumably something can be put together using XEvents as the source and ETW as the target, with real-time monitoring of ETW events, but that's a lot of API to get a handle on, and I haven't seen any helpful samples that show putting it all together to get
    a profiler-like experience with live viewing of processing events as they happen.
    Any pointers to helpful samples/resources on XEvents are appreciated - long term, that's going to be my path, I'm sure.
    -cd Mark the best replies as answers!

  • In SQL Trace how to see which statement getting more time .

    Hi Expart,
    In SQL Trace (T-code ST05) . I am running the standard transaction . how to see which statement
    running more time and less time . suppose one statement running more time so how resolve the
    performance .
    Plz. reply me
    Regards
    Razz

    > The ones in 'RED' color are the statement which are taking a lot of time and you need to
    > optimise the same.
    No, that is incorrect, the red ones show only the ones which need several hundret milliseconds in one execution. This can even be correct for hard tasks. And there are lots of problem, which you will not see
    I have said everything here:
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    Go to 'Tracelist' -> Summarize by SQL statements', this is the view which you want to see!
    I summarizes all executions of the same statement.
    There are even the checks explained, the slow ones are the one which need a lot of time per record!
    See MinTime/Rec > 10.000 microseconds.
    Check all number of records, executions, buffer, identicals.
    The SE30 Tipps and Tricks will not help much.
    Siegfried

  • Sql trace

    Hi All,
    I am new to this ABAP field..
    I know how to do SQL trace ....But what I am not getting is " <b>HOW CAN WE TELL FROM THE OUTPUT OF SQL TRACE, THAT THIS IS THE CAUSE OF SLOW PERFORMANCE OF A REPORT</b>" Based on what are we determining the performance?
    Can Anybody help me here pls?............
    Kelly

    Hi Kelly,
    if you really have no idea, why a report is slow, then you have to start with SE30 (runtime analysis).
    There are three bargraphs: ABAP / database / system.
    System should be more or less nothing.
    If ABAP is bigger than database: have a look at slow abap-statements (normally operations with internal tables: read, delete, loop where,...); classic reason: to much reads without binary search / sorted table / hashed table use.
    If database is bigger than ABAP: have a look at your SQL statements. If you can see already forgotten key fields, fine - otherwise SQL trace will bring help in analyzing.
    A SQL trace itself says nothing about overall performance (which is done by runtime analysis), only about database part. But 'normally' programmers have their ABAP-part in control and struggle only with slow selects: that's the reason, why often SQL trace is used immediately.
    I hope, this brings a little bit light in your question,
    regards,
    Christian

  • Create sql trace files on client machine

    Hi
    oracle creates sql trace files on server side, what are possible and best ways of sharing those files with end users? is it possible to create them on client side instead?

    Dbb wrote:
    Hi
    Hi
    oracle creates sql trace files on server side,
    Yes
    what are possible and best ways of sharing those files with end users?
    Using shared directory. Use the parameters dump to point to it
    is it possible to create them on client side instead?
    No
    . :-) any help with my english is wellcome :-) .does this mean sharing user_dump destination at linux level and then mounting it from client machines ( win xp )?is there any doc on this?

  • How to look at the SQL trace in Oracle

    Hi,
    How do we look for the SQL trace in Oracle?
    With SQL trace I mean all the SQL statements being executed in Oracle database ( including select ).
    Thanks........

    Thanks for a quick reply nbellam. I wonder if there is a way to find out the date and time when the sql was executed?

  • Analysing details of SQL trace and runtime analysis for a report.

    Hi,
    I am trying to tune the performance of a Z ABAP report for target group export. A brief overview of what is done in the report is the retrieval of BP details present in the Target group including BP general, address, marketing attributes, person responsible and contact person details. As the target groups can be quite huge (around 6000 BPs), the report gives performance issues. I want to understand on how to analyse the details which I obtained from the run time analysis and SQL trace and on how to take it forward.
    Any inputs in this regard would be helpful.
    Thanks in advance,
    Anushree

    In Runtime analysis Look for
    ABAP -  In your ABAP code
    DATABASE  -  It shows the performance of your SELECT statements in your program.
    Just check how much % it is showing for both.
    Check for following in your code.
    1) Avoid SELECT *
    2) Clear internal tables values which are not required at the ending of program, as it saves memory
    etc.

Maybe you are looking for