Friday, August 12, 2011

Cleanup DataStage Job Log without Director

DataStage Jobs logs are visible via DataStage Director. It is a client requires a windows machine. Same is being used to clean / purge the logs. So in production System enterprises don't want to provide access to any windows machine and want to access Server directly to clear the logs. We can follow following steps to achieve this.
To Clear / access any Job we need to find its ID to start with. As Jobs Details stored in RT_<DETAIL><JOBID>. It can be retrieved via following mechanism.

/opt/IBM/InformationServer/Server/Projects/dstage1>
$DSHOME/bin/uvsh  "SELECT JOBNO FROM DS_JOBS WHERE NAME='Test_ETLINFO';"
This will provide Job Number like
No...
82
1 records listed.

Instead of Test_ETLINFO(Job Name) can pass Parameter like '%JOBNAME%' ( "SELECT JOBNO FROM DS_JOBS WHERE NAME='%JOBNAME%';" or can loop around and create a text file and then process them later.

The above Job ID can be used to Clear the log mentioned below
clear.file RT_LOG82 (It can be used like clear.file RT_LOG%JOBNO% and pass Job No as Parameter.)
Above steps can be added into a Script and can be used from anywhere. Only requirement is user need to have access and permissions to clear the logs.

-Ritesh 
Disclaimer: The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions

No comments:

Post a Comment