We have uploaded batch jobs that run during the day to insert/delete/update records in a keyed file. We've tried to add triggers to this file so that we can keep an audit trail of the changes. The problem is that sometimes we have approximately one million records that get updated/added by this day job. When we added the triggers it took very long to complete.Here are the two approaches we took for the trigger program.
1. We created a COBOL program that added a record in the audit file.
2. We then created a CL program that wrote the before and after images to a data queue. At the end of the day, we copied the data from the data queue to the audit file.
The second approach was much faster than the first, but still it's not that fast.
I was wondering if there is a better approach to take.
OS/400 journals are really the best performing option for auditing record changes. The only way to really speed up a trigger program is to write the images to a data queue, which you've already done. Journaling is done at a much lower level in the system, so it's going to perform better than trigger auditing.
MORE INFORMATION ON THIS TOPIC
Search400.com's targeted search engine: Get relevant information on DB2/400.
The Best Web Links: tips, tutorials and more.
Check out this Search400.com Featured Topic: Database issues resolved
Dig Deeper on DB2 UDB (universal databases)
Related Q&A from Kent Milligan
To solve the SQL error -321 on IBM i6.1, use the new values statement to overcome the error. If you are using an older release, declare a cursor ... Continue Reading
When working with DB2 files with columns that have both short and long names, there is no option choose which column names are returned via ODBC ... Continue Reading
When developing tables in a parent-child relationship, use a primary key and a foreign key along with a unique ID to make your database easier to ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.