asnqccmd: Working with a running Q Capture program
Use asnqccmd to send a command to a running Q Capture program on Linux®, UNIX, Windows, and UNIX System Services (USS) on z/OS®. Run this command at an operating system prompt or in a shell script.
For information on using the MVS™ MODIFY command to send commands to a running Q Capture program on z/OS, see Working with running Q Replication and Event Publishing programs by using the MVS MODIFY command.
Syntax
Parameters
Table 1 defines the invocation parameters for the asnqccmd command.
Parameter | Definition |
---|---|
capture_server=db_name | Specifies the name of the database or subsystem that contains the Q Capture control
tables. z/OS: Specifies the name of the Db2® subsystem where the Q Capture program is running. For data sharing, the value of capture_server might be the group attach name that was used to run Q Capture in any LPAR without changing the JCL for the started task. Linux, UNIX, Windows: If you do not specify a Q Capture server, this parameter defaults to the value from the Db2DBDFT environment variable. |
capture_schema=schema | Specifies a name that identifies the Q Capture program that you want to work with. |
chgparms | Specify to change one or more of the following operational parameters of a Q Capture program
while it is running:
Important: The parameter that you are changing must immediately follow the
chgparms parameter.
z/OS restriction: The
value of memory_limit cannot be altered while the Q Capture program is running.
To change the value you must stop the Q Capture program.
You can specify multiple parameters in one asnqccmd chgparms command, and you can change these parameter values as often as you want. The changes temporarily override the values in the IBMQREP_CAPPARMS table, but they are not written to the table. When you stop and restart the Q Capture program, it uses the values in IBMQREP_CAPPARMS. Descriptions of asnqcap parameters includes details about the parameters that you can override with this command. |
prune | Specify to instruct a Q Capture program to prune the IBMQREP_CAPMON, IBMQREP_CAPQMON, IBMQREP_CAPTRACE, and IBMQREP_SIGNAL tables once. This pruning is in addition to any regularly scheduled pruning that is specified by the prune_interval parameter. |
qryparms | Specify if you want the current operational parameter values for a Q Capture program written to the standard output (stdout). |
qstatus=send_queue | Specify to see an informational message with the following information about the send queue:
Note: The output of the qstatus command is
written to the Q Capture log file. View the ASN0668I message in the log file for the command
results.
|
reinit | Specify to have a Q Capture program deactivate and then activate all Q subscriptions and publications using the latest values in the IBMQREP_SUBS, IBMQREP_SRC_COLS, and IBMQREP_SENDQUEUES tables. This command allows you to change some attributes for multiple Q subscriptions or publications while a Q Capture program is running. This command will not prompt a new load of targets. |
reinitq=send_queue | Specify to have the Q Capture program refresh one send queue using the latest attributes from the IBMQREP_SENDQUEUES table. This command affects all Q subscriptions or publications that use this send queue. Only the following attributes will be refreshed: ERROR_ACTION, HEARTBEAT_INTERVAL, MAX_MESSAGE_SIZE. |
startq=send_queue/all | Specify to start putting messages on one or all disabled send queues. Q
Capture sets the queue state to active (A) and resumes putting messages on a specified queue or all
inactive queues. Q Capture restarts reading the log at the oldest restart point among all send
queues, and catches up the queues that were stopped until all queues have the same restart
point. Restriction: Before you issue the startq command, all previous
stopq commands or signals must be completed. When the stopq
command is completed the ASN7176I message is issued. ASN7227I or ASN7225I are also issued if you use
the stopafter parameter with stopq.
|
status | Specify to receive messages that indicate the state of each Q Capture thread (main, administration, prune, holdl, transaction, and worker). |
show details | Specify after the status parameter to view a more
detailed report about Q Capture program status, with the following information:
Linux, UNIX, Windows:
|
stop | Specify to stop the Q Capture program in an orderly way and
commit the messages that it processed up to that point. You can specify the captureupto parameter, stopafter parameter, or both to stop Q Capture in a controlled manner from a specified point:
|
stopq=send_queue/all | Specify to stop putting messages on one
or all send queues. Q Capture sets the queue state to inactive (I) and stops putting messages on a specified queue or all
queues. The Q Capture program continues to publish changes for Q subscriptions
that are associated with active send queues. If all send queues are
stopped, Q Capture continues reading the log for signals such as CAPSTART,
continues to insert into its monitor tables, and waits for commands. When you specify to stop an individual queue, you can also specify the captureupto parameter, stopafter parameter, or both to instruct Q Capture to stop putting messages on the queue in a controlled manner from a specified point:
|
Example 1
To instruct a Q Capture program to refresh all Q subscriptions and publications using the latest values in the Q Capture control tables:
asnqccmd capture_server=sourcedb capture_schema="alpha" reinit
This command will start all inactive queues if the Q Capture program was started with startallq=y (the default setting).
Example 2
To instruct a Q Capture program to refresh the ERROR_ACTION, HEARTBEAT_INTERVAL, and MAX_MESSAGE_SIZE attributes for all Q subscriptions and publications that use a send queue called Q1:
asnqccmd capture_server=sourcedb capture_schema="alpha" reinitq="Q1"
Example 3
To temporarily shorten the default pruning interval for a running Q Capture program to one minute, and temporarily lengthen the default amount of time that the Q Capture program sleeps after processing Q subscriptions and publications:
asnqccmd capture_server=sourcedb capture_schema="alpha" chgparms
prune_interval=60 sleep_interval=10000
Example 4
To receive detailed messages about the status of the Q Capture program:
asnqccmd capture_server=sourcedb capture_schema="alpha" status show details
Example 5
To prompt a Q Capture program to stop reading the recovery log October 15, 2010 at 3:30 p.m., wait until all transactions that were committed to the target database up to that time are applied, and then stop:
asnqccmd capture_server=sourcedb capture_schema="alpha" stop
captureupto="2010-10-15-15.30" stopafter=data_applied
Example 6
To prompt a Q Capture program to stop reading the recovery log immediately and then stop after all messages are drained from the transmission queue (or the shared local send-receive queue):
asnqccmd capture_server=sourcedb capture_schema="alpha" stop stopafter=data_sent