2

How to fetch the last access date for a table in oracle using the query from Oracle DB? I am using select TIMESTAMP from dba_tab_modifications query it's giving me last updates in table but I need last execution of select query statement on a particular table

Thanks in Advance Sai Kumar

3
  • maybe you could add a policy (see docs.oracle.com/cd/B28359_01/network.111/b28531/…) that writes current timestamp in a table on each select
    – Turo
    Commented Mar 18, 2020 at 14:58
  • It's not uncommon to see a column in the table LAST_MODIFIED_DATE and LAST_MODIFIED_BY with a trigger on insert, update set last modifed date to current_timestamp
    – kevinskio
    Commented Mar 18, 2020 at 14:59
  • @kevinsky: sure but i think he wants a LAST_SELECT_DATE on table level
    – Turo
    Commented Mar 18, 2020 at 15:02

1 Answer 1

0

Oracle does not keep this information by default. You need to enable the appropriate AUDIT rules. But I'd question what problem you think this will solve. Auditing every access to a table will be a lot of audit records.

1
  • 1
    He only seems to want the last access. I can speculate he seeks answers to the questions we eventually all ask ourselves: What the heck is this table used for? Is it even used at all? (Just a guess, though.) Commented Mar 18, 2020 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.