This script can be run with or without any argument and provide the list of Job, item locked in DataStage environment by any user. This script will help release the locks if user doesn't locked the item.
Script Name : DSgetJobLocks.sh
Usage : ./DSgetJobLocks.sh [one or more argument]
===========================================================================
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ksh # Declares a Korn shell ############################### | |
# # | |
##!/usr/bin/sh # Declares a Bourne shell # | |
##!/usr/bin/bash # Declares a Bourne-Again shell # | |
##!/usr/bin/csh # Declares a C shell # | |
##!/usr/bin/tsh # Declares a T shell # | |
# # | |
# # | |
# SCRIPT: DSgetJobLocks.sh # | |
# AUTHOR: Atul Singh # | |
# DATE: Mar 04, 2014 # | |
# # | |
# # | |
# PLATFORM: (AIX, HP-UX, Linux, Solaris & All Nix ) # | |
# # | |
# # | |
# PURPOSE: This script optionally take arguement and provide the ites locked by # | |
# the user, if no arguement is passed if will give the locked item list for all # | |
# # | |
# # | |
# # Usage : | |
# # ./DSgetJobLocks.sh | |
# # ./DSgetJobLocks.sh atul vibha peter mahei | |
############################################################################ | |
usr="$*" | |
user=`echo "$usr" | sed 's/ /|/g'` | |
echo $user | |
DS_HOME=`. /opt/IBM/InformationServer/Server/DSEngine/dsenv` | |
cd $DS_HOME | |
echo "" | |
echo " INODE USER PROCESS LOCKED ITEM" | |
echo " NUMBER NUMBER ID BY LOCKED" | |
echo " -------- ------ ------------ -------- ---------------------------------------------" | |
if [[ -z "$user" ]];then | |
bin/list_readu |grep -v 'Active' |grep -v 'Device' |cut -b11-19,30-38,44-90 |sort -k 4.1b,4r -k 2.1b,2 | |
else | |
bin/list_readu |grep -v 'Active' |grep -v 'Device' |egrep "$user" |cut -b11-19,30-38,44-90 |sort -k 4.1b,4r -k 2.1b,2 | |
fi | |
echo "" |
Example :
a) /home/atul> ./DSgetJobLocks.sh
INODE USER PROCESS LOCKED ITEM
NUMBER NUMBER ID BY LOCKED
-------- ------ ------------ -------- ---------------------------------------------
144368 49786 15750 peter BVG02_DV&!DS.ADMIN!&
144368 54505 11031 peter BVG02_DV&!DS.ADMIN!&
144368 34129 31407 alex OPG01_T1&!DS.ADMIN!&
144368 51958 13578 alex OPG01_T1&!DS.ADMIN!&
144368 38234 27302 janisse BDW01_DV&!DS.ADMIN!&
144368 56502 9034 sandra BDW01_DV&!DS.ADMIN!&
144368 47623 17913 gopal CDI01_DV&!DS.ADMIN!&
144368 48104 17432 mahi LMP02_DV&!DS.ADMIN!&
144368 55371 10165 hari LMP02_DV&!DS.ADMIN!&
144368 57866 7670 ccms LMP02_DV&!DS.ADMIN!&
7235179 57866 7670 ccms $PROJDEF
144368 34625 30911 arun OIY01_DV&!DS.ADMIN!&
144368 64084 1452 arun OIY01_DV&!DS.ADMIN!&
144368 47409 18127 ricardo CDI01_DV&!DS.ADMIN!&
144368 60782 4754 ivan BDW01_DV&!DS.ADMIN!&
144368 60473 2863 ivan BDW01_DV&!DS.ADMIN!&
144368 53218 12318 priety LMP02_DV&!DS.ADMIN!&
7304940 53218 12318 priety LMP02_DV_default_palette.
144368 48334 17202 sergio OPG01_T1&!DS.ADMIN!&
144368 51141 14395 sergio OPG01_T1&!DS.ADMIN!&
144368 61548 3988 akash LMP02_DV&!DS.ADMIN!&
144368 35924 29612 cathy BDW01_DV&!DS.ADMIN!&
144368 39110 04404 cathy BDW01_DV&!DS.ADMIN!&
b) /home/atul> ./DSgetJobLocks.sh cathy sergio atul
INODE USER PROCESS LOCKED ITEM
NUMBER NUMBER ID BY LOCKED
-------- ------ ------------ -------- ---------------------------------------------
144368 48334 17202 sergio OPG01_T1&!DS.ADMIN!&
144368 51141 14395 sergio OPG01_T1&!DS.ADMIN!&
144368 35924 29612 cathy BDW01_DV&!DS.ADMIN!&
144368 39110 04404 cathy BDW01_DV&!DS.ADMIN!&
No comments :
Post a Comment