开发者

How to monitor and log all the SQL insert commands

I am using Oracle SQL Dev 2.1.1.64

I work with application that uses oracle database for storage. Is there any way in SQL Dev. to monitor and log all the insert commands that are "coming" from 开发者_JAVA技巧the web application into database? Can you tell me how to do that?


audit insert table by <web-application-user> by access

should get you started.

Be sure to set the parameters audit_trail and audit_file_dest as you need them.

After that, you find the operations either in sys.aud$ or in the directory specified by audit_file_dest.

There is also fine grained auditing into which you might take a look, but from your question, using fine grained auditing (FGA) would seem to be overkill.


You can write a trigger for the tables you want to monitor. If you are only interested on the insert queries coming from the Web Application, you can check on the trigger for some specific username/schema accessing the table, and use that username as your web application credentials.

Alternatively you can also use Oracle's AUDIT feature. It requires a little bit of Oracle Database Administration knowledge to implement though...


You could query v$SQL, but you would need to have the relevant GRANTS to enable you to do this.

For long running sessions you can also monitor progress using v$session_longops

hope this helps you.


Create a trigger that writes to a journaling table whenever a change of data in the table happens (insert, update, delete). Before delete, after insert, after update triggers are what you want.

It won't specifically log only the web application, but if you log the user making the change you will be able to filter on that when viewing the data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