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

Similar Messages

  • How to know the last time a table was used?

    I was trying to find a log or something that can tell me when and who was the last one/s that used a table.
    Could someone help me?
    thanks

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

  • 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.

  • 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

  • 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

  • When the last time a datafile was used

    Hello.
    This is from Solaris box, running Oracle 8.1.7.4.0.
    There are two datafiles, actually three, that were created for three tablespaces. These in total take up more than 3G on the server and space is at a premium.
    I suspect that these files can be removed but I need to understand when the last time they were used and if it is safe to remove them.
    Each of these files was created as 800M files and each has 799.99M remaining.
    Thank you for any advice.
    DA

    it doeasn't help when you use ls -l, because the system checkpoint will upate all the datafiles(except the readonly ones)
    SQL> create tablespace myts datafile '/tmp/myts.dbf' size 50M;
    Tablespace created.
    SQL> create table mytable1 (col1 date, col2 number) tablespace myts;
    Table created.
    SQL> !ls -ltr /tmp/*.dbf
    -rw-r----- 1 oracle oinstall 52436992 Apr 18 09:22 /tmp/myts.dbf
    SQL> alter system switch logfile;
    System altered.
    SQL> !ls -ltr /tmp/*.dbf
    -rw-r----- 1 oracle oinstall 52436992 Apr 18 09:22 /tmp/myts.dbf
    SQL> alter system checkpoint;
    System altered.
    SQL> !ls -ltr /tmp/*.dbf
    -rw-r----- 1 oracle oinstall 52436992 Apr 18 09:24 /tmp/myts.dbf
    if you want to drop the tablespace, just simply run the following command. it should be successful if your TS is empty:
    SQL> drop tablespace myts;
    drop tablespace myts
    ERROR at line 1:
    ORA-01549: tablespace not empty, use INCLUDING CONTENTS option
    SQL> select segment_name,segment_type from dba_segments where tablespace_name='MYTS';
    SEGMENT_NAME
    SEGMENT_TYPE
    MYTABLE1
    TABLE
    SQL> drop table MYTABLE1 purge;
    Table dropped.
    SQL> drop tablespace myts;
    Tablespace dropped.
    Or you can run the following command directly if you confirm to drop everything in this TS:
    drop tablespace myts INCLUDING CONTENTS ;
    HTH
    Scott

  • How to determine the last time  a database was used

    Is it possible in to determine the time a CRUD operation occurred on a database?

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

  • Last time the table structure changed

    What is the best way to find out as to when a table structure was last changed? (Like adding or modifying a column) ?
    I queried LAST_DDL_TIME in the dba_objects view but the problem is that it stores the last time the table was truncated (using TRUNCATE TABLE table_name), as we do truncates often. I was interested in find out when the table was altered. Any ideas ?

    Hi,
    i think database trigger will do better according to your need....
    its simple and best.
    Just create a new table and database trigger.
    Like
    create table db_ddl_log
    username varchar2(30),
    ddl_date date,
    ddl_type varchar2(30),
    object_type varchar2(18),
    owner varchar2(30),
    object_name varchar2(128)
    create or replace trigger db_DDL_Trigger
    AFTER DDL ON DATABASE
    BEGIN
    insert into db_ddl_log
    username,
    ddl_date,
    ddl_type,
    object_type,
    owner,
    object_name
    VALUES
    ora_login_user,
    sysdate,
    ora_sysevent,
    ora_dict_obj_type,
    ora_dict_obj_owner,
    ora_dict_obj_name
    END;
    now check it.
    SQL> select * from db_ddl_log;
    no rows selected
    SQL> desc a
    Name Null? Type
    NO NUMBER
    SQL> alter table a add (name varchar2(1));
    Table altered.
    1* select * from db_ddl_log
    USERNAME DDL_DATE DDL_TYPE OBJECT_TYPE OWNER OBJECT_NAME
    SYS 06-MAR-06 ALTER TABLE SYS A
    SQL> truncate table a;
    Table truncated.
    sql> select * from db_ddl_log
    USERNAME DDL_DATE DDL_TYPE OBJECT_TYPE OWNER OBJECT_NAME
    SYS 06-MAR-06 ALTER TABLE SYS A
    SYS 06-MAR-06 TRUNCATE TABLE SYS A
    Thanks
    Kuljeet Pal Singh

  • 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.

  • Query needed to find what time a sales order was closed

    Hi to All,
    Need to find when a sales order was closed. Meaning the exact time. I know the flags that needed to be considered. But what table/column holds the exact time that the sales order was closed.
    Thanks

    If your workflow process details are not purged below query end_date will be order closed date.
    select a.instance_id
    , to_char(b.begin_date, 'DD-MON-RR HH24:MI:SS') begin_date
    ,to_char(b.end_date, 'DD-MON-RR HH24:MI:SS') end_date
    , a.process_name process
    from  wf_process_activities a, wf_item_activity_statuses b
    where b.item_type        = 'OEOH'
    and   b.item_key     in (select to_char(header_id) from oe_order_headers_all where order_number = <Ordrer_num>)
    and a.process_name = 'CLOSE_HEADER_PROCESS'.
    and   b.process_activity = a.instance_idIn R12 if you do not have any customizations ,
    Current close process defines wake up time as last day of month, there is no time component.
    So order will be eligible from midnight of the last day of the month.
    First run of Workflow background process program for item type OEOH should be closing them.
    For example : If the Wait activity in 'Close - Order' process encountered first time on 09-May-2013(Any time in the month of May), then Wake up time will be last day of current month I.e. 31-May-2013 00:00.

  • Is there a way I can find out when my last icloud back up was using the computer? The screen on my iphone is not working so I need an alternative way. Thanks

    My phones screen is shattered and will no longer turn on. I need to find out when the last time my phone was backed up before I go to the apple store. Any advice would be greatly appreciated. Thanks!

    Connect it to your computer, open iTunes, the last backup time will be displayed on the iPhone Summary tab in iTunes

  • 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

  • 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

  • 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

  • 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.

Maybe you are looking for

  • External USB Hard Drive not showing up on Time Capsule

    Hi all, I have a 500 Gb Time Capsule that used to be able to detect my external USB hard drives. I had to store my things for a while and have just started using the Time Capsule again. The TC works fine, however, the same USB external hard drives I

  • Unable to pass XMlL version tag to the backend from Proxy Service

    Hi All, I have problem in sending xml version tag "<?xml version="1.0" encoding="UTF-8"?>" to a backend as my backend is expecting the input along with the xml version tag. I have done with following thing but that doesnot work for me: 1)What is happ

  • File upload & download through web Dynpro

    Hai All,      Now i am working in webDynpro 2.0.9. For file upload and download through webdynpro "resource" is used.But in my webdynpro version 2.0.9. "resource" is not possible.so tell me how to upload & download by using this version & what is the

  • Pre populate adapter

    Hi, oim v 11G I want to "use" the user password when provision to the DB . I have created a prepopulate adapter but then I can not seem to be able to connect this adapter to get the valuse form the user process. in the "data object information" - i d

  • MacPro is slow and spinning wheel shows up every other click

    It's been a couple of days that my MacPro is running slow and the spinning wheel keeps showing up. is there any way to fix this or should I take it to Apple store?