Collecting report data with the Collect Report Data Batch program
The Collect Report Data Batch program allows for the collection of report data and postprocessing of collected report data by means of a batch job. This method provides a flexible way to automate the collection and postprocessing, thereby keeping the resource overhead minimized.
You can collect report data from a DB2 subsystem, a specified member of a data sharing group, or all members of a data sharing group. Collected report data is stored in a sequential data set or a Generation Data Group (GDG).
If a GDG is used, a user-specified job can be started to process collected report data automatically each time after a switch to a subsequent Generation Data Set (GDS) occurs. This method can be used to continuously collect trace data from DB2 and to automate the postprocessing. For example, the contents of the GDG generations (the Generation Data Sets) can be used to automatically generate reports or to load collected data into a Performance Database.
This method of collecting and postprocessing report data can be used as alternative to using System Management Facility (SMF) or Generalized Trace Facility (GTF) data sets if more flexibility regarding data collection parameters and error handling and less resource overhead are required.
The commands and parameters that determine the collection and postprocessing of data must be specified in the SYSIN DD statement of the respective JCL, as outlined in the following syntax diagram. A sample batch job can be found in data set prefix.TKO2SAMP(FPEZCRDJ).
- SSID
- Specifies the DB2 subsystem ID ssid.
- DSGLOBAL
- Specifies whether to collect report data from all members of a
data sharing group.
- N
- Specifies not to collect report data from all members. This is the default.
- Y
- Specifies to collect report data from all members. This setting is ignored if the specified subsystem ID ssid is not a member of a data sharing group.
- DSMEMBER
- Specifies the data sharing group member dsMbr from which to collect report data. dsMbr can be located on a different LPAR.
- GDGDATASET
- Is optional. If specified, it determines that the trace
data collection will not terminate after a stop criteria is met, but
the output data set will be switched to the next generation of the
Generation Data Group (GDG), which means, to a subsequent Generation
Data Set (GDS). Specify the name of an existing GDG as gdg (the
GDG name, not a GDS name). Only ELAPSEDTIME may
be used with GDGDATASET to specify a stop criteria.
If specified, the JCL does not require an OUTPUT DD statement.
Use the PURGE operator command to stop CRD collection.
- JOB
- Is optional. If specified, job is executed
after each switch to a subsequent GDS. job must
be the name of a started job.
This can be used to automatically process the data in a GDS, for example, loading it into a Performance Database or generating reports.
If you require the actual name of the Generation Data Set (GDS) that was in use before the switch, you can specify the JCL symbol&GDGDSN
in the job's command stream, as in the following example:
This method of using the JCL symbol ensures that the job is synchronized with the proper generation of the GDG, in case new generations are created faster than JES submits the specified job.//INPUTDD DD DSN=&GDGDSN,DISP=...
- VOLUME
- Is optional. A volume must be specified if a specified GDGDATASET is not managed by SMS.
- UNIT
- Is optional. A unit must be specified if a specified GDGDATASET is not managed by SMS.
- DSSIZE
- Is optional. It can be used to override the default space unit
that is used for the allocation of each GDG member. Possible values
for dsSizeType are:
- TYPE1
- Causes the GDG member to be allocated with:
- Space unit = BLK
- Primary quantity = 100
- Secondary quantity = 500
These values are the default.
- TYPE2
- Causes the GDG member to be allocated with:
- Space unit = TRK
- Primary quantity = 100
- Secondary quantity = 500
- TYPE3
- Causes the GDG member to be allocated with:
- Space unit = TRK
- Primary quantity = 100
- Secondary quantity = 1500
- TYPE4
- Causes the GDG member to be allocated with:
- Space unit = CYL
- Primary quantity = 10
- Secondary quantity = 150
- TYPE5
- Causes the GDG member to be allocated with:
- Space unit = CYL
- Primary quantity = 10
- Secondary quantity = 150
- OPBUFSIZE
- Specifies the size (in KB) of the Online Performance (OP) buffer
that is used to buffer collected data.
- 2048
- Is the default size.
- opSize
- Can be up to 16384 KB.
- ELAPSEDTIME
- Specifies one (of multiple) stop criteria for the data collect
task.
- 60
- Is the default duration (in seconds).
- secs
- Specifies the duration (in seconds).
- RECCOLLECTED
- Specifies one (of multiple) stop criteria for the data collect
task.
- recs
- Specifies the maximum number of IFCID records to collect.
Not supported in combination with GDGDATASET.
- TERMTHREADS
- Specifies one (of multiple) stop criteria for the data collect
task.
- thds
- Specifies the number of terminated threads after which data collection stops.
Not supported in combination with GDGDATASET.
- TRACE
- Specifies the DB2 START TRACE command to collect
data. The command can start with a preceding dash (
-
). Do not use the DEST or SCOPE subcommands unless a specific OP buffer should be used.The following excerpt from a batch job shows how two START TRACE commands are used to collect different trace classes and IFCIDs:⋮ TRACE('START TRACE(PERFM) CLASS(30) IFCID(314) TDATA(CORRELATION,CPU)') TRACE('START TRACE(AUDIT) CLASS(31) IFCID(140,83)')