twbcmd Job-Level Command Examples
The following examples show how to use twbcmd job-level commands to accomplish these job management objectives:
Force a job to take an immediate checkpoint
An active job can be directed to take a checkpoint using the external command interface. Upon receiving the checkpoint request, each operator instance immediately takes a checkpoint rather than waiting for the checkpoint interval to expire. After the checkpoint completes, the job continues to process data.
Use one of the following commands to force a job to take a checkpoint, where job ID is the name of the target Teradata PT job (determined by using the twbstat command).
F <job ID>,APPL=job checkpoint
twbcmd <job ID> job checkpoint
Force a job to take an immediate checkpoint and then terminate
When the twbkill command is used to terminate a job, it does not automatically take a checkpoint, which means that restarting the terminated job reprocesses everything done after the last scheduled checkpoint. This can cause errors, such as the reinsertion of rows.
To avoid the problems caused by such reprocessing, use the following twbcmd option instead, which creates a checkpoint and then terminates the job.
Do one of the following, where job ID is the name of the target Teradata PT job (determined by using the twbstat command):
F <job ID>,APPL=job job terminate
twbcmd <job ID> job terminate
Pause and then resume a job
Sometimes resources are tied up, tables are locked, or jobs get out of sync. External commands allow you to avoid terminating jobs under these conditions. Use the following procedure to temporarily suspend the flow of data to control job timing and system resources.
1 Do one of the following to pause a job, where job ID is the name of the target Teradata PT job (determined by using the twbstat command):
F <job ID>,APPL=job pause
twbcmd <job ID> job pause
2 To resume the job, do one of the following:
F <job ID>,APPL=job resume
twbcmd <job ID> job resume
Determine the status of all active jobs
Issue one of the following commands, where job ID is the name of the target Teradata PT job, to determine the status of all active jobs:
1 Issue one of the following commands, where job ID is the name of the target Teradata PT job (determined by using the twbstat command):
F <job ID>,APPL=job status
twbcmd <job ID> job status
2 The following will happen: