Friday, February 4, 2011

DS - Deadlock daemon to clear unused locks

Q: How to use the deadlock daemon to clear unused locks in InfoSphere DataStage
Answer:Locks are used by DataStage to guarantee the integrity of objects while they are being used. Locks prevent multiple processes to update the same object at the same time (for example when 2 users try to edit the same job concurrently). Under normal circumstances DataStage cleans the locks when they are no longer necessary but there might be scenarios when locks are not removed properly (for example when a network connection is abruptly closed). When that happens DataStage might keep unneeded locks, which in turn might cause problems.

DataStage has a tool that helps you to automatically clear these locks and is called the deadlock daemon (dsdlockd). This service can be configured to run with certain frequency and removed the locks that are no longer needed.

The deadlock daemon checks all DataStage locks and makes sure that all of them are associated to existing processes running. If a lock exists but the process that was using the lock no longer exists then the lock is removed.

There are different ways of using the deadlock daemon:
1. If you want to start this daemon automatically when the DataStage Engine
starts then edit the file $DSHOME/dsdlockd.config. For security reasons, don't forget to make a copy of this file before you change it.

Open the file and set the parameter "start "to 1 and to define how often the deadlock daemon will check for unused locks use the parameter "timer". This is value is set in seconds.

For example:
start=1
timer=3600
will start the daemon with DataStage and then it will check for unused locks every hour.

2. If the deadlock daemon is not running and you want to manually start it then go to $DSHOME source the dsenv file and then run bin/dsdlockd -config The parameter -config forces the program to read the $DSHOME/dsdlockd.config and use the parameter timer to define how often to check for unused locks.
If the parameter -config is omitted it will check every 60 seconds.

To stop the daemon you can run
bin/dsdlockd -stop

3. If the deadlock daemon is not running and you want to run only once you can use the parameter -p, for example:
bin/dsdlockd -p

This way the daemon will only check for unused locks once and then will stop automatically.

Note: Do not modify the other values of the dslockd.config file unless suggested by IBM.

No comments:

Post a Comment