Tuesday, August 31, 2010

Canceling a rollback Job

A big Rollback Job can bring the system to its knees. If your DBS setting parameter RollbackPriority is set to FALSE then it takes the priority and will not honor any rules related to CPU assignment or TASM or anything. The Rollback job runs in RUSH priority and will bring down your system. This and the ALTER statement will never honor your CPU limitation.

From TD12 I've started canceling of Rollback Job but it is made possible from V2R5.1 release. This may lead even to drop the table on which the cancel rollback is applied, so chances are to lose the data. if you've it from the back up you either can restore/copy the data from the backups.

so what causes a bad rollback?
A user submitting a DML operation which after running a while and not giving the results in the stipulated time or is taking too much time, either the user wants to abort it or wait till it finishes, if he choose to abort and this will cause a rollback on the table which takes more time to relinquish the resources.

How to avoid it?
Stop issuing the rollback or if you issued a rollback then try to cancel the rollback. I suggest in the DBS Control Record of General Fields for the column RollbackPriority set to TRUE which will nullify the rollback to be a resource hog.
For some small rollback jobs the time taken could be negligible but for some big jobs the rollback needs to finish asap so that the ETL team can load further or start loading to the same table with correct update/insert statements.

Notes:
Remember that you may want to drop the table and create a new one most of the time when you cancel a rollback job as table state could be corrupted for most of the times.
The rcvmanager utility is used to do the Job using the root password for the system assuming it is a LINUX box.

Steps to cancel a Rollback Job:
1) Log into the node using the root username and password.
2) Connect to the CNS by typing CNSTERM 6 to find where rcvmanager is? usually it is
in window 1 and press control C to come out of it and type cnsterm 1
3) type start rcvmanager and once you get the prompt for enter the command type -
list rollback tables
4) once you get the list of the rollback tables and get the tableID for the table
you need to cancel rollback.
5) your table ID is in hex vaule so makes sure you copy values before and after the
colon (:)
6) Issue the cancel rollback statement; cancel rollback on table table ID and it
prompts for the DBC password.
7) To verify the status you can issue - list cancel rollback tables to get the
Information about the rollback status, it will be in pending state.
8) Once done you can see the system performance and its speed. At times during a
rollback I observed no more logons are allowed by the database; once the rollback
cancellation all the jobs and resources come to normal behavior.

Hope this article helps to folks who fall in this situation.

1 comment:

  1. Thanks for the info.. It is really helpful. Appreciate your work!!

    ReplyDelete