如何在服务端查看dastage作业的JOBNO 作业目录等信息

来源:互联网 发布:exe视频加密软件 编辑:程序博客网 时间:2024/06/05 18:03

有时候在服务器上批量管理作业的时候需要知道作业的JOBNO用于清理日志,或者备份作业的时候需要知道作业的具体目录,这时候通过designer或者director来查看作业信息,工作量将会非常巨大,分享一个查找作业NO及目录的脚本

# Script Name -  DSgetJobNo.sh
# Developer   -  Atul Singh
# Description -  This script query on the Datastage UV DB 
#                and get the internal job no and catagory assigned to job
# Date        -  Feb 25, 2014
# Plateform   -  AIX,LINUX, UNIX, Solarix and all NIX

#!/bin/ksh
##!/bin/sh
 

. /opt/IBM/InformationServer/Server/DSEngine/dsenv > /dev/null 2>&1

DSProject="$1"
DSJob="$2"

if [[ -z "$DSProject" || -z "$DSJob" ]]; then
 echo "\nUsage: $0 <DSProject> <DSJob>\n"
 exit 1
fi

echo "Job Info for job(s): \"$DSJob\" in project: \"$DSProject\"..."
export DSHOME=`cat /.dshome`

cd $DSHOME
./bin/uvsh << EOF 2> /dev/null
LOGTO $DSProject
SELECT @ID FMT '80L', CATEGORY FMT '80L', JOBNO FROM DS_JOBS WHERE NAME LIKE '%$DSJob%' OR JOBNO = '$DSJob' ORDER BY NAME;
EOF