Is there a way on the As/400 to know every time a user accesses a specific record? I need to know when a user even looks at a record. I know I can use journaling to record changes to a record as well as adding and deleting records, but as far as I know, journaling will not record when a user just views a record. I could also change the programs to record when users view a record in the application, but this would not record views via SQL and other tools outside the application. Is it even possible to record data access at this level?
Software/Hardware used:
AS/400
ASKED:
November 4, 2009 8:59 PM
UPDATED:
February 8, 2011 12:55 PM
You should be cautious with setting a ‘read’ trigger on the file, or at least that’s what I read when I was researching the different types of triggers. From my research, the trigger would be called for every read…even those which are strictly programatic. So, if a program reads through every record in the file to do something, or if you run a query against the file, or an SQL statement…I believe you’d get a record written to your log file for each.
Of course, I’m sure that you could read some info into the trigger program (or a program that the trigger submits for batch processing) that could determine if the read access was from an ‘allowed’ source, such as a certain program and just not inundate your log file with unwanted records.
YMMV. This is purely from memory, and it was a couple of years ago when I dug into this. I did learn some helpful things about triggers and how they can be written to minimize their effect on your database speed. But…that’s a topic for another question…