Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are auditing a table TRANSACTIONS that inserts a row in HISTORY_TRANSACTIONS when specific columns are changed. These inserts happen through a number of triggers defined on TRANSACTIONS table. Is it possible to find out which trigger inserted a specific record in HISTORY_TRANSACTIONS ? (seems impossible, but I wanted to confirm that no system tables could achieve this as well?)

share|improve this question

You are correct in your assumption – there is nothing done at the database level that would track the source of a row. You would need to modify your history table definition and trigger logic to add this kind of tracking.

share|improve this answer
That being said...I think there is some audit logging you can turn on in DB2 but I do not know to what extent it logs. I believe that by default this is off. – Chris Aldrich Feb 15 '13 at 21:42
Auditing (at least on DB2 for LUW) would be able to track the actual insert statement, but because triggers are compiled in to the actual insert statement it would not be possible to identify which trigger caused the particular action. – Ian Bjorhovde Feb 19 '13 at 6:27
that's a bummer.... – Chris Aldrich Feb 19 '13 at 14:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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