This is a discussion on Multiple instances within the Informix forums, part of the Database Server Software category; --> Greetings, I have been asked to setup two DB servers on the same box for development purposes. I have ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Greetings, I have been asked to setup two DB servers on the same box for development purposes. I have two questions related to multiple DB servers: 1. When "onstat -" is run, is IDS returning the status for the DB server based on the current value of the environment variable, INFORMIXSERVER? 2. What would be the best way to switch between each DB server; ie, scripts, separate user accounts which would set the appropriate environment variables to point to the proper DB server, ...? 3. Maybe a feature request would be to have onstat return the name of the DB server it is referencing? Your suggestions regarding questions 1 and 2 would be greatly appreciated. Thanks for your time. Mike Badar ESRI-Denver 1 International Court Broomfield, CO 80021-3200 303-449-7779 mbadar@esri.com www.esri.com |
| |||
| "Mike Badar" <mbadar@esri.com> wrote in message news:mailman.377.1138833674.740.informix-list@iiug.org... Greetings, I have been asked to setup two DB servers on the same box for development purposes. I have two questions related to multiple DB servers: >> 1. When "onstat -" is run, is IDS returning the status for the DB server based on the current value of the environment variable, INFORMIXSERVER? Yup. >> 2. What would be the best way to switch between each DB server; ie, scripts, separate user accounts which would set the appropriate environment variables to point to the proper DB server, ...? Just a environment variable file, say /opt/informix/V9INST3, which you source each time you want to set or change your environment. You can even set up meaningful aliases to these in your .profile, eg alias DEV='. /opt/informix/V9INST4'. >> 3. Maybe a feature request would be to have onstat return the name of the DB server it is referencing? onstat -g env, and probably others, already does. But why not just use env? |
| |||
| See commentary below, - TJG Mike Badar wrote: > Greetings, I have been asked to setup two DB servers on the same box for > development purposes. I have two questions related to multiple DB > servers: > > 1. When "onstat -" is run, is IDS returning the status for the DB server > based on the current value of the environment variable, INFORMIXSERVER? > Yes. > 2. What would be the best way to switch between each DB server; ie, > scripts, separate user accounts which would set the appropriate > environment variables to point to the proper DB server, ...? > Personally, I prefer scripts, because you should really be changing INFORMIXSERVER _and_ PATH _and_ INFORMIXDIR all at the same time. Although your mileage may vary depending on applications, etc. > 3. Maybe a feature request would be to have onstat return the name of > the DB server it is referencing? > There's always "echo ${INFORMIXSERVER}" but if you're using ksh (or, I imagine, bash), it's not terribly difficult to embed the current INFORMIXSERVER into your prompt, so you'll know what it is. > Your suggestions regarding questions 1 and 2 would be greatly > appreciated. > > Thanks for your time. > > Mike Badar > ESRI-Denver > 1 International Court > Broomfield, CO 80021-3200 > 303-449-7779 > mbadar@esri.com > www.esri.com |
| |||
| I use command prompt to see my current INFORMIXSERVER. export PS1='[$USER@$INFORMIXSERVER]' > Greetings, I have been asked to setup two DB servers on the same box for > development purposes. I have two questions related to multiple DB > servers: > > 1. When "onstat -" is run, is IDS returning the status for the DB server > based on the current value of the environment variable, INFORMIXSERVER? > > 2. What would be the best way to switch between each DB server; ie, > scripts, separate user accounts which would set the appropriate > environment variables to point to the proper DB server, ...? > > 3. Maybe a feature request would be to have onstat return the name of > the DB server it is referencing? > > Your suggestions regarding questions 1 and 2 would be greatly > appreciated. > > Thanks for your time. > > Mike Badar > ESRI-Denver > 1 International Court > Broomfield, CO 80021-3200 > 303-449-7779 > mbadar@esri.com > www.esri.com |
| ||||
| I put the following in my unix profile on the server. I use the bash shell. that way it is always available for me. #<begin insert into profile> function sett { if [ $# -ne 1 ] ; then printf "\n\nUsage: sett instance_name\n\n" 1>&2 return 1 fi if [ $(grep "^$1" $INFORMIXDIR/etc/sqlhosts | wc -l) -ge 1 ] ; then export INFORMIXSERVER=$1 export ONCONFIG=onconfig.$1 else printf "\n\n%s - is not in the sqlhosts file.\n\n" "$1" 1>&2 return 2 fi } PROMPT_COMMAND='echo -n "^[]0;$HOST[$INFORMIXSERVER]:$PWD^G"' #<end profile> It is used as "sett <instance-name>". Notice the cheat here is that my onconfig is named onconfig.<instance_name> The PROMPT_COMMAND sets the title bar of the telnet window to "<hostname>[<database_server>]:<current_directory>" This helps you quickly figure out which instance you are pointing to. ^[ is typed into the string as the esc (escape key) and ^G is control-G. This is a vt-100 command I think so you can google for them. If you can't get the heading to work correctly just set the prompt to the above without all of the escape characters. This way every prompt will show you what your current instance is. There is probably a way to set the title bar of a monitor in a more standard way with stty. Which I would be happy to hear about. |
| Thread Tools | |
| Display Modes | |
|
|