How to query commands issued by DB2 and who did it?

Document ID : KB000053158
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

For auditing purposes you can capture every command issued against DB2 and who issued it with CA Insight for DB2.We will also explain what traces need to be on to get this info.

Solution:

In the CA Insight Performance Monitor for DB2 for z/OS User Guide, Chapter 12 - Auditor Reports, there is a section called 'DB2 Commands Issued Panel'. It states the online request, DB2CMDS, 'displays an audit trail of all DB2 commands and who issued them'. An example of this request is shown in this section.

This report can be run in batch also. It is found in the request library, highlvl.TGTREQ, member name DB2CMDS. I would suggest that you look at this request to see if it meets your needs for auditing DB2 commands. If modifications are necessary, I would suggest you make a copy of this request and make the modifications to the copy.

Minimum modifications required to use it as a batch report would be to place an '*' in column 1 of the line with the ILOG and TERMINAL keywords and remove the '*' on the line with the PRINT keyword. I would suggest you replace SYSOUT with a suitable DDNAME for a DD statement that you would code in your batch Report Writer JCL.

Please refer to Chapter 7 of the CA Insight Performance Monitor for DB2 for Z/OS Writing Requests document for complete details.

To create data that can be used by the report, start a performance trace when DB2 starts up to capture IFCIDs 90 and 91:

        -START TRACE(PERFM) CLASS(30) IFCID(90,91) DEST(SMF)