Re: Local Database and $DBPATH
Posted in 1998
Richard Spitz wrote:
>
> Hi Informixers,
>
> how can I influence the way the DBPATH environment variable is evaluated
> for database access?
>
> We are currently running Online/Star and SE/Net 5.10 concurrently on
> the same machine. I know that the SQLEXEC variable will determine
> whether the Online or SE backend is used.
>
> Now a developer wants to use more or less identical Online databases on
> the local or a remote server. I explained to her that a local database
> will always have preference over the DBPATH, and that the only way
> to get access to the remote database without fully qualifying its
> path in the DATABASE statement is to define SQLEXEC as "sqlexec" and
> then defining DBPATH as "//DBSERVER". But she managed to have a
> "database.dbs" in her working directory which again screwed things up :-(
>
> So now my only hope is that Online 5.10 can somehow be brought to NOT
> access a local database when DBPATH tells it to use a remote server.
> Somehow like the PATH variable is interpreted by modern UNIXes so if
> "." is not in the PATH the local directory will not be used. Am I
> only dreaming?
Actually online 6.xx & 7.xx applications use the old DBPATH variable as
a search path for databases but the engine connection is made depending
on the environment variable INFORMIXSERVER. If this is the name of the
local server then the initial connection is made to the local engine
and access to remote databases, whether explicit (dbs@server) or
implicit (through DBPATH), is made through the communications facility
of the local engine, not directly. If the INFORMIXDIR variable names a
remote server then no connection to the local server is attempted and
the initial connection is made to the remote server over the
appropriate network interface. By 6.xx & 7.xx applications I mean
applications compiled by ESQL/C 6.xx/7.xx, the delivered 6.xx/7.xx
utilities (ie dbaccess & isql), and/or applications compiled under
I4GL/R4GL 6.xx/7.xx.
You can verify this. On the remote server run onstat -g ses and look
at the PID for the remote accesses. Run ps -fp <PID> on the client
machine. If the app is running with INFORMIXSERVER naming the local
server then the PID will be one of the oninit processes, if
INFORMIXSERVER names the remote server the PID will be the application
itself.
By the way online 6.xx & 7.xx applications DO NOT USE the SQLEXEC
variable at all! This is only used by 5.xx applications. If the 5.xx
app is running in a 7.xx environment then SQLEXEC points to sqlrm which
is the SQL Remote Module which looks like an sqlturbo process to the
older 5.xx application and translates the Online 5.xx database requests
into Online 7.xx communications/shared memory protocols for talking to
the oninit processes.
Art S. Kagel