Moving from Informix SE to Innovator-C
Posted in 2011
The poster wanted to move 4GL apps from Informix SE (where two same-named databases lived in different directories, selected via DBPATH) to Innovator-C 11.70, and tried running two instances by copying the onconfig file — but got "database already exists" and later error 761 (INFORMIXSERVER doesn't match DBSERVERNAME/DBSERVERALIASES). Advice was that each instance needs its own distinct DBSERVERNAME/aliases, its own sqlhosts entries and ports, plus per-instance env scripts setting INFORMIXSERVER, ONCONFIG and INFORMIXSQLHOSTS. The poster got it working after realising he also had to run oninit -i for the second instance after sourcing its environment. (One reply simply offered paid consulting help.)
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Installation, Setup & Upgrades, Storage & Space Management, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Networking & sqlhosts Configuration, Licensing & Editions, Platform-Specific Issues
I'm currently using Informix 4GL 7.50.UC4 with Informix SE 7.25.UC6R1
on Linux and I have two databases set up with the same database name,
but each in a different path, this is because the database name is
specified in the 4GL programs with the DATABASE statement. I then use
the env variable DBPATH to point 4GL to which database it should use.
I've downloaded and installed Informix Innovator-C Edition 11.70.UC2IE
which I'd like to use with the 4GL programs, but how to I do the
equivalent of using DBPATH to point to the SE .dbs directories since
IDS doesn't work this way?
During install I let the install script create an instance and
initialize the server, it created the following dbspaces
/opt/IBM/informix/db1/dbspaces/datadbs
/opt/IBM/informix/db1/dbspaces/llogdbs
/opt/IBM/informix/db1/dbspaces/plogdbs
/opt/IBM/informix/db1/dbspaces/rootdbs
/opt/IBM/informix/db1/dbspaces/sbspace
/opt/IBM/informix/db1/dbspaces/tempdbs
I then used dbaccess to create a database:
create database mydb in datadbs;
Now I want to create another database named 'mydb' which will contain
different data so I think I need to setup multiple residency on the
Innovator-C server, to do this I did:
cp etc/onconfig.db1 etc/onconfig.db2
#onconfig.db1
SERVERNUM 0
DBSERVERNAME linux_host
DBSERVERALIASES dr_linux_host
ROOTNAME rootdbs
ROOTPATH /opt/IBM/informix/db1/dbspaces/rootdbs
ROOTOFFSET 0
ROOTSIZE 200000MIRROR 0
Then I edited onconfig.db2 and changed the following
#onconfig.db2
SERVERNUM 1
DBSERVERNAME linux_host
DBSERVERALIASES dr_linux_host
ROOTNAME rootdbs02
ROOTPATH /opt/IBM/informix/db2/dbspaces/rootdbs02
ROOTOFFSET 0
ROOTSIZE 200000MIRROR 0
touch /opt/IBM/informix/db2/dbspaces/rootdbs02
chmod 660 /opt/IBM/informix/db2/dbspaces/rootdbs02
chown informix:informix /opt/IBM/informix/db2/dbspaces/rootdbs02
export ONCONFIG=onconfig.db2
oninit -i
touch /opt/IBM/informix/db2/dbspaces/datadbs02
chmod 660 /opt/IBM/informix/db2/dbspaces/datadbs02
chown informix:informix /opt/IBM/informix/db2/dbspaces/datadbs02
onspaces -c -d datadbs02 -p /opt/IBM/informix/db2/dbspaces/datadbs02 -o 0 -s 4194304
Now using dbaccess I tried to create a database with the same name
'mydb' in space datadbs02 but I got an error that it already existed.
Shouldn't $ONCONFIG specify which instance I'm using and let me create
a database with the same name in each instance?
1. You need different "DBSERVERNAME / DBSERVERALIASES" for a different ... DBSERVER.
2. You need to modify your active sqlhosts file (default $INFORMIXDIR/etc/sqlhosts) or $INFORMIXSQLHOSTS
So, for instance one you get your environment variables set (generally just "." in a file like :
File Name linux_host.env
export INFORMIXSERVER=linux_host
export INFORMIXDIR=/opt/IBM/informix
export PATH=$INFORMIXDIR/bin:$PATH
export ONCONFIG=onconfig.db1
File Name linux_host1.env
export INFORMIXSERVER=linux_host1
export INFORMIXDIR=/opt/IBM/informix
export PATH=$INFORMIXDIR/bin:$PATH
export ONCONFIG=onconfig.db2
and in your sqlhosts file you will have something like :
# Entries for db1 dbserver
linux_host onpicshm linux_host linux_host_shm
dr_linux_host onsoctcp linux_host 9799# Entries for db2 dbserver (suggest using something other than DB2 :O )
linux_host1 onpicshm linux_host linux_host1_shm
dr_linux_host1 onsoctcp linux_host 9800
To get at linux_host :
. ./linux_host1.env
To get at linux_host1 :
. ./linux_host1.env
etc. etc. etc.
Hopefully makes some sense :/
Hi - It's a "big jump" from SE to 11.7 - VERY big. The differences in the architecture and specifically in your case the dbspaces in IDS 7+ vs. the disk allocation is SE is significant. In IDS 7+ (including 11 of course), there is much more to creating database/dbspaces than just working at the "disk level" as in SE. I'd be happy to help, but a phone call would be much better since again, the overall architecture and "way things are done" is significantly different. You can reach me at 1-855-GET-IFMX, or mark@markscranton.com. Thanks! Mark Scranton The Mark Scranton Group, LLC www.markscranton.com www.marksinformix.com 1-855-GET-IFMX
On May 19, 11:04 am, Jon Ritson <JonRit...@Sky.Com> wrote:
> 1. You need different "DBSERVERNAME / DBSERVERALIASES" for a different ... DBSERVER.
>
> 2. You need to modify your active sqlhosts file (default $INFORMIXDIR/etc/sqlhosts) or $INFORMIXSQLHOSTS
>
> So, for instance one you get your environment variables set (generally just "." in a file like :
>
> File Name linux_host.env
> export INFORMIXSERVER=linux_host
> export INFORMIXDIR=/opt/IBM/informix
> export PATH=$INFORMIXDIR/bin:$PATH
> export ONCONFIG=onconfig.db1>
> File Name linux_host1.env
> export INFORMIXSERVER=linux_host1
> export INFORMIXDIR=/opt/IBM/informix
> export PATH=$INFORMIXDIR/bin:$PATH
> export ONCONFIG=onconfig.db2>
> and in your sqlhosts file you will have something like :
>
> # Entries for db1 dbserver
> linux_host onpicshm linux_host linux_host_shm
> dr_linux_host onsoctcp linux_host 9799> # Entries for db2 dbserver (suggest using something other than DB2 :O )
> linux_host1 onpicshm linux_host linux_host1_shm
> dr_linux_host1 onsoctcp linux_host 9800>
> To get at linux_host :
> . ./linux_host1.env
>
> To get at linux_host1 :
> . ./linux_host1.env
>
> etc. etc. etc.
>
> Hopefully makes some sense :/
I made the changes you suggested and it works, but in order to access
each database server I need to stop and start the db server for
example:
To get at linux_host :
. ./linux_host1.env
I can create a database using this host but to access and create a
database on the second host I first need to stop the db server with
oninit -k then...To get at linux_host1 :
. ./linux_host1.env
and then to oninit to startup the engine again.
If I don't stop and start the server when switching environment
variables I can't connect in dbaccess and it gives error 761:
INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES.
:o)
If you want more help post your :
linux_host.env
linux_host1.env
and
$INFORMIXDIR/etc/sqlhosts
"oninit -k" is not a valid command, I assume you mean "onmode -k".
Also the message should give you a pretty good clue :/
On May 19, 12:47 pm, Jon Ritson <JonRit...@Sky.Com> wrote:
> :o)
>
> If you want more help post your :
>
> linux_host.env
> linux_host1.env
> and
> $INFORMIXDIR/etc/sqlhosts
>
> "oninit -k" is not a valid command, I assume you mean "onmode -k".
>
> Also the message should give you a pretty good clue :/
Yes I meant onmode -k
#linux_host.env
INFORMIXDIR=/opt/IBM/informix
INFORMIXSERVER=linux_host
ONCONFIG=onconfig.db1
INFORMIXSQLHOSTS=/opt/IBM/informix/etc/sqlhosts.linux_host
PATH=${INFORMIXDIR}/bin:${INFORMIXDIR}/extend/krakatoa/jre/bin:${PATH}
export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH
#linux_host1.env
INFORMIXDIR=/opt/IBM/informix
INFORMIXSERVER=linux_host1
ONCONFIG=onconfig.db2
INFORMIXSQLHOSTS=/opt/IBM/informix/etc/sqlhosts.linux_host1
PATH=${INFORMIXDIR}/bin:${INFORMIXDIR}/extend/krakatoa/jre/bin:${PATH}
export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH
#sqlhosts.linux_host
linux_host onsoctcp linux_host linux_host
dr_linux_host drsoctcp linux_host dr_linux_host
#sqlhosts.linux_host1
linux_host1 onsoctcp linux_host linux_host1
dr_linux_host1 drsoctcp linux_host dr_linux_host1
#/etc/services
linux_host 9088/tcp
dr_linux_host 9089/tcp
linux_host1 9188/tcp
dr_linux_host1 9189/tcp
On May 19, 1:08 pm, loc <c320...@gmail.com> wrote:
> On May 19, 12:47 pm, Jon Ritson <JonRit...@Sky.Com> wrote:
>
> > :o)
>
> > If you want more help post your :
>
> > linux_host.env
> > linux_host1.env
> > and
> > $INFORMIXDIR/etc/sqlhosts
>
> > "oninit -k" is not a valid command, I assume you mean "onmode -k".
>
> > Also the message should give you a pretty good clue :/
>
> Yes I meant onmode -k
>
> #linux_host.env
> INFORMIXDIR=/opt/IBM/informix
> INFORMIXSERVER=linux_host
> ONCONFIG=onconfig.db1
> INFORMIXSQLHOSTS=/opt/IBM/informix/etc/sqlhosts.linux_host
> PATH=${INFORMIXDIR}/bin:${INFORMIXDIR}/extend/krakatoa/jre/bin:$> {PATH}
> export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH>
> #linux_host1.env
> INFORMIXDIR=/opt/IBM/informix
> INFORMIXSERVER=linux_host1
> ONCONFIG=onconfig.db2
> INFORMIXSQLHOSTS=/opt/IBM/informix/etc/sqlhosts.linux_host1
> PATH=${INFORMIXDIR}/bin:${INFORMIXDIR}/extend/krakatoa/jre/bin:$> {PATH}
> export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH>
> #sqlhosts.linux_host
> linux_host onsoctcp linux_host linux_host
> dr_linux_host drsoctcp linux_host dr_linux_host>
> #sqlhosts.linux_host1
> linux_host1 onsoctcp linux_host linux_host1
> dr_linux_host1 drsoctcp linux_host dr_linux_host1>
> #/etc/services
> linux_host 9088/tcp
> dr_linux_host 9089/tcp
> linux_host1 9188/tcp
> dr_linux_host1 9189/tcp
I got it working. Thanks for the help. I missed the obvious thing and
that was that I needed to do another `oninit -i' after switching
environments with `. ./linux_host1.env' :-)