Trace file and TKPROF

Hi All,
While tuning procedures generally I go through all queries, generate explain plans to check which is expensive and try yo tune that.Recently I got some procedures in top buffer gets list.when I gone through all queries. All using Indexes and cost is very low and accessing small tables.The number of iterations in the loop also not much.But it is taking 3 million bufffer gets for each execution.
How can I find out which part of procedure is causing these many buffer gets? Currently I dont have acces to trace files and TKprof.If I get access How it is going to help me in tuning the above procedure.
I need to explain effictively to DBA the use of trace and TKprof to get this access.

TKPROF will give buffer gets usage by query. If the same query (with bind variables) is executed several times, you will get a summary for all executions of the same query. You can also switch on and off trace with ALTER SESSION statement to limit tracing and even do it from another session (see
http://asktom.oracle.com/pls/ask/f?p=4950:8:12005269305828706290::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:330817260752)
For SQL trace and TKPROF usage, see
http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96533/sqltrace.htm#1018

Similar Messages

  • Get the session trace files and also the TKPROF reports for storedprocedure

    Hi ,
    I am trying to find out the bottlenecks on a storedprocedure, which does a insert into a table, where the target table has lot of indexes/constraints, so i want to see, which indexes/constraints is causing the problem. so in order to do I want to get the session trace files and also the TKPROF reports to see the bottlenecks for a oracle stored procedure,
    Could you please give us the list of steps to get the tracefiles and tkprof reports.

    781649 wrote:
    Thanks for input, i am using oracle10g standard edition. i dont think i have these tools available (DBMS_PROFILER or DBMS_HPROF). Did you even bother to try the following?
    SQL> DESC DBMS_PROFILER
    SQL> DESC DBMS_HPROF
    I understand it would be too much to expect you to actually Read The Fine Manual
    I am using bulk collect for all in my storedprocedure to insert the rows into a big table. In order to perform analysis on this bulk collect which tool will help me to identify the bottlenecks .
    I want to compare background session properties for both runs (like inserting the data with indexes/constraints vs without indexes/constraints). please let me know..I am willing to bet you the problem/slowness is on the SELECT side & not the INSERT!
    Just Curious
    Handle:      781649
    Status Level:      Newbie
    Registered:      Jul 12, 2010
    Total Posts:      35
    Total Questions:      17 (14 unresolved)
    Why so many unanswered questions?
    Edited by: sb92075 on Jan 17, 2012 3:13 PM

  • Trace Files and Deadlocks

    Hi,
    I've gotten a bunch of deadlocks in 8.1.7 and I'd like to be able to make use of the trace files, but the files are really cryptic and I can't find any documentation anywhere that explains how to read them. Moreover, I can't find any software that knows how to process them into something useful (tkprof just gives a basically empty file in return).
    Anyone have any ideas?
    TIA

    Hi
    My current application (still under development) is experiencing Oracle
    deadlock problems.
    The application is written using VB thru ADO and COM, Oracle 816.
    My problem is that, while I can review the trace file produced, I can't
    figure out what the actual deadlock is occurring on. I have seen deadlock
    trace files that clearly state "table blah", but in this case, I get:
    *** 2003-06-21 14:32:03.841
    *** SESSION ID:(27.31211) 2003-06-21 14:32:03.810
    DEADLOCK DETECTED
    Deadlock graph:
    ---------Blocker(s)--------
    Resource Name process session holds waits process session holds
    waits
    DX-0000003b-00000000 22 18 X 24 27
    X
    session 18: DID 0001-0018-0000003C session 27: DID
    0001-0018-0000003C
    Rows waited on:
    Session 27: no row
    *** 2001-06-21 14:32:03.857
    ksedmp: internal or fatal error
    ORA-00060: deadlock detected while waiting for resource
    Is there something like TKPROF that will process the trace file and give
    me
    more info on what is happening? It looks like I am waiting for a resource
    to be freed, but which one is the question.
    thanks for any help.

  • In trace file and output file showing bind variable instead of value

    Hi,
    database 9i
    optimizer = choose(for cost based)
    In my trace file and output file showing bind variable instead of value.
    in my trace file 20 queries.
    I alse set this parameter in session level.
    alter session set events '10046 trace name context forever, level 4';
    but still showing traceoutput file bind variable.
    Pls help its very urgent

    Can you post the query for which the bind variable values are not being shown and the trace output for the same?
    Probably it is listed down somewhere when you actually executed the query among the others. Try completely analyzing your trace file..

  • Trace file and control files !!

    hi,
    I have created trace file of the control files by using 'alter database backup controlfile to trace' command. i have two questions..where can i find this trace file and how can i use this trace file to generate the control files.
    Waiting for the replies...
    Regards,
    Saad Bin Khalid

    1. You can fine the trace in the udump folder ... you can check the file time stamp to check when you created the file as it may be possible that here are other user trace files too
    $ sqlplus / as sysdba
    SQL> alter database backup controlfile to trace;
    Database altered.
    SQL> show parameter USER_DUMP_DEST
    NAME TYPE VALUE
    user_dump_dest string /PROD/udump
    SQL> exit
    $ cd /PROD/udump
    $ mv PROD_ora_30823.trc cr_ctl.sql
    $ vi cr_ctl.sql
    edit the control file script
    Now you have a new control file script to re-create your control file.
    2. You can edit the same and execute at nomount stage to generate new controlfiles ... remember controlfiles should be removed before creating the new ones

  • How to monitor user logs,security logs,trace file,and performance monitori

    Hi guys,
    pls tel me how to monitor user logs,security logs,trace file,and performance monitoring.
    thanks
    regards
    kamal

    Hi,
    you can have a look in the Netweaver administration :
    http://<portal>:<port>/nwa
    Go to monitoring, Java system reports, etc..., you will find what you want.
    Fabien.

  • Delete TREX Trace Files and Turn TREX Off

    Hi ,
    We have massive amounts of TREX trace files that are taking up all of the memory. How do I delete these files? How do I know what files to delete? Also we are not using TREX in our BI server, how do I turn this OFF so that these files and never created?
    Note from Moderator- don't use all caps in title as it is seen as shouting
    Thanks
    Edited by: Marilyn Pratt on Jan 27, 2009 12:19 PM

    Hi Sanam,
    For the TREX Preprocessor trace, You define the maximum file size for the input and output of documents in INI file - TREXPreprocessor.ini
    The default size is set to 'Unlimited'
    Please check the following values maintained in the configuration file.
    Section: [ httpclient ]
    Parameter: max_content_length
    Default: Unlimited
    Also read,
    http://help.sap.com/saphelp_sm32/helpdata/en/1d/8d49cc304dd843a3a4a23d74888939/content.htm
    Hope this is helpful.
    Regards,
    Varun

  • ORA-00600 , Internal Error ,  Trace File and 50% CPU use HTMLDB library

    Hi HTMLDB team
    One HTMLDB allpication processes generated an ORA-00600 error as follows :
    ORA-00600: internal error code, arguments: [kohdtf048], [], [], [], [], [], [], []
    The Trace file is as follows :
    *** SESSION ID:(32.925) 2006-08-01 13:17:07.574
    *** 2006-08-01 13:17:07.497
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [kohdtf048], [], [], [], [], [], [], []
    ORA-06502: PL/SQL: numeric or value error
    ORA-06502: PL/SQL: numeric or value error
    ORA-06502: PL/SQL: numeric or value error
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    null;
    null;
    null;
    f(p=>:p);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    null;
    null;
    commit;
    else
    rc__ := 0;
    null;
    null;
    null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    Also , this process has been consuming an unacceptable amount of cpu :
    18146 oracle 1 0 0 3924M 1840M cpu/1 167:24 49.62% oracle
    OEM reports the lastest SQL run by this process is the same as above.
    Is there anyway I could upload the trace file for you to have a look at ?
    Thanks
    Indira

    Hi HTMLDB team
    One HTMLDB allpication processes generated an ORA-00600 error as follows :
    ORA-00600: internal error code, arguments: [kohdtf048], [], [], [], [], [], [], []
    The Trace file is as follows :
    *** SESSION ID:(32.925) 2006-08-01 13:17:07.574
    *** 2006-08-01 13:17:07.497
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [kohdtf048], [], [], [], [], [], [], []
    ORA-06502: PL/SQL: numeric or value error
    ORA-06502: PL/SQL: numeric or value error
    ORA-06502: PL/SQL: numeric or value error
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    null;
    null;
    null;
    f(p=>:p);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    null;
    null;
    commit;
    else
    rc__ := 0;
    null;
    null;
    null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    Also , this process has been consuming an unacceptable amount of cpu :
    18146 oracle 1 0 0 3924M 1840M cpu/1 167:24 49.62% oracle
    OEM reports the lastest SQL run by this process is the same as above.
    Is there anyway I could upload the trace file for you to have a look at ?
    Thanks
    Indira

  • APEX Overhead and trace files

    Hey everyone,
    We've been asked to "stress" and "load" test our application as it is predicted our user base might grow in the near future (company acquisitions/etc)...
    Unfortunately, there is concern about the overhead added by APEX.  From everything I've read, I do not personally believe APEX adds much to each page view (as compared to our own self-managed data), however I need to PROVE this to our system admins/etc.  Simply referencing things on the internet like "APEX doesn't add much overhead" doesn't exactly make the case.
    To accomplish my mission, I've done the following:
    1) generated a trace file on a test page by appending the following to the end of the URL:
    "&p_trace=YES" (without quotes)
    2) found the location of trace files using:
    select value from v$parameter where name = 'user_dump_dest';
    3) found the exact trace file for my apex page view
    grep -l "3853406964369" *.trc (where the number in quotes was the session id taken from my apex url)
    4) formatted the trace file using tkprof from the linux command line:
    tkprof orcl_ora_24115.trc tkprof_output
    Now, I'm in the process of examining the file.  It is great that it shows everything involved in generating a page!  A couple of quick questions though.
    A) is it safe to assume that this trace file (found by using my method above in steps 1-4) only contains records associated with my single apex page view?  My fear is that just because a file contains my session id, that does not guarantee that other random stuff from other sessions is also in the same file (sorry i'm new to trace files and especially trace files generated by apex).
    B) if i view a second page with the trace=YES, will a second file get generated or does it get combined into 1 file?  how can i easily tell which file is for which page view?
    C) is there an easy way to differentiate what queries would normally be made by oracle (regardless of the UI) versus queries ran by APEX specifically (which would not occur if we were using PHP for a front end)?
    Specifically, I see queries (similar to the following) that do not appear to be APEX specific from what I can tell:
    -- example 1 --
    select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
      i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
      i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
      nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
      i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
      nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
      null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
      ist.logicalread
    from
    ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
      min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
      valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
      i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj#
    -- example 2 --
    select intcol#, toid, version#, intcols, intcol#s, flags, synobj#
    from
    subcoltype$ where obj#=:1 order by intcol# asc
    and I see queries that are definitely APEX related (based on the existence of references to wwv objects):
    -- example 3 --
    SELECT ID, BRANCH_NAME, BRANCH_ACTION, BRANCH_POINT, BRANCH_TYPE,
      BRANCH_CONDITION, BRANCH_CONDITION_TEXT, BRANCH_CONDITION_TYPE,
      BRANCH_WHEN_BUTTON_ID, NVL(SAVE_STATE_BEFORE_BRANCH_YN,'N'),
      SECURITY_SCHEME
    FROM
    WWV_FLOW_STEP_BRANCHES WHERE FLOW_ID = :B4 AND FLOW_STEP_ID = :B3 AND
      BRANCH_POINT = 'BEFORE_HEADER' AND (REQUIRED_PATCH IS NULL OR
      (REQUIRED_PATCH > 0 AND (:B2 IS NULL OR INSTR(:B2 ,
      ':'||TO_CHAR(REQUIRED_PATCH)||':') = 0) ) OR (REQUIRED_PATCH < 0 AND (:B1
      IS NULL OR INSTR(:B1 ,':'||TO_CHAR(0-REQUIRED_PATCH)||':') = 0) ) ) ORDER
      BY BRANCH_SEQUENCE, ID
    and then of course it's easy for me to identify any queries that are based on our code because I recognize the object names we use.
    In the mean-time I'm starting to look into how to interpret trace files (outside of the context of apex).
    My biggest concern is that I do not want to "ding" or "tax" APEX for queries that it had nothing to do with and that would be ran by oracle regardless of the UI we use to "view a page".
    Thanks!

    Move older audit files to a different filesystem until you find someone being able to define what files can be deleted.
    Regards
    Gustavo Restuccia

  • Explain Plan from TKPROF trace file.

    Hello,
    My procedure is taking time for that i have trace on in procedure fo find explain plan of particular query.
    Using below statement Trace is on.
       EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE = TRUE';
       EXECUTE IMMEDIATE 'ALTER SESSION SET TIMED_STATISTICS = TRUE';Now for getting expalin plan from TKPROF i have used below statement but for some query i have found explain paln and some case i cant found explain plan.
    tkprof mf_ora_23773.trc mf_ora_23773.txt explain =abc/abc
    can u please help me to analyze where i m wrong?
    Thanks.

    First of all, you should best avoid using the explain= clause on the tkprof command line.
    This will run explain plan on the statement in the trace file, and that explain plan can even be wrong, as there is no information on datatypes in the trace file.
    The real explain plan data is flushed to the trace file, when the program issues commit or rollback. Oracle always issues an implicit commit when the program disconnects, so when you run the program to completion you should have explain plan output in your trace files.
    You won't get explain plan output if you don't have access to the objects in the SQL statement. Also recursive SQL won't produce explain plan result.
    One would need to see part of your trace file to verify your assertion the explain clause doesn't always work.
    Sybrand Bakker
    Senior Oracle DBA

  • Tkprof : 0  user  SQL statement in trace file

    Hello!
    Please explain , what is difference of tkprof-converting of user session trace file and an internal/background process ?
    Get I message "0 user SQL statement in trace file" cause this difference?
    In my target session I issued :
    begin
    sys.dbms_system.set_ev(...., .., 10046, 12, '');
    end;
    begin
    sys.dbms_system.set_ev(..., .., 10053, 1, '');
    end;
    /Thanks and regards,
    Pavel

    Did you try to tkprof a 10053 trace ?
    That is not going to show anything. 10053 traces are meant to be read as they are. tkprof is there to deal with 10046 traces.

  • TKPROF LINES IN TRACE FILE

    Hi,
    Maybe someone can explain something to me. I ran tkprof on a trace file and the result was there was no output except for one line item. It read that there were 6800 lines in trace file. I wish to read these lines but am unable because I don't know how to format the command.
    Would someone please explain to me how to get this utility to open these 6800 up for me to view?
    It would be appreciated.
    Thanks in advance.
    al

    If you need to read the raw trace file, simply open the same in notepad or any editor.
    The reason that your tkprof output does not show anything is due to the fact that there are no sql's in the trace file. Probably you are trying to analyze a kind of memory dump.

  • Useful logs and trace files

    Hello experts, for our Netweaver AS administration, I am in charge of periodically checking logs and trace files. I would like to know which are the most useful logs and trace files and the information each one will hold. I am familiar with "DefaultTrace.trc", and as of today it is the only one I have used, but I believe I should also be looking at other logs and trace files.
    Any suggestions?

    Hi Pedro,
    If you are talking about JAVA only system defaulttrace is the best log/trace to look, there are other log files like application log, but maybe the best way to check you logs is using NWA (NetWeaver Administrator) on the following URL on your JAVA system:
    http://<hostname>:<port>/nwa
    From there you need to go to Monitoring -> Logs and Traces and then Predefined View/SAP logs.
    My other recommendation is to change the severity level to ERROR for all you JAVA component within the Visual Administrator -> ServeNode -> Services -> Log Configurator -> Locations, otherwise it is possible that you see a lot of garbage on the defaulttraces. Anyway you can change the severity level per component, on demand, to investigate any possible problem.
    The work directory is very imporant and maybe you can also check the file "dev_serverX" that also will give you information about any out of memory conditions and garbage collection activity if you have these values set for the server node using the config tool:
    -verbose:gc
    -XX:+PrintGCDetails
    -XX:+PrintGCTimeStamps
    You can find more information on here:
    http://help.sap.com/saphelp_nw70/helpdata/en/ac/e9d8a51c732e42bd0e7de54b9ff4e2/content.htm
    Hopefully this help you, let me know if you need more information,
    Zareh

  • Trace file problem

    I got a tkprof trace file and found the following message at the top of the trace file:
    The following statement encountered a error during parse:
    SELECT INVOICE_ID FROM AP_PAYMENT_SCHEDULES WHERE INVOICE_ID = :b1 FOR UPDATE OF AP_PAYMENT_SCHEDULES NOWAIT
    Error encountered: ORA-00904
    Is this will affect the payment performance?
    Thanks
    Devon

    ORA-00904:     string: invalid identifier
    Cause:     The column name entered is either missing or invalid.
    Action:     Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks. It may not be a reserved word.
    This means that you are trying to put some thing which Oracle can't understand. I wouldn't be worried about the performance of the query since it would be a question once the query would run. So check the query why its throwing this error.
    Aman....

  • 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 --

