Skip to content

How do you handle multiple Ingres installations?

Since it is possible to have multiple copies of Ingres running on box I was wondering how people switch between them. When I worked in support we used to hand write the scripts used to set-up the Ingres environment. Nowadays, at least with the Linux RPM releases, that script is written for you and placed in a known location ~ingres. Both these things make writing a master script to interrogate your Ingres installations (or instances as some people refer to them as). Below is the script I use:

echo "Release Running Script II_SYSTEM"
echo "-------------------------------------------------------------------------------"
for i in `ls ~ingres/.ing*bash`;
do
II_SYSTEM=`grep "II_SYSTEM=" $i | sed 's/^.*=//'`
II_INSTALLATION=`II_SYSTEM=$II_SYSTEM $II_SYSTEM/ingres/bin/ingprenv| grep II_INSTALLATION | sed 's/^.*=//'`
STATUS=`ps -fe | grep ingres | grep ${II_INSTALLATION} | grep dbms | wc -l`
if [ $STATUS -ge 2 ]; then
RUNNING=`echo "Y"`
else
RUNNING=`echo "N"`
fi
alias load${II_INSTALLATION}=". ${i}"
VERSION=`cat $II_SYSTEM/ingres/version.rel`
echo $VERSION " " $RUNNING " " load${II_INSTALLATION} $II_SYSTEM
done
alias show_ingres=". ~/bin/ingres_installs"

What it does
For each of the ~ingres/.ing*bash file the script extracts the following information:

  • II_SYSTEM from the bash script
  • Using II_SYSTEM, fetches the installation code (II_INSTALLATION)
  • Checks to see there are at least two dbms processes running and prints the status, one is the dmfrcp (recovery server) the other is the real database server
  • Sets up an alias of loadXX where XX is the 2 letter installation code obtained earlier
  • Prints out the information obtained; Ingres version, running state, alias needed to access the installation and the value of II_SYSTEM

That script is invoked from .bashrc when the terminal in interactive mode (for non-interactive terminals, e.g. scp, the ingres_installs script might cause problems):

case "$-" in
*i*)
# List ingres installations and setup load aliases
. ~/bin/ingres_installs
echo
~/bin/newsig
;;
*) ;;
esac

So when I login or fire up a new terminal window I get:

Release Running Script II_SYSTEM
-------------------------------------------------------------------------------
II 9.2.0 (int.lnx/114)NPTL Y loadII /opt/Ingres/IngresII
II 9.1.0 (int.lnx/123)NPTL N loadR2 /opt/Ingres/R2
II 9.2.0 (int.lnx/118)NPTL Y loadR3 /opt/Ingres/IngresR3
~ [] [5.2.4]
09:00:11 >

So back to my original question, how do you manage multiple installations?

  • Share/Bookmark

Related Posts

blog comments powered by Disqus