Personal tools
You are here: Home DB2 Scripts DB2 Shell Scripts to DB2 Check parameter value from all your db´s II
Navigation
Log in


Forgot your password?
 
Document Actions

Check parameter value from all your db´s II

I encountered an issue when the Directory entry type was Remote... here is the fix. Just supply the name of the parameter when you run the script.

#!/bin/bash

declare -a array0
declare -a array1

array0=( `db2 list db directory | grep -s alias | tr -s " " | cut -d " " -f 5` )
array1=( `db2 list db directory | grep -s Directory | tr -s " " | cut -d " " -f 6` )
index=0


printf "DBNAME CURRENT DELAYED\n"

for db in "${array0[@]}"
do
   if [ "${array1[$index]}" != "Remote" ]; then
      db2 connect to $db > /dev/null
      db2 get db config show detail | grep -i $1 | awk -F= '$15=dbname {print $15 $2}' dbname=$db
      db2 connect reset > /dev/null
   fi
   ((index++))
done


exit 0
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls