Where can we find the usage information of a table like its last used date? How can we know if a table is used or not?
Oracle does not store this information by default. Oracle 9i did introduce the capability to monitor index usage, but there is no similar, monitoring functionality for a table.
The best that you can do is to set up database auditing on the table. For instance, issue the following command:
AUDIT select, insert, update, delete ON owner.table;Anytime someone performs a SELECT, INSERT, UPDATE, or DELETE command on this table, an entry will be logged in the SYS.AUD$ table. You can query the numerous DBA_AUDIT_* views to sort out the auditing information.
For More Information
- Dozens more answers to tough Oracle questions from Brian Peasland are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
Dig Deeper on Oracle database design and architecture
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.