Query to show last time a query was run

I am trying to write a query that will show me the last date/time a specific query was run. I have looked into v$sql and I can find the query, but from what I can tell it does not show the last time the query was executed.

Hi,
use v$sqlarea instead of v$sql and look at the column last_active_time. See also the documentation (docs.oracle.com/cd/E11882_01/server.112/e40402/title.htm) on the dynamic performance views in the database.
You will get more answers, however, if you put your question to the forum Oracle Database > SQL and PL/SQL .
Regards,
Gudrun Pabst

Similar Messages

  • When was the last time a program was run?

    Experts, is there a way to know when was the last time a program was run (particularly, Z Program). We are trying to identify obsolete programs and avoid working on those programs that weren't touched for more than 3 years during our next upgrade. How can I find this? Any suggestion would be highly appreciated.
    Thank you.

    Hi,
    One way is to check TRDIR table(se11/se16) and display it. In the next screen once you will get 'Data Browser Table TRDIR' selection screen. There either you put the individual 'Z' program name in the 'Name' field & execute it or for all multiple entries execute it.
    Once you execute it with the particular Z prog. name then you will get the required details like CDAT(Created on),UNAM(Last changed by),UDAT(Changed On),SDATE(Standard selection screen generation: Date),IDATE(Selection screen generation: Date) etc.
    Hope this can help you.

  • How to find out when the last time a tcode was run by someone

    Hi Team,
    I am just trying to find out if there is a way to find out when the last time a tcode was run by someone.I mean i need to know when was a certain  tcode was last run.
    Thanks,
    Priyanka

    HI Priyanka
    Another way would be using transaction STAT,enter the t-code you like to monitor.This will provide all details,like user, time etc...
    Hope this will help
    Thanks
    Santosh Kumar

  • How can i check when a given query was run

    how can i check when a given query was run ( i mean the timestamp ) from forms
    I am trying to run the query depending on when it was last run

    Hello,
    I'm not sure to really understand your need, but if you want to refresh the data blocks regularly, you can use a timer that would execute_query on the block every elapsed period of time.
    Anyway, there is no "timestamp" of this kind, so that you would store the information somewhere in memory on in a table, from a PRE-SELECT or POST-SELECT trigger for instance.
    Francois

  • I can't seem to decide between the 13" or the 15" MacBook Pro. I had a 14.5 in Dell which crashed on me for the third and last time. It was also my primary home computer. Is the 15" necessary or should I just get the 13"?

    I can't seem to decide between the 13" or the 15" MacBook Pro. I had a 14.5" I'm just used to that size. Dell which crashed on me for the third and last time. It was also my primary home computer. Is the 15" necessary or should I just get the 13"? I probably won't be doing any graphics or anything like that.

    It is really a matter of your personal preference. You have to choose between the extra carrying convenience of the smaller machine and the greater "real estate" of the bigger. I use a 15", and have not found it inconvenient for carrying, even on aircraft, where it has to share backpack space with an SLR camera and assorted lenses.

  • Need to find last time a table was used.

    I am in the process of cleaning out a group of staging tablespaces and I would appreciate some help finding the last time a table was used. (ie: records added, deleted, ect.) Is there an SQL statement that will do it? Any other suggestions?
    I will Appreciate any assistance.

    How can I activate the auditing? http://download-east.oracle.com/docs/cd/B19306_01/network.102/b14266/auditing.htm#i1011984
    Daljit Singh

  • I can get the last time a patch was applied. What I need is this info for ALL servers.

    Getting the last time a server was patched is a simple, single line of PowerShell:
         get-hotfix -computername seadcweb10 | sort InstalledOn | select -last 1
    What I need is to get a list of *all* the servers in Active Directory, and get this information for each.
    I've tried variations of foreach , but I get errors.
    foreach ( $p in Get-ADComputer -Filter 'OperatingSystem -like "Windows *Server*"' ) { get-hotfix -computername $p.Name | select -last 1 }
    Get-HotFix : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
    At line:1 char:97
    + foreach ( $p in Get-ADComputer -Filter 'OperatingSystem -like "Windows *Server*"' ) { get-hotfix <<<<  -computername
    $p.Name | select -last 1 }
        + CategoryInfo          : NotSpecified: (:) [Get-HotFix], COMException
        + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.PowerShell.Commands.GetHotFixCommand
    What am I doing wrong?

    Hi
    The RPC server is unavailable
    This error  comes when any server is not pingable.
    Make sure you are able to ping to all server from the server you are running the script.
    Then give a try to below script :
    foreach ( $p in Get-ADComputer -Filter {OperatingSystem -like "Windows *Server*"})
    get-hotfix -computername $p.Name | select -last 1
    MCITP - Exchange 2010 | MCITP - Windows Server 2008 R2

  • HT1212 If I never synced to itunes and I restore the device. Will I lose unstored data? How can I check to see the last time my phone was backed up if I forgot the passcode to my phone?

    If I never synced to itunes and I restore the device. Will I lose unstored data? How can I check to see the last time my phone was backed up if I forgot the passcode to my phone?

    If you can't remember your passcode, you'll need to restore your phone.  If you never synched to iTunes, all data on your phone will be erased.  No way around this.

  • The last time an index was used

    Hi to all, 
    I would like to know, if there is a way of knowing  the last time an index was used, or what indexes have never been used.
    Regards
    Eduardo Barrios
    Compañía Cervecera de Canarias S.A.
    Tfno.     922 568 246
    Fax.      922 670 600
    Correo   [email protected]

    Hi Eduardo,
    reading through the updates from Thomas and Volker, I was wondering if there was a bug in i5/OS that causes the "Last used date" information in the file description not to be updated properly for indexes. If you have the plan cache dump or database monitor active (i.e. quite current data in ST04), you could do the following to find out if indexes have been used by the SAP system without a proper update in the file description:
    1. List all indexes into a temporary output file:
        DSPFD FILE(R3<sid>DATA/ALL) TYPE(MBR) OUTPUT(*OUTFILE)
              FILEATR(*LF) OUTFILE(QTEMP/DSPFD)
    2. Compare output with database monitor data using STRSQL or SQLUTIL:
        SELECT T1.MBFILE, T1.MBUDAT, T2.QQTIME, T2.QQLIFN
          FROM QTEMP/DSPFD T1, R3<sid>DATA/SQ3001_DB4 T2,
               R3<sid>DATA/SYSINDEXES T3
         WHERE T1.MBFILE = T3.SYSTEM_INDEX_NAME
           AND T3.INDEX_NAME = T2.QQLIFN
         ORDER BY T1.MBUDAT
    If you find indexes, where the "Last Used Date" is smaller than the QQTIME value, you know that the
    file statistics are not updated properly. You could then open a PMR at IBM for that.
    On one of our internal systems I did not see a discrepancy, so it seems to me that the information is correct. Volker's experiences could be explained by the fact that indexes are not just used to implement SQL statements, but also for table statistics. I assume that the "Last used date" is not updated when the index was only used to obtain table statistics. With incomplete statistics, the optimizer may choose a different join order or access method, which can result in poor performance. So there is some risk involved when dropping an index that has a very old "Last used date", and you can only decide it by trying (with care!).
    Kind regards,
    Christian Bartels.

  • Find Last time a procedure was called

    Hi DBAs,
    How to find when a procedure or function was called last time in 10g. For that matter even when a table was last accessed. If this can be done without enabling audit ? are there any such views or tricks to find such changes ?
    Thanks!

    Without auditing, this is not possible as a general rule.
    If a procedure has side effects, you could potentially look through the database to find those side effects. If it inserts a new row in a table with a CREATE_DATE of SYSDATE, that would be very helpful. If you're talking about a function that doesn't have side effects, however, that isn't an option. If the function or procedure runs for a relatively long period of time, its executions may be picked up in an AWR/ statspack report. But it's unlikely that every execution would be captured, it's unlikely that the history is kept particularly long, and it's not always trivial to search these reports for the last time a procedure was executed. And if you have a relatively quick procedure, it's unlikely that executions would ever be recorded.
    Segment-level statistics might give you hints about table accesses. But those statistics are cumulative since the last reboot. And there are likely background processes that touch every table at some interval (i.e. statistics gathering), which probably isn't the sort of "access" you're interested in.
    Justin

  • HT201269 How do I see the last time my phone was backed up?

    My iphone has gone dark. I was planning on getting a new phone but I can't turn my old phone on to transfer data. How can I see the last time my phone was back up?

    If you back up to iTunes, open iTunes on your computer.  Go to Preferences (from the leftmost item in iTunes' menu bar), then choose "Devices".  The backup time will be shown there.
    If you back up to iCloud, you would be able to see it on your iPhone, but since you can't turn it on, I don't think there is another way to find it.

  • IN NEED OF A SCCM 2012 QUERY THAT SHOWS LAST TIME SOFTWARE WAS USED OR OPENED

    Hello
    I am in need of an SCCM 2012 query that shows PCs that have Visio , Adobe Professional and Visual Studio and the last time each was used or opened. I have the query below which give me the PC name and the product. Any assistance will be very helpful
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    like "%adobe acrobat%pro%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    like "%visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%viewer%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service pack%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security
    update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hydra%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%MUI%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%amd%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%microsoft visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%vision%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%add-in%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    = "Microsoft Visual studio 2012 devenv" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hotfix%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service%"

    Did you create a software metering rule for each software title? if not then you need you do that first and it will take over a week before you see results.
    Also keep in mind that your query will only find x86 software titles.
    http://www.enhansoft.com/

  • Query dhcp server for last time Ip address was leased

    Good Day !
    i just ask if any one can get the last time an IP address was leased to a client in windows server 2008 R2 DHCP server
    Mahmoud Sabry IT System Engineer

    You can probably find it in the DHCP log if logging is enabled.
    More About DHCP Audit and Event Logging

  • How to get the last time a record was modified or created ?

    Is there a way (hidden system fields for example, system view, other ?) to get the last time a record of a table was modified or the date it was created.
    Thanks for any help.
    Stiphane CAMPION

    blarman74 wrote:
    I know I could do this with a trigger, but I was wondering if there is a data dictionary view I can query to find the date/time a table was last updated. What I have is a table that is constantly getting hammered with new data being uploaded from a third party. We need to keep close tabs to verify that this datafeed is constantly running and bringing in new data. Because the data that comes in comes from multiple timezones and there are hundreds of lines, our attempts at monitoring by just looking at the data leave something to be desired.
    Any ideas?refer this links
    How to find Last modified/updated time of a particular table
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1590655700346557237
    Thanks

  • How to tell the last time a table was updated

    I know I could do this with a trigger, but I was wondering if there is a data dictionary view I can query to find the date/time a table was last updated. What I have is a table that is constantly getting hammered with new data being uploaded from a third party. We need to keep close tabs to verify that this datafeed is constantly running and bringing in new data. Because the data that comes in comes from multiple timezones and there are hundreds of lines, our attempts at monitoring by just looking at the data leave something to be desired.
    Any ideas?

    blarman74 wrote:
    I know I could do this with a trigger, but I was wondering if there is a data dictionary view I can query to find the date/time a table was last updated. What I have is a table that is constantly getting hammered with new data being uploaded from a third party. We need to keep close tabs to verify that this datafeed is constantly running and bringing in new data. Because the data that comes in comes from multiple timezones and there are hundreds of lines, our attempts at monitoring by just looking at the data leave something to be desired.
    Any ideas?refer this links
    How to find Last modified/updated time of a particular table
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1590655700346557237
    Thanks

Maybe you are looking for

  • Where is iphoto on my macbook?

    Where is iPhoto on my MacBook? I thought iPhoto was standard to Apple products, but I bought this MacBook and it has no iPhoto. Is that unusual?

  • Why is apple maps syncing my favorites?

    Whenever I add a favorite in "maps" it gets synced to my other ios devices. So far I haven't found a way to turn that off. Every option in iCloud is turnef off.

  • SQL Server 2000 Driver for JDBC - Error establishing sockets

    Hi there I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application to see if it would connect to the datacase successfully. But I got the following errors. I already set up the classpath and inst

  • Flash player 11.7.700.169 internet explorer 9 constant crash

    Hi - ever since I installed the latest version of flash player, my internet explorer tabs have started to crash on specific websites, even before i play any type of media. these websites include the new york times, espn soccernet, skysports etc. the

  • REg TCODE ME51N, ME52N

    Hi All, my requirement is to check whether the Estimation Group field is blank for particular material group while creating Purchase Requisition in TCODE ME51N. If itws Blank i need to throw an Error Message. For this requirement i tried User Exit ME