Friday, September 25, 2015

Use adctrl to stop a worker of adpatch

1.  Skip a script when it has been "Running" status for too long

During patching, a program, such as cstpostimportaad.sql, stays in "Running" status forever (Doc ID 1453612.1). To stop and skip it (and you may re-run the program after adpatch finishes):

$ adctrl
==> 4. Tell manager that a worker failed its job
==> 3. Tell worker to quit
==> 6. Restart a worker on the current machine. (Otherwise, worker keeps staying in "Assigned")

2.  A worker stuck in "Failed" status.  How to stop the worker and skip this program?

Worker  Code      Context             Filename           Status
----------  --------  ----------------------  -------------------  --------------
       3  Done   AutoPatch R120     EGOSILDU.sql   Failed

$ adctrl
==> 8    (Note: 8 is NOT listed on the menu)
 
       Now, the status becomes:
       3  Done  AutoPatch R120     EGOSILDU.sql    Skip & restart

==> 6. Restart a worker on the current machine

In another case, after I manually uploaded a failed workflow file to database (Doc ID 2581597.1), I used adcrtl to continue the adpatch session:

Worker  Code      Context             Filename           Status
----------  --------  ----------------------  -------------------  --------------
     2  Run       AutoPatch R120     POSSPAPM.wft     FAILED

==> 8
Enter the worker number(s)/range(s) or 'all' for all workers,
or press [Return] to go back to the menu : 2

Status changed to 'Skip & restart' for worker 2.
Review the messages above, then press [Return] to continue.


Once above steps in adctrl were done, adpatch automatically continued to next jobs.

3.  How to re-start "adpatch" from scratch?

Sometimes, you have to start adpatch again to clean all memories kept in previous run, such as change of a schema password in the middle of adpatch session. Even using "3. Tell worker to quit" on all workers, adpatch will still run on OS level. You have to use "kill -9" to stop it.

No comments: