Unlock Datastage Jobs using Commands


When trying to compile/copy/delete a job from DataStage Designer, an error is returned: "Unable to delete/compile/copy the item(s)...
Cannot get exclusive access to log for job "

Tech-Note (troubleshooting by Dev)

Problem(Abstract)

Attempting to delete/copy/compile a job from DataStage Designer fails with an error of the form:

Unable to delete the item(s).
Delete object for '\<path>\<jobname>' failed.
Cannot get exclusive access to log for job <jobname>

This error occurs because a lock remains on the RT_LOG file for the job.

Resolving the problem

1. Make sure the job is not running; if it is, stop it if feasible. Close the Job for Designer.
2. From DataStage Director, select the job, then Job menu -> Reset
    Try to compile/copy/delete the job again from Designer.

3. Select the Job in Datastage Director and go t0
     Menu => Job => Cleanup Resources /Clear Status File

If the delete still fails, manually delete the lock from uvsh per the following instructions. In the commands below, '$' is the OS prompt, '>' is the uvsh prompt (i.e. you do not type them).

1. cd to $DSHOME (<path_to>/IBM/InformationServer/Server/DSEngine) on the server and source the dsenv file with:
$ . ./dsenv

2. Start uvsh: 
$ bin/uvsh

NOTE: In uvsh, the Shift key is not needed to produce CAPS but is used instead to produce undercase characters -- that is, the role of the Shift key is reversed from normal. As a result, copy-and-paste behaves strangely too and probably will not be useful.
3. At the UV prompt, log on to the project (the project name is case sensitive):
> LOGTO projectname

4. To find out what the job description number:
> LIST DS_JOBS jobname

5. To list the active locks:
> LIST.READU EVERY

Check active record locks under "Item Id" column for job name or RT_CONFIG# or RT_LOG# (# matches the job description number).
* Once you find job description number and PID you can unlock the Job from Cleanup Resources option in Director using PID.
6. Write down the inode number and user number for the lock that is not a valid lock.
7. The UNLOCK command lives in UV account; to log in to that account:
> LOGTO UV

8. Then run the UNLOCK command:
> UNLOCK INODE inode# USER user# ALL

This will unlock the lock hold on this file (inode#) and hold by this user (user#) for file locks, group locks and record locks. If you want to see all the locks again, re-run LIST.READU EVERY
9. Type Q to logout of uvsh:
> Q

10. Try to Compile/Copy/delete the job again from Designer.

1 comment:

  1. I just download and use "Long Path Tool" as an alterntive, guarantees to fix your error fast and easy.

    ReplyDelete