Maybe you are looking for

  • I opened a link in an email from Penney's to print a coupon. All Firefox printed was a blank sheet of paper.

    The coupon opens in a new window. My printer is connected but all that comes out is a blank sheet of paper. I copied the URL to IE, the coupon opened in a new window, and it printed. What is blocking the printing in Firefox?

  • Logical DB FMF and BCS budgeting system

    Hi, we are using SAP version 4.7.  We are currently in the process of migrating our budgeting from Former Budgeting System (FBS) to the new Budget Control System (BCS).  We have ABAP reports that uses logical database FMF.  I am trying to find a docu

  • Acrobat 9 Products with Windows XP Media Center 2005

    Hello, I'm wondering if any users are running Acrobat 9 Standard or Pro on Windows XP Media Center 2005. I'm currently annotating pdfs for a client but was leery of purchasing Standard or Pro because Media Center is not mentioned under the System Req

  • Nokia N97 not charging

    My Nokia N97 use to be in perfect condition and would charge every time i plug it in. However, lately whenever I plug it in, it charges and then it stops and says "Unplug charger from power supply to save energy" and then it says "Not Charging" and t

  • Array of objects as a part of request

    Hi, I have a complex type which is a parameter of my web service's method. Is it guarantied that the order of object will be the same on client and server side after WLS does the deseriliazation? For Example (Array of address objects) Constructor of