Find start and end execution time of a sql statement?

I am have databases with 10.2.0.3 and 9.2.0.8 on HP UNIX 11i and Windows 200x.
I am not in a position to turn on sql tracing in production environment. Yet, I want to find when a sql statement started executing and when it ended. When I look at v$sql, it has information such FIRST_LOAD_TIME, LAST_LOAD_TIME etc. No where it has information last time statement began execution and when it ended execution.. It shows no of executions, elapsed time etc, but they are cumulative. Is there a way to find individual times (time information each time a sql statement was executed. – its start time, its end time ….)? If I were to write my own program how will I do it?
Along the same line, when an AWR snapshot is shown, does it only include statements executed during that snapshot or it can have statements from the past if they have not been flushed from shared memory. If it only has statements executed in the snapshot period, how does it know when statement began execution?

Hi,
For oracle 10g you can use below query to find start and end time, you can see data for last seven days.
select min(to_char(a.sample_time,'DD-MON-YY HH24:MI:SS')) "Start time", max(to_char(a.sample_time,'DD-MON-YY HH24:MI:SS')) "End Time", b.sql_text
from dba_HIST_ACTIVE_SESS_HISTORY a,DBA_HIST_SQLTEXT b where
a.sql_id=b.sql_id
order by 1;
Regards
Jafar

