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


Forgot your password?
 
Document Actions

Update parameter value from all your db´s

Based on another script, this one can update a parameter value for all the db´s you have in a single instance. To run it, supply parameter name and value.

#!/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

for db in "${array0[@]}"
do
   if [ "${array1[$index]}" != "Remote" ]; then
      db2 connect to $db > /dev/null
      db2 update db cfg using $1 $2 immediate
      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