If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Whodunnit in DB2 Tables????

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-21-07, 21:50
drogomoss drogomoss is offline
Registered User
 
Join Date: Mar 2007
Posts: 30
Whodunnit in DB2 Tables????

Hello All,

Good day.

Here is the mystery:

Our project group runs an I2 implementation every Monday. Several scripts and procedures inserts data into several backup tables that are first cleared before insert. All these tables do not have any constraints. The script that inserts data into these table is the last one to make any updates. The data source of that script is also a table that always contains data. It is this data that is being inserted into the backup tables.

After the I2 run everything is stopped. Tables are checked and all check out good. After about a day, the backup tables are suddenly cleared. Everybody in the project group claims not to have deleted or cleared any table. No script , procedure or workflow has been run.

Our mystery is WHO CLEARED THE BACKUP TABLES?

--------
My question is: Is there a log or a way to know when a table has been last update, inserted, deleted or queried. If there is... based on the time or date we will be able to compare it with the schedule of the project members... granting that someone is lying. Or is there any other non-human reason the tables where cleared.

Thanks for helping me solve this whodunnit mystery...
Reply With Quote
  #2 (permalink)  
Old 03-22-07, 06:29
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Have a look at DB2's auditing facilities (see db2audit tool). You could also analyze the DB2 logs and th evarious histories (see LIST HISTORY command). Tracking insert/update/delete operations can be done with triggers as well.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 03-24-07, 06:38
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by drogomoss
Or is there any other non-human reason the tables where cleared.
Yes, there could be:
- Check the catalog to find out whether there are triggers defined which are deleting rows from the backup tables.
- Check whether there are programs that would in normal circumstances do no harm, but e.g. get a rollback somewhere in the middle (e.g. because of a timeout or so) and as a consequence of that are not restoring those tables in the expected state, as they would do in normal circumstances.
Check the catalog (or the dynamic statement cache) for queries containing a "DELETE FROM <table_name>".
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On