Similar Messages

  • Report execution start and end date/time

    Hi All,
    How can one find execution start and end date/times for all reports? Basically I am looking to see what reports were run on a day, when and how long it took for each to complete.
    Thank you.
    Denis

    Hi,
    The "eul5_batch_reports" holds the data about the scheduled report and if you don't have any so you will not have any data.
    Take a look at "EUL5_QPP_STATS"
    for example:
    select
    qpp.qs_doc_name,
    qpp.qs_doc_details,
    fu.user_name Ran_by,
    qpp.qs_created_date Start_run,
    qpp.qs_doc_owner Doc_owner,
    qpp.qs_num_rows rows_fetch,
    qpp.qs_est_elap_time estimated_time,
    qpp.qs_act_elap_time Run_time,
    qpp.qs_act_cpu_time Cpu_time
    from eul_us.EUL5_QPP_STATS qpp,
    fnd_user fu
    where substr(qpp.qs_created_by,2,10)=fu.user_id
    order by qs_created_date

  • How to find START and END block number in a datafile?

    Hi Guys,
    I am trying to use dbverify utility with "start" and "end" flags in it. How can I find the starting block # and ending block # of a datafile. I checked v$datafile query but its not very helpful. Any help would be appreciated.
    MM

    If you mean used blocks, then check out DBA_EXTENTS

  • Log page start and end process time.

    Hi:
    I want to trace my JSP/Servlet process time,who know how to set up
    weblogic to log when the page start process and when it finish.
    Thanks.
    Jason
    Shi([email protected])
    2000/11/3

    Jason Shi <[email protected]> wrote:
    Hi:
    I want to trace my JSP/Servlet process time,who know how to set up
    weblogic to log when the page start process and when it finish.You can implement a common JSP superclass and specify it either using
    <%@ page extends="foo.Super" %> directive, or -superclass jspc command-line
    option. For example:
    package foo;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    public abstract class Super implements HttpJspPage {
    private ServletConfig config;
    final public void init(ServletConfig config) throws ServletException {
    this.config = config;
    jspInit();
    final public ServletConfig getServletConfig() {
    return config;
    public String getServletInfo() {
    return "blah blah";
    final public void destroy() {
    jspDestroy();
    final public void service(ServletRequest req, ServletResponse res)
    throws ServletException, IOException {
    long timeStarted = System.currentTimeMillis();
    _jspService((HttpServletRequest)req, (HttpServletResponse)res);
    System.out.println(((HttpServletRequest)req).getRequestURI() +
    " took "
    + (System.currentTimeMillis()-timeStarted)
    + " milliseconds to execute");
    abstract public void _jspService(HttpServletRequest request,
    HttpServletResponse response) throws ServletException, IOException;
    public void jspDestroy() {}
    public void jspInit() {}
    Dimitri

  • Thread start (and end?) times?

    Is it possible to see when a thread was started? I have looked at various pieces of doc on JPDA, Java API, etc. and cannot see any references to this. Of course I could track it myslef when threads are created, but I was wondering if the JVM does that for me?

    It would be handy in diaglostic situations to possibly see how long a thread has been running, especially if one that whouldn't be running long happens to now be doing so.

  • How to find out the execution time of a sql inside a function

    Hi All,
    I am writing one function. There is only one IN parameter. In that parameter, i will pass one SQL select statement. And I want the function to return the exact execution time of that SQL statement.
    CREATE OR REPLACE FUNCTION function_name (p_sql IN VARCHAR2)
    RETURN NUMBER
    IS
    exec_time NUMBER;
    BEGIN
    --Calculate the execution time for the incoming sql statement.
    RETURN exec_time;
    END function_name;
    /

    Please note that wrapping query in a "SELECT COUNT(*) FROM (<query>)" doesn't necessarily reflect the execution time of the stand-alone query because the optimizer is smart and might choose a completely different execution plan for that query.
    A simple test case shows the potential difference of work performed by the database:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Session altered.
    SQL>
    SQL> drop table count_test purge;
    Table dropped.
    Elapsed: 00:00:00.17
    SQL>
    SQL> create table count_test as select * from all_objects;
    Table created.
    Elapsed: 00:00:02.56
    SQL>
    SQL> alter table count_test add constraint pk_count_test primary key (object_id)
    Table altered.
    Elapsed: 00:00:00.04
    SQL>
    SQL> exec dbms_stats.gather_table_stats(ownname=>null, tabname=>'COUNT_TEST')
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.29
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from count_test;
    5326 rows selected.
    Elapsed: 00:00:00.10
    Execution Plan
    Plan hash value: 3690877688
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            |  5326 |   431K|    23   (5)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| COUNT_TEST |  5326 |   431K|    23   (5)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
            419  consistent gets
              0  physical reads
              0  redo size
         242637  bytes sent via SQL*Net to client
           4285  bytes received via SQL*Net from client
            357  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           5326  rows processed
    SQL>
    SQL> select count(*) from (select * from count_test);
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 572193338
    | Id  | Operation             | Name          | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |               |     1 |     5   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE       |               |     1 |            |          |
    |   2 |   INDEX FAST FULL SCAN| PK_COUNT_TEST |  5326 |     5   (0)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
             16  consistent gets
              0  physical reads
              0  redo size
            412  bytes sent via SQL*Net to client
            380  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL>As you can see the number of blocks processed (consistent gets) is quite different. You need to actually fetch all records, e.g. using a PL/SQL block on the server to find out how long it takes to process the query, but that's not that easy if you want to have an arbitrary query string as input.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • Editing Loop Start and End times via automation / MIDI controllers?

    I'm trying to play a sample in EXS24 and have the Sample Start, Loop Start and End times manipulated over the course of the song. I've tried to open up the EXS sample editor, click on the numerical value of the Loop Start, and then attempt to Learn Automation. All it does is assign the knob for the instrument Volume Level. Is there any way to do this? It's basically how an Akai S612 works: http://www.vintagesynth.com/akai/s612.shtml
    I switched gears and tried it also with Battery, and there's a way to map the Start and End times in there, but it's not seeming to work as I've intended. I can't seem to make the loops move as they should and there's ways to use up to 4 loops, but not a way to target each loop's start and end points via separate controllers.
    I could use my S-612 [and probably will], but in moments where I don't have one available, I'd love to find a solution to this.
    Thanks,
    +odd

    Anyone with any thoughts? would be great to solve this.

  • How can I control the video playback start and end time?

    I'd like to be able to start a video/audio playback at a particular point in time say 3 seconds from the starts of the video and play it for only 3 seconds. How can I set the unique start and end points rather than play the whole video. I'd also like to be able to do this using the SeriesElement so I can set the start and end play points for a series of stacked videos. How can this be achieved?

    Not sure I understand the question.  Can't you just append the param to the URL?  Like so:
    var url = new URL("http://video-research/video.f4v?start_time=500");
    If your question is more about playing a subclip of a progressive video, that's not something OSMF has support for.  You'd need to write a server script which checks for that parameter and then returns the relevant portion of the requested file.  (This is typically referred to as "pseudo-streaming", if you Google that term you'll find a wealth of info.)

  • Hwo to obtain the DST start and end times

    Hi all -
    Is there a way in java to obtain the day light saving start and end times for a certain year for US?
    I know that US DST changed in the year 2007 so, I am wondering if I can get correct DST start and end times for certain period before 2007 and after 2007.
    I read online that JDK preserves historical DST rules so I am hoping this is possible but do not know how.
    Thanks,

    Any idea is appreciated [otehr than incrementally iterating through each hour of the year to know the transition time !!!!  )
    That's why I mentioned +dichotomy+ (EDIT: the english wording is +binary search+ ): set the initial date to Jan 1st, 00:00, then add 183x24 hours (half a year), if the hour has changed (which it will), there was a DST change in the first half of the year. Then substract 92x24 hours (a quarter of a year) from this new instant, if the hour has changed, the DST change was in the 2nd quarter, else it was in the first. Then add or substract 46x24 hours,... and so onEdited by: jduprez on Feb 2, 2011 9:15 AMWARNING: for anyone reading this in the future: this algorithm is flawed, unless there is further guarantees in the problem domain of DST rules:- if the DST shifts (up +1 hour then back) are less than 6 months apart (obviously it may occur, with a one day margin)- and if in some odd timezone DST shifts may occur around mid-yearThen the first binary chop could find the same hour at both ends, and miss both shifts.My apologies for posting not-well-thought suggestions...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Start and end time for a mapping in process flow

    We are executing 6 mappings in a process flow. 4 out of 6 run in parallel . The log file created in a control center denotes start and end time for a process flow. But Is there any way to find out how long those individual mappings took ? Is start/end time logged on a mapping level somewhere ?
    Thanks

    As well as the repository browser you can use the SQL Developer reports on the utility exchange which are based on the public views.
    http://www.oracle.com/technology/products/warehouse/htdocs/Experts/owb_sqldeveloper.zip
    You can dig in and see how these are read from the SQL views.
    Cheers
    David

  • Get Start and End times for each step in a job

    Can someone tell me how to get the start and end times for each step in a background job?  Table TBTCP only stores the time that the step was saved in a background job.  Table TBTCO stores the times for the entire job and not each individual step.
    Thanks.
    Ryan

    Hi,
    Please check this tables and FM perhaps they may help
    TBTCJSTEP  - Background Job Step Overview
    TBTCR          - Batch scheduler execution time
    TBTCS          - Background Processing: Time Schedule Table
    GET_JOB_RUNTIME_INFO
    Regards,
    Ferry Lianto

  • PowerShell - Get-MessageTrackingReport how to specify start and end time of current process

    could you please help me? I need to specify start and end time of current process with Get-MessageTrackingReport command. I know you
    can do it with Get-MessageTrackingLog:
    $start = (Get-Date).Addhours(-1)
    $end = (Get-Date)
    Get-MessageTrackingLog -EvenId Receive -Start $start -End $end
    But for my purposes I really need to do it with Get-MessageTrackingReport command, so how can I do it?
    Thanks in advance!

    That's not the context you would use
    Get-MessageTrackingReport in,
    Get-MessageTrackingReport is used to get extra information on messages that you have found in the MessageTracking log using Search-MessageTrackingReport . That's why the most common example you see will look like
    $Temp = Search-MessageTrackingReport -Identity "David Jones" -Recipients "[email protected]"
    Get-MessageTrackingReport -Identity $Temp.MessageTrackingReportID -ReportTemplate Summary
    The most important parameter for that cmdlet and the reason it won't work like your trying to use it is the
    Identity ""The Identity parameter specifies the ID of the message tracking report ID to retrieve.You should run the Search-MessageTrackingReport cmdlet
    to find the message tracking report ID for the specific message you're tracking, and then pass the value of the MessageTrackingReportID field
    to this parameter." see http://technet.microsoft.com/en-us/library/dd351082%28v=exchg.150%29.aspx
    It's more appropriate to use Get-MessageTrackingLog when you want to search the log based on time or use
    Search-MessageTrackingReport and then limit the results this returns before you pass the MessageTrackingReportId to get-MessageTrackingReport
    Cheers
    Glen

  • Is there a way to enter an event time in Calendar as a reminder for me and NOT have Calendar erase it in the info as it reads it into the event start and end times?

    Calendar can recognize and derive event start and end times from the text description entered.  However, when it seizes on a time (start and/or end) and automatically enters it as the start and/or end time, it also (sigh) deletes the time from the text.  I enter the times as reminders for me, how can one prevent them from being deleted by Calendar??

    I am having the same darn problem. I really dislike this auto feature in Calendar.
    Can anyone help us please?

  • Month View:start and END times

    Here is feature that i really need In the Month view: The option to have start and end times displayed. Now that their is no info drawer i have open and info drawer to see when the event is supposed to end. I have a lot of events in a day and some are for me and some are for my company and some are for my wife.
    I need to see the start and end time quickly. Outlook does it.
    Please make iCal do this incredibly useful view option.

    Start times are still viewable.
    It is a click box in the preferences that says show time in month view.
    What i need is the END time as well.
    I learned that the best place for this kind of discussion is on the feedback line for ical
    http://www.apple.com/feedback/ical.html
    Just tell them the features you need or miss. Please click the link and tell them what you think of iCal.

Maybe you are looking for

  • Bootcamp 2nd monitor

    Hello Im planning on using my samsung tv as a 2nd monitor. I know it will work with max OSX but will it also work when im in bootcamp using windows If anyone has experience with this please let me know Chielsen

  • Oracle jdbc driver problems in netbeans 5.5

    need help again....i'm experience a problem. the problems are : i connect from netbeans 5.5 to oracle database express client 10g using jdbc driver ojdbc14.jar. the connection succeded (all the tables appears and i even can view the data). but when i

  • How to disable parameter in selection screen

    hi experts, SELECTION-SCREEN BEGIN OF BLOCK server WITH FRAME TITLE text-009. SELECTION-SCREEN BEGIN OF LINE. PARAMETERS: data_app RADIOBUTTON GROUP csbi. SELECTION-SCREEN COMMENT  4(35) text-006 FOR FIELD data_app."744242 parameters : p_fname1 like

  • CRM ORDER CHANGE AND STATUS MANAGEMENT - workflow

    Hi, We have created a Changed method for bus2000120 which is configured to fire when the Order is saved via Status Management.  We have added an entry to BSVW for the object, bus2000120.changed with no restrictions.  We have also created a function m

  • InDesign CS4: Missing Toolbars/Menus

    InDesign CS4: Missing Toolbars/Menus on MacBook Pro The program has been working fine for more than year, but all of a sudden the menus and toolbars have disappeared and I can't find a way to turn them back on. The program is USELESS without them sin