View previous topic :: View next topic
|
Author |
Message |
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Hi,
I have a query to know.
I have few records that have been updated in my DB2 table. I would like to know who has updated that record and when it was been done? Is there any query that can tell us to know the date and the ID which has updated/inserted the data in the table? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Probably by maintaining couple of columns like userid and time_updated in the table and update them along with updation\insertion of row |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Thanks Sambhaji,
But unfortunately we do not have such column in the table as of now, we will make this change from now onward but I want to know the date in the current tale, which does not have such columns. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
very mild warning
Quote: |
we will make this change from now onward |
isn' t kind of late now
usually the audit/tracking, security, availability are the cornerstones on which the development is based
in order to meet all the other application requirements
in other words it is easy to add a transaction amount to a balance
its a bit more difficult to design for continuous operation or full audit capabilities
audit/tracking ==> strong security and all that follows
reviewing the issue is from any point of view a MAJOR application redesign
simply adding a couple of columns is not enough! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might talk with the dba and see if what you want can be found from the database transaction logs (data used for forward and backward recovery).
With several database systems there is an easy to use programming interface to process the log data. I do not know if there is an easy way with db2. . .
As Enrico mentions, to do this within the application is not a matter of adding a couple of columns. . . For example what if the problem update was done by Mary at noon, but Fred did some other update at 13:00. The update in the fields would be the 13:00 update by Mary which had nothing to do with the problem. |
|
Back to top |
|
|
|