search cancel

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


Article ID: 53158


Updated On:


RC Compare for DB2 for z/OS Bind Analyzer for DB2 for z/OS SQL-Ease for DB2 for z/OS SYSVIEW Performance Management Option for DB2 for z/OS Plan Analyzer for DB2 for z/OS Subsystem Analyzer for DB2 for z/OS Database Analyzer for DB2 for z/OS Fast Unload for DB2 for z/OS Fast Check for DB2 for z/OS Fast Index for DB2 for z/OS Rapid Reorg for DB2 for z/OS



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.


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:



Component: IDB2