The control command (iwm_cmd) enables the system administrator to monitor and control DB2 Query Patroller from the operating system shell. It also enables end users to monitor their jobs.
Specifically, the system administrator and end user can use iwm_cmd when:
Each function of iwm_cmd has a different syntax. Parameters that are common to all functions are described in the following table. Following this are syntax diagrams and parameter descriptions for each iwm_cmd function.
Table 2. iwm_cmd Common Parameter Descriptions
Parameter | Description |
---|---|
-u user_id |
User identification. This parameter provides either the DB2 Query Patroller user ID for the user whose jobs will be monitored or controlled, or the DB2 Query Patroller system administrator's ID (iwm). By default, DB2 Query Patroller uses the current system user ID.
|
-p password | User password. If the user provides the -u parameter and the current user is not the DB2 Query Patroller system administrator, the password parameter must also be specified. The password must be the user's database password. |
iwm_cmd allows users to monitor their jobs and the system administrator to monitor the status of all incomplete jobs. DB2 Query Patroller provides an interface to make it easy for programs invoking iwm_cmd to process information about each job. If a user invokes iwm_cmd without any parameters, all jobs for that user display.
>>-iwm_cmd----+------------------------------+------------------> '--u--user--+---------------+--' '--p--password--' >-----+-------------+---+---------------+---+---------+-------->< +--s--status--+ '--x--max_jobs--' '-fields--' +--S--status--+ '--j--job_id--'
Table 3. iwm_cmd Parameters for Monitoring Jobs
Parameter | Description |
---|---|
-s status |
User job status. This parameter specifies that jobs belonging to the user with the given status should display. The status must be one of the following:
Only the first letter is significant. It can be in either uppercase
or lowercase. The unfinished status includes any queued, scheduled,
held, or running jobs. The finished status includes any done, aborted,
or canceled jobs.
|
-S status |
Unfinished job status. This parameter specifies that all DB2 Query Patroller jobs with the given status should display. The status must be one of the following:
Only the first letter is significant. It can be in either uppercase
or lowercase. The Unfinished status includes queued, scheduled, held,
or running jobs. This parameter may only be used by the DB2 Query
Patroller system administrator.
|
-j job_id | Job identifier. This parameter specifies that only the requested job should display. If someone other than the DB2 Query Patroller system administrator uses this parameter, the user must be the owner of the job. |
-x max_jobs | Maximum job count. This parameter specifies the maximum number of jobs to be listed. If this parameter is not specified, a maximum of 100 jobs display. If max_jobs contains the value 0, no limit is applied. |
fields | Job fields. There are two job fields: Job and Status. You can enter these fields together or separately. This parameter is case sensitive. If you provide a field parameter, the jobs do not display in an easy-to-read format. Instead, the values of the fields are written to STDOUT in a format that other programs can easily process. A horizontal tab character separates each field from the next. Newline characters separate each job's fields from the next. |
iwm_cmd allows users to cancel their jobs. It also allows the system administrator to cancel or release a job.
>>-iwm_cmd----+------------------------------+------------------> '--u--user--+---------------+--' '--p--password--' >-----+--c--job_id------+-------------------------------------->< +--r--+-job_id--+-+ | '-user_id-' | '--R--------------'
Table 4. iwm_cmd Parameters for Controlling Jobs
Parameter | Description |
---|---|
-c job_id | Cancel a job. This parameter specifies that the given job should be canceled. A job need not have finished in order for it to be canceled. If the user is not the DB2 Query Patroller system administrator, the job must be owned by the user. |
-r job_id | Release a job. This parameter specifies that the given job should be released. The job must currently have a status of held. This parameter may only be used by the DB2 Query Patroller system administrator. |
-r user_id | Release all jobs for a user. This parameter specifies that all jobs owned by a user with a current status of held should be released. This parameter may only be used by the DB2 Query Patroller system administrator. |
-R | Release all jobs. This parameter specifies that all held jobs should be released. This parameter may only be used by the DB2 Query Patroller system administrator. |
iwm_cmd enables the DB2 Query Patroller system administrator to monitor and control the status and activity of agent nodes.
>>-iwm_cmd----+------------------------------+------------------> '--u--user--+---------------+--' '--p--password--' >-----+--n--node_id--+---+-------------+----------------------->< '--N-----------' '--s--status--'
Table 5. iwm_cmd Parameters for Monitoring and Controlling Nodes
Parameter | Description | ||
---|---|---|---|
-n node_id | Node identifier. This parameter specifies that the status of the given node should be displayed or be altered. | ||
-N | All nodes. This parameter specifies that the status of all agent nodes should be displayed or be altered. | ||
-s status |
Node status. This parameter specifies that the status of the node(s) should be altered and provides the new requested status. The status must be from the following list. Only the first letter is significant. It can be either uppercase or lowercase.
|
iwm_cmd enables the DB2 Query Patroller system administrator to list and change the data source parameters for one or all data sources.
Syntax:
>>-iwm_cmd----+---------------------------------+---------------> '--u--user_id--+---------------+--' '--p--password--' >-----+-| data_source options |-+------------------------------>< '--D----------------------' data_source options |----d--data_source----+------------------+---------------------> '-Status=--status--' >-----+-----------------------+---+------------------------+----> '-JobCostLimit=--value--' '-JobCountLimit=--value--' >-----+-----------------------+---+------------------------+----| '-NodeCpuLimit=--value--' '-NodeDiskLimit=--value--'
Table 6. iwm_cmd Parameters for Listing and Controlling Data Sources
iwm_cmd enables the DB2 Query Patroller system administrator to list and change system parameters.
>>-iwm_cmd----+------------------------------+----P-------------> '--u--user--+---------------+--' '--p--password--' >-----+-----------------------+---+------------------------+----> '-JobCostLimit=--value--' '-JobCountLimit=--value--' >-----+-----------------------+---+---------------------------+-> '-JobPurgeDays=--value--' '-ResultsPurgeDays=--value--' >-----+----------------------------+--------------------------->< '-AccountingStatus=--status--'
Table 7. iwm_cmd Parameters for Listing and Controlling System Parameters