Table - Last Updated Timestamp

Hi,
I have one use case, for this I want to know Last updated Timestamp for all the Tables in one schema.
Can you please help me to get the SQL Query for this?
Regards,
Muthu

Hi Muthuraman,
Try this SQL. You can try filtering STATEMENT_STRING with any operation as per your requirement. Here my sql will get all the INSERT queries to "MY_SCHEMA"."MY_TABLE" and their execution time. Similarly you can try with UPDATE, DELETE, DROP, etc.
SELECT STATEMENT_STRING, LAST_EXECUTION_TIMESTAMP FROM M_SQL_PLAN_CACHE
WHERE STATEMENT_STRING LIKE 'INSERT INTO "MY_SCHEMA"."MY_TABLE"%'
ORDER BY LAST_EXECUTION_TIMESTAMP;
Regards,
Chandra

Similar Messages

  • Query for the table last updated

    hi,
    how to know the time and date a table last updated?
    Regards
    Raj

    Raj,
    Query DBA_OBJECTS, here is an example:
    SQL> SELECT OBJECT_NAME, LAST_DDL_TIM, TIMESTAMP
    FROM DBA_OBJECTS
    WHERE OBJECT_NAME = 'FND_USER'
    AND OBJECT_TYPE = 'TABLE';

  • How can I find out when was a particular table last updated?

    How can I find out when was a particular table last updated? I need to find out the usage of this table - when was it last updated, etc. Thanks in advance. The version I am using is Oracle 9i.

    If you don't have any application level logging, and auditing is not enabled, there's not much hope.
    You could, if you have archive logs available, go trawling through archive logs via logminer, but that's likely to prove painful and not very fruitful, unless you're very meticulous and patient...
    -Mark

  • OA Framework Attachment Table Last Updated Column Format

    Hi,
    Tired multiple ways to get date time stamp for column Last Updated in Attachment table,
    In standard display ,it shows as DD-Mon-YYYY ,requirement is to display Last Updated Column as DD-Mon-YYYY HH:MI:SS.
    Can we have default sort on the title on the table.
    Please advise.
    Thanks,Sarath.

    Thanks Kali for the reply.
    Let us consider notification list seeded page, which lists the notifications. This notification table has a column called "Sent" which shows the date (and not the time) when this notification was sent. I also want to see time part in this. Type of the column is MessageStyledText. I can't change type from Date to DateTime as you suggested, via personaliztion. Can I?
    If I can't change it via personalization, should I do it via controller extension?
    regards, Yora

  • When table last updated

    Can i know how to find out/sql query when was the last time oracle table is updated

    If you are interested in the timing of the most recently committed INSERTs and UPDATEs, you can find out the SCN of the most recently modified row in the table using this query
    SELECT max(ORA_ROWSCN)
    FROM <TABLE>Once you have the most recent SCN, you can try to find out what time it corresponds to.
    For “recent” SCNs, you can try SCN_TO_TIMESTAMP function.
    If SCN_TO_TIMESTAMP does not work for your SCN, you can try to approximate the time using V$ARCHIVED_LOG or other methods.
    Again, this procedure would not detect DELETEd records.
    Iordan Iotzov
    http://iiotzov.wordpress.com/

  • Timestamp locking, last update timestamp

    Let's say there are two tables - Customer and Vehicle; both tables have the "last_update_timestamp" column.
    Assuming the "timestamp locking policy" is used, if the changes to the Customer and Vehicle are in the same transaction, will the updated customer and vehicle records in database have the same timestamp after a successful commit?
    Thanks.

    Haiwei,
    After giving your issue some more thought I wanted post an example of how you could extend TopLink shipped TimestampLockingPolicy to only get the value once per UnitOfwork. The below code is the extension and also includes and easy to use install method to add the policy into your pre-existing system. This should become the default behavior in a future release.
    Cheers,
    Doug
    package model.persistence;
    import java.util.Iterator;
    import oracle.toplink.descriptors.TimestampLockingPolicy;
    import oracle.toplink.internal.descriptors.OptimisticLockingPolicy;
    import oracle.toplink.publicinterface.Descriptor;
    import oracle.toplink.queryframework.ModifyQuery;
    import oracle.toplink.sessions.Session;
    * This extended timestamp locking policy will perform almost identical behavior
    * to its shipped parent. The only difference is that the timestamp value will
    * only be retrieved once for the commit of a UnitOfWork and will be used for
    * all objects in this UnitOfWork with the same locking policy.
    * @author Doug Clarke, TopLink Product Mananger
    * @since TopLink 9.0.4.5 (should work on earlier versions as well)
    public class MyTimestampLockingPolicy extends TimestampLockingPolicy  {
      /** Property key for session (UnitOfWork) properties map. */
      public static final String TS_PROPERTY = "OptLock-new-timestamp";
       * This method will install this extended policy into all descriptors for the
       * given session that use the parent TimestampLockingPolicy. This is typically
       * called from a preLogin session event.
       * &lt;code&gt;
       *   public void preLogin(SessionEvent event) {
       *      MyTimestampLockingPolicy.install(event.getSession());
       * &lt;/code&gt;
       * The assumption is that by calling
       * this in the preLogin the session/descriptor/policy are not yet initialized.
       * Some additional code is provided for the case that you are invoking this
       * on a session that is already initialized to ensure the policy is properly
       * configured for use.
       * @param session
      public static void install(Session session) {
        for (Iterator i = session.getDescriptors().values().iterator(); i.hasNext(); ) {
          Descriptor desc = (Descriptor) i.next();
          OptimisticLockingPolicy originalPolicy = desc.getOptimisticLockingPolicy();
          if (originalPolicy != null && originalPolicy.getClass() ==
              TimestampLockingPolicy.class)
            OptimisticLockingPolicy policy = new MyTimestampLockingPolicy(desc, (TimestampLockingPolicy) originalPolicy);
            desc.setOptimisticLockingPolicy(policy); 
            if (desc.isFullyInitialized()) {
              policy.initialize((oracle.toplink.publicinterface.Session) session);
       * This constructor creates a new locking policy to replace the one created by
       * default for timestamp locking. It must copy over the relevant values. It is
       * assumed that the session/desciptor/policy have not yet been initialized.
       * @param descriptor for the policy
       * @param originalPolicy to copy values from
      private MyTimestampLockingPolicy(Descriptor descriptor, TimestampLockingPolicy originalPolicy) {
        super(originalPolicy.getWriteLockFieldName());
        super.setDescriptor(descriptor);
        if (originalPolicy.usesLocalTime()) {
          this.retrieveTimeFrom = LOCAL_TIME;
        } else {
          this.retrieveTimeFrom = SERVER_TIME;
        setIsStoredInCache(originalPolicy.isStoredInCache());
       * Get the next timestamp value. This is where this policy extends the default
       * one. It uses the session (UnitOfWork in this case) properties to cache the
       * timestamp value once it is retrieved the first time from VM or database.
       * The commit cycles of the UnitOfWork, where this is used is single threaded
       * for a given client. For this reason no synchonization is needed on the shared
       * properties.
       * @return New timestamp value to be used in each row's update
      protected Object getNewLockValue(ModifyQuery query) {
        Object tsValue = query.getSession().getProperty(TS_PROPERTY);
        if (tsValue == null) {
          tsValue = super.getNewLockValue(query);
          query.getSession().setProperty(TS_PROPERTY, tsValue);
        return tsValue;   
       * During the insert of a new object an initial timestamp value must be
       * retrieved. This method is written similar to the getNewLockValue.
       * @param session
       * @return New timestamp value to be used in each row's insert
      protected Object getInitialWriteValue(oracle.toplink.publicinterface.Session session) {
        Object tsValue = session.getProperty(TS_PROPERTY);
        if (tsValue == null) {
          tsValue = super.getInitialWriteValue(session);
          session.setProperty(TS_PROPERTY, tsValue);
        return tsValue;   
    }

  • How to find out last updatde timestamp for a table

    Hi All,
    I want to find out the last updated time stamp of a table. Is there some thing available with the sys tables. Is there something can be done with user_objects.
    Or, is there any need to write pl/sql code to get the last updated timestamp for a table.
    Please provide some inputs.
    regards,
    Naresh

    Hi Oleg,
    Select * from user_objects.I belieive it gives you the last_ddl_time not the time a update or delete was done.
    Not sure if we have this feature in any new release.
    I am working on Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    to the OP
    I will suggest if you planto audit then use the audit feature based on your DB version.
    Or to make it more simple have a column called modified_date and update this column whenever you update the record.
    Regards,
    Bhushan

  • Last Update Polling Strategy Sets Incorrect Time

    Hi,
    I've created a BPEL process with a database adapter that uses a timestamp polling strategy. The BPEL process picks up table rows that are newer than the last update timestamp. However, the last updated timestamp that is set in the control table is set to the beginning of the current day and not the the last updated timestamp of the row that got changed. For example, if the BPEL process runs today with the last update of 2006-09-20 10:59:00.0 in the table being queried it will update the same field in the control table with 2006-09-20 00:00:00.0
    Can someone suggest why this is happening? And how to resolve?
    Cheers,
    Aashish
    PS - The database resides on a server that is two hours ahead of the application server. I don't believe this is an issue because the dates are all database specific and no dates are extracted from the application server...unless I'm wrong somewhere.

    To add to this earlier note. I can get this to work with the olite database connection, but not Oracle (JDBC) thin driver. Should I be using the Type 2 OCI driver? If so, what should I use?

  • Last update condition...

    Hi All
    I need to select the records who's last update date less than ( sysdate-90/1440)
    {Query}
    SQL> select present.object_type, present.object_id
    2 from (select cb2.object_type, cb2.object_id, incident_status_name,
    3 incident_severity_name
    4 from cs_brm_3d_service_request_v cb2,
    5 cs_incidents_all cia,
    6 jtf_rs_groups_vl jrgv
    7 where cb2.record_status = 'present'
    8 and (cb2.incident_id = cia.incident_id)
    9 and cb2.incident_severity_name = 'emergency'
    10 and cb2.incident_type_name = 'rts customer service request'
    11 --and cb2.incident_status_name = 'open'
    12 and cia.status_flag = 'o'
    13 and cia.owner_group_id = jrgv.group_id
    14 and jrgv.group_name in ('rts', 'rtm', 'rtn')
    15 and cb2.close_date is null
    16 and ( cb2.last_update_date <= (sysdate - 90 / 1440)
    17 or exists (
    18 select 1
    19 from jtf_tasks_b jtb
    20 where jtb.source_object_id = cb2.incident_id
    21 and jtb.last_update_date <= (sysdate - 90 / 1440)
    22 and jtb.last_update_date =
    23 (select max (last_update_date)
    24 from jtf_tasks_b
    25 where source_object_id = cb2.incident_id))
    26 or exists (
    27 select 1
    28 from fnd_attached_documents fad
    29 where pk1_value = cb2.incident_id
    30 and fad.last_update_date <= (sysdate - 90 / 1440)
    31 and fad.last_update_date =
    32 (select max (last_update_date)
    33 from fnd_attached_documents
    34 where pk1_value = cb2.incident_id))
    35 or exists (
    36 select *
    37 from jtf_ih_activities jih
    38 where jih.doc_id = cb2.incident_id
    39 and jih.last_update_date <= (sysdate - 90 / 1440)
    40 and jih.last_update_date =
    41 (select max (last_update_date)
    42 from jtf_ih_activities
    43 where doc_id = cb2.incident_id))
    44 )) present;
    {end Query}
    here tables jtb,fad, jih are may or may not have records..
    Could you please suggest me how can i do this..
    Thanks
    Ravula

    Hi Frank, thanks for your quick response..
    I need to check jtb,fad,jih tables last update also, these tables may or mayn't have records..
    16 and ( cb2.last_update_date <= (sysdate - 90 / 1440)
    17 or exists (
    18 select 1
    19 from jtf_tasks_b jtb
    20 where jtb.source_object_id = cb2.incident_id
    21 and jtb.last_update_date <= (sysdate - 90 / 1440)
    22 and jtb.last_update_date =
    23 (select max (last_update_date)
    24 from jtf_tasks_b
    25 where source_object_id = cb2.incident_id))
    26 or exists (
    27 select 1
    28 from fnd_attached_documents fad
    29 where pk1_value = cb2.incident_id
    30 and fad.last_update_date <= (sysdate - 90 / 1440)
    31 and fad.last_update_date =
    32 (select max (last_update_date)
    33 from fnd_attached_documents
    34 where pk1_value = cb2.incident_id))
    35 or exists (
    36 select *
    37 from jtf_ih_activities jih
    38 where jih.doc_id = cb2.incident_id
    39 and jih.last_update_date <= (sysdate - 90 / 1440)
    40 and jih.last_update_date =
    41 (select max (last_update_date)
    42 from jtf_ih_activities
    43 where doc_id = cb2.incident_id))
    Thanks
    Ravula

  • How to find out when a table was last updated?

    Is there a way to find out when a table was last updated/inserted/deleted? Thanks!

    There may be an easier way but if you are trying to get info on something that has already happened look at your redo logs and archived logs. It would be hard but in V$LOGMNR_CONTENTS you could find the max time for a given object. Note to use this you need to set up log miner. Since you did not give a version try the Oracle 9i DBA Guide pg 9-1.

  • 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

  • Recording a last updated time for each record in a table

    hi
    i have a table with 5 columns. and the table has 100 rows of data.
    i need to add a sixth column and this column should contain the last updated time of that particular row.
    i am allowed to use triggers.
    for example, if the 55th row undergoes a change, the 6th column's value for the 55th row should update itself with that particular time.
    can any one of you come up with an optimized solution for this please ???
    thanx a million in advance and best regards,
    novice DBA
    :)

    Hi,
    Here's an example:
    CREATE OR REPLACE TRIGGER table_x_biu
    BEFORE INSERT OR UPDATE ON table_x
    FOR EACH ROW
    BEGIN
         :NEW.modified_dt := SYSDATE;
    END     table_x_biu
    SHOW ERRORSwhere table_x is your table name, and modified_dt is the DATE column to be populated.
    You won't have to specify modified_dt in any INSERT or UPDATE statements. In fact, if you do, the value you give will be ignored, and the trigger will always substitute SYSDATE.
    WARNING: if you do get an error message, the line number reported will usually be relative to the first DECLARE or BEGIN statement in the trigger. For example, if I had mis-spelled SYSDATE in the example above, the error message would say there was a problem in line 2, not line 5.

  • Sql statement for retrieving the last update time of a table

    Hello all,
    Can somebody give me an example of sql statement for retrieving the last update time of an oracle table.
    Thank you
    Il

    Thanks for the fast replies. It works great when I test it as a sql statement but when trying to populate a datalist with it it raises the following exception:
    Exception Details: System.ArgumentException: SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN is neither a DataColumn nor a DataRelation for table DefaultView
    Part of the Datalist Code:
    ItemTemplate>
    Line 12:             SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN)):
    Line 13:             <asp:Label ID="SCN_TO_TIMESTAMP_MAX_ORA_ROWSCN__Label" runat="server" Text='<%# Eval("[SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN))]") %>'>
    Line 14:             </asp:Label><br/>
    Line 15:             <br/>
    {code}
    Why is this happening? Any ideas?
    Il                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Query to get last updated time of tables

    Hi,
    How to get the last updated date time of the Max DB table
    Regards,
    Satish

    Hi,
    Unfortunately, do not this this would be possible. Check this thread:
    MAXDB Audit logs
    Regards,
    Srikishan

  • Dimension Current Flag and Last Update date not updated - SLD issue!

    Hi.
    ODI is running pretty well now. I have created several interfaces from flats, multi database tables, but still have to test the services and cdc, etc... later I will do this.
    I am having a small issue here when dealing with Slowly Changing Dimensions. I am trying to populate a product dimension. I use a Load KM and the SLD KM. Then I update a product row in the source, and I wish to make sure that type-II runs OK for major and minor changes after running the interface.
    Well minor changes run ok, deletes don't run at all, and update for major changes should generate another surrogate key and turn the old record "current flag" to zero and "close"/update the last update date as well!!!
    What am I missing here? Is this related to the KM restrictions?
    "Restrictions:
    - Make sure to map ALL target table columns flagged as: "Surrogate Key", "Natural Key", "Current Record Flag", "Start Timestamp" and "End Timestamp". Notice that mappings set for the "Current Record Flag", "Start Timestamp" and "End Timestamp" columns are not used."
    Do I need to implement somehow that behaviour or use another KM?
    Another question regarding data warehousing: Well usually in a bespoke DW we can have N sources, N staging areas, and several data marts. Using ODI, for instance what are the best practises to create or simulate this behaviour??
    I know that using a Knowledge Module I can load/extract (to temp tables in the source work schema), then integrate in the target schema.. using the same schema to temp staging tables or another schema.... what is the best aproach?
    Any dw people wants to share some experiences here?
    Thank you all.
    Best regards,
    Alvaro
    Message was edited by:
    Alvaro Silva

    Thanks Cezar :)
    Well Updates work if I unckeck 262!!! :) But deletes are not setting the CURR to zero!!!
    PS: um abraço para ti também .... o mundo é pequeno! :) será que podes adicionar-me no messenger para alguma troca de experiências? [email protected]
    Alvaro
    Message was edited by:
    Guest

Maybe you are looking for

  • Error messages when saving as PDF in illustrator cc

    Since the last adobe update; Every time I save as a PDF I get 2 error messages: This file does not have a program associated with it to perform this action.  Please install a program or, if one is already installed, create an association in the defau

  • Iframe src bound to backend bean url

    Hello there, I have a jspx page with an iframe. I would like to bind the src of that iframe to an url which is in my backend bean - populated by reading a property file. Here the code. .jspx <f:verbatim> <IFRAME src="http://my.oracle.com" frameborder

  • Geocoding experience !!!

    Hi, guys. I´ve developped MAPS using the WAD in BW 3.5 and I have many doubts working in a Unix environment mainly using AXL files. I would apreciate if somebody could help me with his experience. Thanks in advance Eduardo Silberberg

  • Calling a URL from WD for ABAP 2004s

    Hi, In our scenario we would like to call workflow items from a web dynpro for abap application. We do not use a portal. I have build an alv from where the user can select his workflow tasks. A button then calls a method to trigger workflow. Within t

  • Problem with "/" in formula

    Hi I use CR XI R2 I would like to write something like this in my formula - string field from database "/" -  like a normal text string, not like a division,