How To Tell if Tables are Touched

Asked By 30 points N/A Posted on -
qa-featured

I have a list of tables that includes LOBS and CLOBS fields.

I would like to know when was the time these tables and fields have been last selected, updated, deleted or in short, touched.

Is there a way to do it in DD2 9.1 LUW?

SHARE
Answered By 5 points N/A #108663

How To Tell if Tables are Touched

qa-featured

Hi Jobert,

There are few ways to achieve what do need to do. First, you can create a trigger on the table affected.

Triggers can detect insert, update and delete operations on the table where it is attached.

You can add a column where you want to save the time stamp when your table is touched. Another way also is to add a column in your database with time data type.

This type of approach is just limited to insert and update. This can't be achieved on a delete operation, but triggers can.

Take a look at this website for more information about creating triggers in DB2.

 

Related Questions