Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 
 

Find count of number of table changes? 

Oracle Database Tips by Donald BurlesonAugust 3, 2015


Question:  I need to run a report showing the number of inserts, update and deletes to my Oracle tables in the past day.  I don't want to use LogMiner and Oracle auditing is too expensive to implement.  Are there tricks for showing counts of updates to tables?

Answer:  As of Oracle 10g, you can use the flashback table facility to query for table updates.  To do this, you must define your flashback area large enough to contain at least two full days worth of updates (using the undo_retention parameter). Then, you can query flashback_transaction_query to get the table change counts. 

SELECT
   XID,
   START_SCN START,
   COMMIT_SCN COMMIT,
   OPERATION OP,
   LOGON_USER USER,
   UNDO_SQL
FROM
   FLASHBACK_TRANSACTION_QUERY
WHERE
   XID = HEXTORAW('000200030000002D');

You can also query for table update counts using the dba_tab_modifications view, but only if you reanalyze with dbms_stats.  To compute the counts in dba_tab_modifications, Oracle compares the number of modifications with the num_rows column in the dba_tables (based on on the sys.tab$ fixed view) and the modifications are kept in sys.mon_mos$ table.

Once re-analyzed, you can issue a query like this to display the table name and the number of inserts, updates and deletes:

select
   table_owner,
   table_name,
   inserts,
   updates,
   deletes
from
   dba_tab_monidifications
where
   timestamp > sysdate-1;


For other Oracle auditing scripts, see the Oracle script collection.  For more details on Oracle auditing, see the book Oracle Auditing and Oracle 10g New Features.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.