Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Tatiana.

Asked: September 03, 2017 - 10:01 pm UTC

Last updated: September 04, 2017 - 1:45 pm UTC

Version: Oracle database 11g express

Viewed 1000+ times

You Asked

Hi, TOM.

Is there a sql query that returns the daily transactions to a specific table?

For example, I want to know how many insert and update were executed a day for table "People".

Also, it's important to consider the commit statement for the insert or update querys.

and Chris said...

What exactly do you want to know?

How many inserts+updates you executed on a given day?

Or how many rows you inserted or updated?

These aren't quite the same thing. An insert could add zero, one or bajillions of rows.

So precisely which question are you trying to answer?

In either case there's nothing enabled by default that gives you all this information.

If you want to track statements you could enable auditing.

http://docs.oracle.com/database/122/DBSEG/introduction-to-auditing.htm#DBSEG1023

If it's to see the changed rows you could look into Flasback Data Archive. Or just standard Flashback Query if you only need "recent" changes.

http://docs.oracle.com/database/122/ADFNS/flashback.htm#ADFNS628

Or, if you really like wasting lots of time writing your own code, you could use triggers to do these things (*shudder*).

What the "best" method is here really depends on exactly what you want to track and why.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Security

All of the vital components for a secure database are covered in the Security guide.