Capturing query time taken inside a proc

Hi ,
select * from v$version
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
=================
I have a few insert and delete statements inside my stored procedure .
I need to cature the time taken by these queries after their run .
Is there any way we can get this . ( Not putting timestamps before and after the query and taking difference )
Thanks ,
Mahesh

Mahesh wrote:
I am looking is there anything like sql%rowcount which gives the count affected or we have set time on in sql*plus which gives the time .Elapsed time in Pl/SQL can be calculated by using DBMS_UTILLITY.GET_TIME
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#i1002765
Regards
Peter

Similar Messages

  • PO Lead Time cannot capture the time taken for shipping!

    Dear All
    I understand that we have PO lead time = PO Processing Time (Working Day) + Planned Delivery Time (Calendar Day) + GR processing time (working day).
    And this PO lead time will be added on top of my PO Creation Date to defer the actual goods availability date.
    My question:
    1. Planned delivery time is the time taken from vendor place to send out the goods to my warehouse. What if it is overseas purchase where goods leaving vendor's Port will first arrive in my country custom, and it will take 3 days to do clearance. once it is cleared, forwarding agent will delivery goods from my country custom to my warehouse. In this case, how do I capture it in SAP system for the planned delivery time as it has 4 periods of time now
    a. Time taken from vendor's port to reach my country's port
    b. Time taken for my country custom to do clearing
    c. Time taken for forwarding agent to fetch goods from custom to my warehouse
    d. Time taken for unpack, take out , count, inspect and put for use (GR processing time)
    Do I need to use user Exit?
    Thanks
    Edited by: Daimos on Apr 27, 2009 6:52 PM

    Dear dogboy.
    I think we must use feature on the PO Confirmation Control (CC) Key at PO Item Level:
    ED - Estimated Time of Departure from Overseas Port.
    EA - Actual Time of Departure from Overseas Port.
    EA - Estimated Time of Arrival
    AA - Actual Time of Arrival
    And the purchaser will maintain the value of each of the CC Key each time they are notified by the vendor.
    And we need to come out with a Customised Report to capture those CC dates entered so that finance is able to prepare $ in advance if the moment the EA is maintained, meaning the estimated date of arrival at the Custom there.
    But the problem is that PO User Exit is only at the header of Confirmation Control Key but not capture the DATE field we entered for each CC.
    That was the problem I last encountered.

  • Capturing of time taken by a while loop in bpm

    Hi ,
    I have a busniess process ,and my receive step is defined in a while loop.
    so it starts with a while loop.
    I want to keep a condition on the while loop that it should receive the messages only for a period of 1 hour ,and if it exceeds this period it should end up the process triggeringa mail.
    I mean to say if there are 12 records to be processed through the while loop ...and if I receive only 11 records ..it will be waiting for that final record in an infinite loop ..so I dont want that ...instead if the total no of records are reached then it should move forward ..If it is waiting for the missing records for an hour ..I should stop the process and trigger a mail to the queue monitor saying that record is missing...I have finished the process without this processing time condition successfully..
    I am new to XI and I dont have any idea on how to capture this processing time of while loop.
    can some one please help me out in this issue...
    Thank you in advance...

    Hi Latika,
    Yeah I understand we can go with fork but why I am going with this is ,I have already designed a Payload dependent loop ,by using while loop.so it makes my job simple ...
    Now I am converting it to time dependent loop,so only the final question I have is...In the time dependent loop documentation ..they have taken it as infinite loop and only kept the time limit in the deadline branch...so when the deadline reaches they trigger something.
    If you go to the documentation of time dependent loop(http://help.sap.com/saphelp_erp2005vp/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm) ..they took the infinite loop...in this loop if I mention the counter ..and if this record count triggers before the time limit...it should come out of the block...would it work this way ?
    Thanks a lot...

  • CMD=Ping&log query is taking long time-taken when checked in IIS logs.... Exchange 2010 SP3..

    Query regarding the ActiveSync and parameter time-taken from ActiveSync IIS logs.
    Here what I see for from the logs.
    [email protected] 45.101.90.185 Apple-iPad2C3/1202.410 200 0 0 1501129
    443 [email protected] 45.101.90.185 Apple-iPad2C3/1202.410 200
    0 0 22105
    443 [email protected] 45.101.90.185 Apple-iPad2C3/1202.410 200
    0 0 452
    443 [email protected] 45.101.90.185 Apple-iPad2C3/1202.410 200
    0 0 936
    443 [email protected] 45.101.90.185 Apple-iPad2C3/1202.410 200
    0 0 656238 
    In the above log, highlighted are the time-taken and I just want to check what is the ideal time-taken value, some value above should be causing some problem, like the one of the top 1501129 ?
    ?AND I see its for POST event and CMD=Ping&log query.......
    We have Mobile Iron in the environment and we are seeing few timeout errors on MobileIron server and for users intermittently. They usually see below error... However we don't see any end users issues, but just want to get rid of below error. MobileIron guys
    are pointing it to time-taken value which is high intermittently.
    IOException connection to server [email protected] -- java.io.IOException:
    awaitUninterruptibly was stopped by timeout
    @BALA

    Hi,
    To understand more about the issue, I’d like to confirm the following information:
    1. What’s your Exchange 2010 version? 
    http://support.microsoft.com/kb/2536517/en-us
    2. Do you install other software, like SQL, on the same Exchange Server?
    3. Change another admin account to access EMS.
    Thanks,
    Angela Shi
    TechNet Community Support

  • Query Execution time - Elapsed time v Actual time taken

    Hi All,
    I have this scenario where I am querying a single table with the following results. It is a very heavy query in that there are multiple aggregate functions and multiple unions on it. Even if the query is written poorly (i doubt it is) why would the actual
    time taken to execute the query be much more than the statistics provided through the following commands?
    SET STATISTICS IO ON;
    SET STATISTICS TIME ON;
    Attached are the stats provided for the relevant query in question.
    Table '123456789_TEMP_DATA'. Scan count 178, logical reads 582048, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    SQL Server Execution Times:
       CPU time = 936 ms,  elapsed time = 967 ms.
    2014-01-06 17:36:41.383
    Now, although the CPU Time/Elapsed time shows that it takes less than a second, it actually takes more than 15 seconds to fetch the results. (This is the actual time that you get on the bottom bar of the Query pane as well.)
    What is the reason? Why is it that there is such a big discrepancy between the numbers? How can I improve this situation?
    Thanks!

    Yes. I am returning a huge number of rows to the client. 
    The query is simply against a single table. 
    Select
     'First Record',AVG(COLUMN1),STDEV(COLUMN1
    ),COUNT(COLUMN1)
    FROM [TABLE1] WHERE (SOME CONDITION)
    UNION ALL
    Select  'Second Record',AVG(COLUMN2),STDEV(COLUMN2),COUNT(COLUMN2) FROM [TABLE1]
    WHERE (SOME OTHER CONDITION)
    Imagine there are 178 records fetched in this manner with 178 UNIONs. The WHERE clause will always change for each SELECT statement.
    Now, the question is not so much about the query itself, but why the execution time is actually 15 seconds whilst the SQL STATISTICS show it to be 936ms (<1 second)
    Thanks!

  • How to analyse the time taken for a query

    Hey gurus ,
                          How to find the time taken for a query to execute .
    Regards,
    Venkatesh

    Hi,
    Time taken to execute a query = FRONT END TIME + OLAP TIME + DB TIME.
    front end time is time taken to do format in BEX.
    olap time is time taken to aggegate data in OLAP buffer.
    db time is tme taken to collect data at data target.
    to fine all these information
    goto RSRT -> give query name -> execute+debug -> it will display all the fields > check fields what ever u want.
    Regards,
    Haritha.

  • Need  the query to calculate the time taken to excute it.

    hi all,
    i need the query to calculate the time taken to excute it.
    for ex:
    select * from emp;
    how much time it will take to give o/p
    Thanks in advance
    satya

    Just to add to what was said - the execution can each time be DIFFERENT as the factors that governs performance are NOT CONSTANT.
    If Oracle has no idea how long the query is going to take before executing it, then how can you and your code know?
    Oracle's CBO estimates the cost (expense) of the query. This is an indication of how expensive a query is - and the more expensive the query, the more resources need to be used, the longer the query will take. The less expensive the query, the fewer resources it need, the faster it will take.
    And that is it. How fast or how slow? Oracle does not know. How much faster a query with a cost of 10,000 versus a query with a cost of 1? Oracle does not know.
    Why? Because the platform is not constant. Just what data is at this exact moment in the db buffer cache? Just how much CPU capacity is available for the new few seconds? Just what will the sustained throughput be of the I/O subsystem and channels for the next minute? Just how many memory pages need to be swapped between cache and memory? Etc. etc.
    All these factors change every single second. So forget about attempting to accurately calculate up-front the time it will take for a query. IT IS NOT POSSIBLE.

  • TIme taken to execute query

    Hi,
    HOW TO FIND OUT TIME TAKEN TO EXECUTE SELECT QUERY IN SAP, SAY FOR EXAMPLE
    SELECT * FROM MARA WHERE MATNR BETWEEN '100' AND '1000'.
    HOW TO PRINT TIME TAKEN TO EXECUTE ABOVE QUERY i.e. TIME IN MICROSECONDS...
    IF YOU HAVE SAMPLE PROGRAM THEN PLEASE LET ME KNOW.
    THANKS,
    JOHN.

    just declare.
    END-OF-SELECTION.
      GET TIME.
      end_dt = sy-datum.
      end_tm = sy-uzeit.
    <b>ex--</b>
    select * from ekko into table ekko.
    get time.
    t1 = sy-uzeit.
    select * from ekko into table ekko.
    get time.
    t2 = sy-uzeit.
    write :/ t1.
    write :/ t2.
    diff = t2 - t1.
    write :/ 'Time Taken : ' , diff.

  • Query cost is low but the time taken is high

    Hi,
    I have tuned the queries which now are costing the CPU low.  But the time taken is still higher (of order of 999,999,999.0)
    What is scope of improvement ?
    Regards,
    Chitwanjit

    Moderator message - Please ask a specific question - post locked
    Rob

  • How much time taken to responde on client by DCs/GCs

    Hi
    how can i get the answer of below question which asked by clients.
    1: Time taken by AD to respond back on authentication request.
    2: Time taken after user request submission to application related sub service to request served by the application
    3: how much time Directory client use the global catalogue interface to perform forest-wide searches by querying a single server

    > 1: Time taken by AD to respond back on authentication request.
    > 2: Time taken after user request submission to application related sub
    > service to request served by the application
    > 3: how much time Directory client use the global catalogue interface to
    > perform forest-wide searches by querying a single server
    A client side network capture can answer all of these :)
    Greetings/Grüße,
    Martin
    Mal ein
    gutes Buch über GPOs lesen?
    Good or bad GPOs? - my blog…
    And if IT bothers me -
    coke bottle design refreshment (-:

  • Changing Date & Time Taken

    Is there any way possible or a preference to set which will not change the date and time stamps on my photos as I manipulate them in Lightroom?

    > In other words, whenever DST starts or stops, the capture times will shift by 1 hour, and if you change your timezone in Windows, the displayed capture time will change to display the date/time the pictures were taken in your current timezone (rather than the capture time from the timezone the pictures were taken in.)
    That has been fixed in LR2.
    > Is there any way possible or a preference to set which will not change the date and time stamps on my photos as I manipulate them in Lightroom?
    Manipulating images in LR cannot modify the date/time taken stored in EXIF. I think you a referring to file modification date as you see it in Explorer/Finder, which is quite a different thing.
    If so, it goes like this... For proprietary Raw files (NEF, CR2 etc.) it never changes the timestamp, except when you use the 'Edit Capture Time' command. All metada changes are save in sidecar XMPs for these. For DNG, JPEG, TIFF and PSD they are modified each time you save metadata, since the metada is embedded into the actual file. You have no option to change this bevahiour.
    Though, for any format you may choose not to save or embed any metadata, but keep it only inside the LR's catalog. Check (or uncheck) the respective prefs in the Catalog Settings dialog.

  • Capture Date/Time - clobbered by LR 1.1

    Oh No!
    It appears that LR 1.1 has clobbered the Capture Date/Time after writing out the metadata.
    To try to be clearer, I've been using Elements 5.0 which organizes my photos (all jpg) by date. The date the photo was taken (which is also the date the file was created) are important to me. Those fields are respected by other Adobe products (Album, Elements 5.0 and Bridge CS2). Somehow LR 1.1 treats this date differently and with less importance than other Adobe and non-Adobe applications.
    I am not too concerned about the date that the metadata was changed, which LR shows. I want to see the date the picture was taken.
    The only way I managed to see that in LR was to customize the display using
    Jeffrey's Lightroom Metadata Viewer Preset Builder (for Lightroom 1.1). (Why I had to use a 3rd party add template creator to see the Capture Date/Time I don't know - it should be right there in LR - but leave that aside for the moment) .
    Anyhow, I manipulate the metadata by adding keywords and then tell LR to write that to the files. In this process the creation date/time vanished on a number of photos. The only way I could get it back was to use a backup of the original files (losing keywords and other data in the process)or to use Exifier to set the date/time, remove the collection from LR and reimport.
    Something as important as the date and time the photo was taken (file creation) is a key bit of data that should be readily available and visible in the metadata display and should not be clobbered or lost when writing out metadata to the files. I see there are other complaints about this and some expressing horror that Adobe didn't fix it in LR 1.1.
    My point is simple - for my purposes I cannot fully utilize LR 1.1 if the Creation Date/Time cannot be readily seen, or is in danger of being lost, I would have to use other software.
    Geeze, and I was beginning to get comfortable with LR...
    Maybe the good folks at Adobe have some comment and might be able to rectify this?
    In the alternative, is there something I'm missing about the way Capture Date/Time is supposed to be treated by LR users?
    Advice and pointers would be appreciated.

    Christopher wrote:
    "I hear ya, but if someone could just say, this is how dates are supposed to work ... that would be helpful. In particular, what fields or fields does the Metadata Browser use to sort an image into a date bin? If I knew that, I might be able to determine why so many of my images are put into the Unknown Date heading."
    Here we go:
    1. None DateTime tag defined in exif (or DateTime tags corrupted)
    -in Metadata Browser (left panel) Date will be seen as Unknown Date.
    -Thumbnail show no DateTime value,
    -in Matadata (right) panel, there will be no DateTime caption visible
    2. Only ModifyDate defined in exif
    -in Matadata Browser value of ModifyDate will be shown,
    -Thumbnail show no DateTime value,
    -in Matadata panel, ModifyDate will be shown as Time
    3. Only CreateDate defined in exif
    -in Metadata Browser value of CreateDate will be shown,
    -Thumbnail show no DateTime value,
    -in Metadata panel, CreateDate will be shown as DateTimeDigitized
    4. Only DateTimeOriginal defined in exif
    -in Metadata Browser value of DateTimeOriginal will be shown,
    -Thumbnail shows value of DateTimeOriginal,
    -in Metadata panel, DateTimeOriginal will be shown as Capture Time
    +in Medatada panel, DateTimeOriginal will be shown as Time
    5. All three DateTime values defined in exif
    -in Metadata Browser value of DateTimeOriginal will be shown,
    -Thumbnail shows value of DateTimeOriginal,
    -Metadata panel shows CreateDate as DateTimeDigitized,
    +Metadata panel shows DateTimeOriginal as CaptureTime,
    +Metadata panel shows ModifyDate as Time
    That's it. Now... why are we confused in LR when speaking of DateTime?
    In Metadata Browser any of exif's DateTime value can be shown. That is, looking at this panel only, we never know what Date is being used! Anyway, DateTimeOriginal has priority: if DateTimeOriginal exist, it will be used for Metadata Browser -otherwise any other existing exif DateTime tag will be used.
    But if only DateTimeOriginal is missing (so both, CreateDate and ModifyDate exist), then CreateDate has priority over ModifyDate: CreateDate will be shown.
    Priority in short: DateTimeOriginal, CreateDate, ModifyDate.
    Thumbnails: only if DateTimeOriginal exists, thumbnail will contain DateTime value -otherwise thumbnail's DateTime will be blank.
    Sorting of thumbnails per CaptureTime (hence by exif DateTimeOriginal) is another story and can be quite confusing at first sight... because DateTime priorities seems to be the same as for Metadata Browser:
    If exif DateTimeOriginal exist (=CaptureTime in LR), then this value will be used for sorting. But if this value is missing, LR will try to use exif CreateDate and if this is missing too, ModifyDate will be used. OK, there's some logic... except, why I'm repeating "if this tag is missing..."?
    Because when you modify/rewrite some image, then some tool may damage DateTime in exif -remember: damaged DateTime tag is the same as tag doesn't exist!
    In short: if there's exif DateTime corruption involved, you can't be sure which of three DateTime tags is being used for sorting. For some images DateTimeOriginal will be used, for those that are missing that tag, CreateDate will be used instead.
    Images missing exif DateTime tags (or these are corrupted), will be shown as first (sort A-Z).
    Bogdan

  • Capturing total time for a report..

    Hi all..
    I have a query. Is there a way to capture total time spent to show a report on browser
    If I understand the way it works in OBIEE
    Browser -Presentation Services -- HTTP Request or Response (This we can see by increasing sawlog config file to see more details in sawlog0.)
    Presentation services - BI Server (By Usage Tracking S_NQ_* tables, it gives response time, elapsed time and such statstics)
    BI Server - DB ( The query running time also captured in usage tracking table)
    My understanding is on whole when Presentation services pass the request to BI Server..and when it BI server returns the data to Presentation services..
    There shoud some COMMON PARAMETER to match the request sent and received ..Mapping the requests...
    Is there a way to get that parameter/variable/sytem variable..so that I can accomplish objective of tracking total time spend for a request..
    I could increase saw log and see there is no common parameter that I could match from Sawlog to NQQuery Log, but no luck
    Can anybody help here to find someway? any pointers?
    Thanks in advance..

    There is no parameter that captures the browser rendering time of the report. In the manage sessions if you check the report run time stats you should be able to find the elapsed time, db connect time and compilation time
    To find a more accurate time to render the report and the time when it has become active you can check that information Under Manage sessions in the RPD. That will give the start time and report active time which is the time at which the report is active.
    If you closely monitor this time in the sessions will be a little higher than the time present in the view logs elapsed time which includes the browser rendering time as well because it gives the report active time on it.
    Hope it will be helpful
    thanks
    prash

  • Capturing the time for rendering the JSFscreen.

    I have a JSF application running on WAS6.1. We have some performance issues.
    The JSF rendering is taking long time to render the page. All the database operation ie querying the database and leaving the prerender method is happening so fast.
    So how can we capture the time for the JSF components to render the page. Is there any way to do that?

    i tried to implement the phase listener.But i’m getting an error message in the JSP saying
    JSPG0046E: Unable to locate tagfile for tag phaseListener
    My action getting triggered on click of a tab. So in my JSP page I mentioned as
    <ui:tab action="#{reportsView.kpiRanking_action}" binding="#{reportsView.kpiRankingStore}"
    id false*/;&#xa;openPreloadWindow(); &#xa;document.getElementById("form1:periodTypeDropDown")[2].selected = true;&#xa;savePeriodType();"
    style="height: 25px; text-align: center; vertical-align: middle; width: 91px;cursor: pointer;" text="Store KPI Ranking">
    <f:phaseListener binding="#{reportsView.phaseListenerImpl}" type="com.capricorn.sckpi.PhaseListenerImpl"/>
    <ui:panelLayout binding="#{reportsView.layoutPanel30}" id="layoutPanel30" style="height: 335px; width: 100%; overflow-y: auto;">
    <ui:table augmentTitle="false" binding="#{reportsView.storeWithinDistrictTableStore}"
    id="storeWithinDistrictTableStore"
    style="height: 100%; left: 0px; top: 0px; position: relative; width: 100%" title="KPI Ranking">
    <ui:tableRowGroup binding="#{reportsView.storeWithinDistrictRowGroupStore}"
    id="storeWithinDistrictRowGroupStore" sourceData="#{reportsView.defaultTableDataProvider}" sourceVar="currentRow"/>
    </ui:table>
    <ui:table augmentTitle="false" binding="#{reportsView.storeWithinDistrictTableStore1}"
    id="storeWithinDistrictTableStore1"
    style="height: 100%; left: 0px; top: 0px; position: relative; width: 100%" title="YTD Ranking">
    <ui:tableRowGroup binding="#{reportsView.storeWithinDistrictRowGroupStore1}"
    id="storeWithinDistrictRowGroupStore1" sourceData="#{reportsView.defaultTableDataProvider}" sourceVar="currentRow"/>
    </ui:table>
    </ui:panelLayout>
    </ui:tab>
    My header for JSP is
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    Please help.

  • How we can store start time & end time taken by execution of scenerio?

    Hi
    i want to store starting time and ending time taken by executing of any scenerio and date also on which scenerio will be executed.
    plz assist me regards the same
    thanks

    when you say store , you want to capture in some file ,email or table.
    If table , you can have a small sql linking SNP_SESSION and SNP_SCEN and fetching the required detail accordingly.

Maybe you are looking for

  • .ai won't open in CS5

    Yesterday i received a .ai file and when i tried to open it in CS5 it would not open and gave me the message "Can't open the illustration. Could not complete the requested operation." On a whim I decided to try it in CS3 on another computer and it op

  • Cant get FBEAN.GET_CHAR_PROPERTY to return more than one character

    I have a javabean on my form. I am passing values to the bean using FBEAN_INVOKE. I need to get error messages back from Java. I set the logging mode to Log_All. I use FBEAN.GET_CHAR_PROPERTY to return an error. Here's my code: retval varchar2(10); r

  • Page Size for Z2100 - Mac Software

    I print lots of long documents, all of which are 23" wide but of vaiable lengths. I used to use HP Instant Printing software on my PC, where I would simply add the file and my HP Designjet Z2100 would print it and then cut the roll before moving onto

  • In Adobe Photshop 6.0 how can I browse files ?

    I used to have Adobe photo elements now I have 6.0 and I would like to browse photo files like I used too with elements but I can't find a way to do this. I typically have 10 to 15 photos that all need a quick edit, rename done to them and the browse

  • Abap development book

    dear sir,      plz send abap development book my mail id.                   thank you. Edited by: Moderator on Mar 11, 2008 1:57 PM