Calculate execution time of procedure

hiii
I create procedure that insert data in multiple tables i want to calculate execution time of procedure the start time
and the end time to insert them in a table .
and i want to calculate the start&end time that the procedure take to insert in each table
i use DBMS_UTILITY.GET_TIME but it gives me in millisecond i want the format DD/MM/YYYY HH:MI:SS
i also use sysdate but it gives un un reasonable time
like the start time more than the end time
how to calculate execution time of procedure???????
thanks

Look at the docs for DBMS_PROFILER.
http://www.evdbt.com/2004_presentation_Q10.ppt
Bye Alessandro

Similar Messages

  • Execution time of procedures

    How can find out the execution time of procedures.
    I've debug and find why a procedure takes so much time for its execution.
    Could someone please help me with tips or links to useful info.

    First you can use the SQLPlus feature "set timing on" This will print the run time of each SQL or pl/sql procedure executed in the session.
    Second you can modify the pl/sql code to include timing information so as the code runs it dumps and/or calculates step and procedure run time.
    Third look at the dbms_profiler package Oracle provides.
    HTH -- Mark D Powell --

  • How can i calculate execution time for methods?

    I'm making a project that i want to calculate execution time for a
    method in "miliseconds" or "microseconds".You see,I have a sort algorithm and i want to calculate execution time of this algorithm.How can i do?
    Thanks...

    Just remembered.
    The answer you get isn't trustworthy below a hundred millis, so you may need to sort a hundred or a thousand times to get a reasonable elapsed time. You also need to run the test five or ten times and take an average. In Windows you should fire up the Task Manager and be sure that your other CPU usage is as near to zero as you can get.

  • How to calculate Execution Time

    Hi gurus,
    Can any one tell me how to calculate the Report Execution time in Seconds.
    We have one requirement.My manager told me track all the reports in Development server how much time those take to execute. and Compare those with Production server.
         I dont have an Idea how to calculate the Execution time in Seconds.
    Please guide me on this.
                    Thanks in Advance
    Thanks and Regards
    Siri...

    hi
    check se30
    enter the prog name and press execute.
    after your execution is over press back
    then press evaluate in the initial screen.
    you have the analysis
    in that you will get the time in microseconds and you can convert to sec
    REWARD IF HELPFUL
    PRASANTH

  • Execution time of procedure ???

    Hello gurus,
      SQL> BEGIN
      2    in_proc;
      3    COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    when i run above code ...it doesnt say the elapsed time or time it took to execute ...any idea to know how to get the time it took for execution ??
      Thank you!!!

    SQL> set time on;
    1:59:33 PM SQL> begin
                 2   dbms_output.put_line('hello');
                 3  end;
                 4  /
    PL/SQL procedure successfully completed
    1:59:45 PM SQL> or
    SQL> set serveroutput on;
    SQL> begin
      2    dbms_output.put_line('start: '||to_char(sysdate,'dd-mon-yyyy hh24:mi:ss'));
      3    dbms_output.put_line('hello');
      4    dbms_output.put_line('end: '||to_char(sysdate,'dd-mon-yyyy hh24:mi:ss'));
      5  end;
      6  /
    start: 01-mar-2010 14:01:22
    hello
    end: 01-mar-2010 14:01:22
    PL/SQL procedure successfully completed
    SQL>

  • Execution time for web reports

    Hello every one,
    How to calculate execution time for web reports, for query execution we will go through RSRT, by giving query name and press execute + Debug button then select statistical data & Do not Cache buttons then press enter, after getting output press on back button, we will get duration of the query.....
    But my question is , can we calculate execution time for webreport, if so can you please guide me.
    and can you also tell me , if there is any RRI for one report, how to calculate execution time for these queries.
    Ex : Query ABC have XYZ as its drilldown report , i need to calculate execution time for XYZ report via ABC report.
    Thanks in advance,
    Best Regards.
    NP.

    Hi,
    For reports executed in java web you can add the parameter &PROFILING=X
    to the URL in order to record the execution time. Please have a look at SAP note 1048691 for further information.
    Best regards,
    Janine

  • Best way to messure execution time???

    Hi everybody,
    I am trying to messure the time that takes an algorithm to be executed. I am using System.currentTime() at the begin and the end of the algorithm to calculate the time.
    Is there another way to calculate execution time?
    Thanks in advance,
    JB

    If you are on Windows (NT4 anyway) and want something more accurate, you can use this lil' bit of JNI:
    // NanoTimer.java
    package com.baesystems.tc.pete_kirkham.benchmark;
    * Gets ~ nanosecond accuracy time
    * @author Pete Kirkham
    * @version 1.0
    public final class NanoTimer {
       * Get a measure of the current elapsed time.
       * @return the time elapsed since an arbitary point in seconds.
      public static native double currentTime ();
      static {
        System.loadLibrary("nano_timer");
    // nanotimer.cpp - compile to nano_timer.dll
    #include <windows.h>
    #include <winbase.h>
    #include "com_baesystems_tc_pete_0005fkirkham_NanoTimer.h" // generated via javah
    * Class:     com_baesystems_tc_saa_services_NanoTimer
    * Method:    currentTime
    * Signature: ()D
    JNIEXPORT jdouble JNICALL Java_com_baesystems_tc_pete_1kirkham_benchmark_NanoTimer_currentTime
    (JNIEnv *env, jclass cls) {
      LARGE_INTEGER frequency;
      LARGE_INTEGER counter;
      if (QueryPerformanceFrequency(&frequency) && QueryPerformanceCounter(&counter)) {
        return (double)counter.QuadPart/(double)frequency.QuadPart;
      } else {
        return 0.0;
    }Pete

  • Execution Times of Stored Procedures Called from Other Stored Procedures

    If I execute sys.dm_exec_procedure_stats, it will produce execution times of my stored procedures executed recently.
    However, stored procedures called from other stored procedures do not show up.
    Is there code that can return the execution times of stored procedures even though they are called from other stored procedures.

    Look at the example. It is counting nested execution.
    CREATE PROC z1SP AS SELECT * FROM Production.Product;
    GO
    CREATE PROC z2SP AS SELECT * FROM Production.Product WHERE Color is not null; EXEC z1SP;
    GO
    SELECT object_name(2002822197), object_name(2034822311);
    --z1SP z2SP
    EXEC z1SP; EXEC z2SP;
    GO 10
    SELECT * from sys.dm_exec_procedure_stats
    database_id object_id type type_desc cached_time last_execution_time execution_count
    16 2002822197 P SQL_STORED_PROCEDURE 2014-12-16 13:02:45.170 2014-12-16 13:02:46.717 20
    16 2034822311 P SQL_STORED_PROCEDURE 2014-12-16 13:02:45.460 2014-12-16 13:02:46.687 10
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Procedure execution time difference in Oacle 9i and Oracle 10g

    Hi,
    My procedure is taking time on
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 is 14 min.
    same procedure is taking time on oracle Release 9.2.0.1.0 is 1 min.
    1) Data is same in both environment.
    2) Number of records are same 485 rows for cursor select statement.
    3)Please guide me how to reduce the time in oracle 10g for procedure?
    i have checked the explain plan for that cursor query it is different in both enviroment.
    so i have analysis that procedure is taking time on cursor fetch into statement in oracle 10g.
    example:-
    create or replace procedure myproc
    CURSOR cur_list
    IS select num
    from tbl
    where exist(select.......
    EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE = TRUE';
    EXECUTE IMMEDIATE 'ALTER SESSION SET TIMED_STATISTICS = TRUE';
    OPEN cur_list;
    LOOP
    FETCH cur_list INTO cur_list; -----My procedure is taking time in this statement only for some list number. there are 485 list number.
    end loop;
    TRACE file for oracle 10g is look like this:-
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.37 0.46 0 2 0 0
    Fetch 486 747.07 730.14 1340 56500700 0 485
    total 488 747.45 730.60 1340 56500702 0 485
    ORACLE 9i EXPLAIN PLAN FOR cursor query:-
    Plan
    SELECT STATEMENT CHOOSECost: 2 Bytes: 144 Cardinality: 12                                         
         18 INDEX RANGE SCAN UNIQUE LISL.LISL_LIST_PK Cost: 2 Bytes: 144 Cardinality: 12                                    
              17 UNION-ALL                               
                   2 FILTER                          
                        1 TABLE ACCESS FULL SLD.P Cost: 12 Bytes: 36 Cardinality: 1                     
                   16 NESTED LOOPS Cost: 171 Bytes: 141 Cardinality: 1                          
                        11 NESTED LOOPS Cost: 169 Bytes: 94 Cardinality: 1                     
                             8 NESTED LOOPS Cost: 168 Bytes: 78 Cardinality: 1                
                                  6 NESTED LOOPS Cost: 168 Bytes: 62 Cardinality: 1           
                                       4 TABLE ACCESS BY INDEX ROWID SLD.L Cost: 168 Bytes: 49 Cardinality: 1      
                                            3 INDEX RANGE SCAN UNIQUE SLD.PK_L Cost: 162 Cardinality: 9
                                       5 INDEX UNIQUE SCAN UNIQUE SLD.SYS_C0025717 Bytes: 45,760 Cardinality: 3,520      
                                  7 INDEX UNIQUE SCAN UNIQUE SLD.PRP Bytes: 63,904 Cardinality: 3,994           
                             10 TABLE ACCESS BY INDEX ROWID SLD.P Cost: 1 Bytes: 10,480 Cardinality: 655                
                                  9 INDEX UNIQUE SCAN UNIQUE SLD.PK_P Cardinality: 9           
                        15 TABLE ACCESS BY INDEX ROWID SLD.GRP_E Cost: 2 Bytes: 9,447 Cardinality: 201                     
                             14 INDEX UNIQUE SCAN UNIQUE SLD.PRP_E Cost: 1 Cardinality: 29                
                                  13 TABLE ACCESS BY INDEX ROWID SLD.E Cost: 2 Bytes: 16 Cardinality: 1           
                                       12 INDEX UNIQUE SCAN UNIQUE SLD.SYS_C0025717 Cost: 1 Cardinality: 14,078      
    ORACLE 10G EXPLAIN PLAN FOR cursor query:-                                   
         SELECT STATEMENT ALL_ROWSCost: 206,103 Bytes: 12 Cardinality: 1                                         
         18 FILTER                                    
              1 INDEX FAST FULL SCAN INDEX (UNIQUE) LISL.LISL_LIST_PK Cost: 2 Bytes: 8,232 Cardinality: 686                               
              17 UNION-ALL                               
                   3 FILTER                          
                        2 TABLE ACCESS FULL TABLE SLD.P Cost: 26 Bytes: 72 Cardinality: 2                     
                   16 NESTED LOOPS Cost: 574 Bytes: 157 Cardinality: 1                          
                        14 NESTED LOOPS Cost: 574 Bytes: 141 Cardinality: 1                     
                             12 NESTED LOOPS Cost: 574 Bytes: 128 Cardinality: 1                
                                  9 NESTED LOOPS Cost: 573 Bytes: 112 Cardinality: 1           
                                       6 HASH JOIN RIGHT SEMI Cost: 563 Bytes: 315 Cardinality: 5      
                                            4 TABLE ACCESS FULL TABLE SLD.E Cost: 80 Bytes: 223,120 Cardinality: 13,945
                                            5 TABLE ACCESS FULL TABLE SLD.GRP_E Cost: 481 Bytes: 3,238,582 Cardinality: 68,906
                                       8 TABLE ACCESS BY INDEX ROWID TABLE SLD.L Cost: 2 Bytes: 49 Cardinality: 1      
                                            7 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.PK_L Cost: 1 Cardinality: 1
                                  11 TABLE ACCESS BY INDEX ROWID TABLE SLD.P Cost: 1 Bytes: 16 Cardinality: 1           
                                       10 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.PK_P Cost: 0 Cardinality: 1      
                             13 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.SYS_C0011870 Cost: 0 Bytes: 13 Cardinality: 1                
                        15 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.PRP Cost: 0 Bytes: 16 Cardinality: 1      
    so Please guide me how to reduce the time in oracle 10g for procedure?
    1) Is this envrionment setting parameter?
    2) I have to tune the query? but which is executing fine on oracle 9i?
    so how to decrease the execution time?
    Thanks in advance.

    SELECT l_nr
    FROM x.ls b
    WHERE b.cd = '01'
    AND b.co_code = '001'
    AND EXISTS (
    SELECT T_L
    FROM g.C
    WHERE C_cd = '01'
    AND C_co_code = '001'
    AND C_flg = 'A'
    AND C_eff_dt <= sysdate
    AND C_end_dt >=
    sysdate
    AND C_type_code <> 1
    AND C_type_code <> 1
    AND targt_ls_type = 'C'
    AND T_L <> 9999
    AND T_L = b.l_nr
    UNION ALL
    SELECT l.T_L
    FROM g.C C,
    g.ep_e B,
    g.ep ep,
    g.e A,
    g.lk_in l
    WHERE l.cd = '01'
    AND l.co_code = '001'
    AND l.cd = C.C_cd
    AND l.co_code = C.C_co_code
    AND l.C_nbr = C.C_nbr
    AND l.targt_ls_type = 'C'
    AND lk_in_eff_dt <=
    sysdate
    AND lk_in_end_dt >=
    ( sysdate
    + 1
    AND ( (logic_delte_flg = '0')
    OR ( logic_delte_flg IN ('1', '3')
    AND lk_in_eff_dt <> lk_in_end_dt
    AND l.cd = ep.C_cd
    AND l.co_code = ep.C_co_code
    AND l.C_nbr = ep.C_nbr
    AND l.ep_nbr = ep.ep_nbr
    AND l.cd = A.e_cd
    AND l.co_code = A.e_co_code
    AND l.e_nbr = A.e_nbr
    AND l.cd = B.cd
    AND l.co_code = B.co_code
    AND l.C_nbr = B.C_nbr
    AND l.ep_nbr = B.ep_nbr
    AND l.e_nbr = B.e_nbr
    AND l.ep_e_rev_nbr = B.ep_e_rev_nbr
    AND B.flg = 'A'
    AND EXISTS (
    SELECT A.e_nbr
    FROM g.e A
    WHERE A.e_cd = B.cd
    AND A.e_co_code = B.co_code
    AND A.e_nbr = B.e_nbr
    AND A.e_type_code ^= 8)
    AND C_type_code <> 10
    AND C.C_type_code <> 13
    AND l.T_L = b.l_nr)
    --yes index is same                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Java program to calculate next execution time if one cron expression is giv

    In my project requirement i wanted to have one function which will calculate next execution time using cron expression.
    Here i have one cron expression which says every 25 minutes, i want to have one function which will be passed with cron expression and time and function should return next execution time.
    I was wondering if any ready function available for the same.
    Thanks in Advance

    [Did you check here?|http://www.lmgtfy.com/?q=java+cron+expression]

  • How to know child procedure Execution time with in parent procedure

    Hi Team,
    I've a requirement in which I need to get the execution time of a child procedure while its running in a parent procedure in PLSQL. While the child process is running, I want to know its execution time so that if it execution time exceeds more than 5 seconds than I want to through an error. Please let me know by what means this can be achieved in plsql.
    Regards,
    Tech D.

    TechD wrote:
    Hi Team,
    I've a requirement in which I need to get the execution time of a child procedure while its running in a parent procedure in PLSQL. While the child process is running, I want to know its execution time so that if it execution time exceeds more than 5 seconds than I want to through an error. Please let me know by what means this can be achieved in plsql.
    Regards,
    Tech D.PL/SQL is NOT a Real Time programming language.
    The procedure that invokes the child procedure is effectively dormant while the child runs.
    Plus there is no easy way to know when 5 seconds has elapsed.

  • Measure procedure execution time..

    Hi,
    Is there any possibility to measure how long each of a procedure in database take?? Is that possible for Oracle's V$ views or by performance report like AWR? On the other hand, is that possible to measure execution time for SQL statements, but without using "set timing on".
    Best,
    tutus

    This is just an add-on to Satish's reply. You may want to chck this link to see how Profiler works,
    http://www.oracle-base.com/articles/9i/DBMS_PROFILER.php
    HTH
    Aman....

  • Long procedure execution time

    Hello,
    I hav a procedure which consists of select and insert statements(includes Union, Minus, DataType conversions etc.). Three tables of around 27 fields each, are involved in procedure. Table has around 87-90 lakhs of records. This procedure is taking around 7-8 hours for execution.
    There is another almost exactly same procedure with tables of almost same fields, takes less than 5 minutes for execution. How can I optimize the previous procedure so that execution time is reduced.
    Thanks.

    Table has around 87-90 lakhs of records. 1 lakh is 100,000 records.
    How can I optimize the previous procedure so that execution time is reduced.Without even knowing how the procedure looks, we can't comment or even able to help you. Apart from the number of columns and rows, we don't have any other information regarding your procedure or data or index.
    Please elaborate so that anyone can help you.
    Cheers
    Sarma.

  • How can i check the procedure execution time..?

    Hi All,
    Can any one of you tell me how can i check the procedure execution time..?
    Thanks in advance.

    if running it from SQL*Plus,
    SQL> set timing on
    Or from PL/SQL, use DBMS_UTILITY.GET_TIME before and after the call and calclate the difference.

  • Calculate the execution time

    Hi!,
    I wanto to calculate what time Java need to do the execution of some methods...

    You can use the system clock,
    long time = System.currentTimeMillis();
    // do something
    System.out.println("Time= " + (System.currentTimeMillis()-time));The problem is the system clock has a resolution of about 1 millisecond. So you probably will have to call your methods many times and then calculate the average.

Maybe you are looking for

  • Writing OS Script to use at file CC.

    Hi , I have a Requirement in which i have to write a script and use the script as OS command in sender file adapter. Requirement -- When ever the communication channel read a file from directories at FTP server delete that file and paste that file in

  • How can I create a new Tag in Finder?

    Can somebody explain how to create a new Tag in Finder? Thank you very much

  • Running mxmlc from command line - unable to open file

    Hello all, Just tried to get Flex up and running - but have run into probably a simple problem. Here's the scenario: 1. I've put the flex 2.0 installation folder on my C drive such that the path is c:\flex_sdk_2 2. I've set my system path to referenc

  • How do I edit a block of text in thousands of contact records?

    When I imported contact data from my Treo to the iPhone via Address Book on my Mac, my custom fields got entered into the Notes field as X-Palm-Category1: <data>, X-Palm-Category2: <data>, etc. Can I do a global edit changing the text "X-Palm-Categor

  • Server failed to run - Reason:Server is not in the majority cluster partition

    Hi, my environment is Weblogic 12.1.2. The deployment configuration is: cluster, 2 machines, 2 managed servers, 1 data source, and JMS (with uniform distributed queue). When I'm starting the admin server + managed server on the first machine (using t