Unix Technical Forum

Multiple instances

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 11:26 AM
Mike Badar
 
Posts: n/a
Default Multiple instances

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 11:26 AM
Neil Truby
 
Posts: n/a
Default Re: Multiple instances

"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?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 11:26 AM
Thomas J. Girsch
 
Posts: n/a
Default Re: Multiple instances

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 11:26 AM
Superboer
 
Posts: n/a
Default Re: Multiple instances

please do not forget ONCONFIG.

Superboer.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2008, 11:26 AM
SaltTan
 
Posts: n/a
Default Re: Multiple instances

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-20-2008, 11:27 AM
bozon
 
Posts: n/a
Default Re: Multiple instances

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com