Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

$DB2INSTANCE when connecting to remote server

288 views
Skip to first unread message

John Cartwright

unread,
Mar 20, 2001, 1:48:31 PM3/20/01
to
Hello All,

I am trying to use the "db2" command-line client on Linux to connect to
a UDB7.1 server running on a remote NT machine.

At startup I get an error message:
SQL10007N Message "-1390" could not be retrieved. Reason code: "1".

This reference for this code leads me to believe that the DB2INSTANCE
variable must be set. The question is what should this be set to in the
case of connecting to a remote machine?

Any help is much appreciated!

-- john

===============================================================================
John Cartwright
Professional Research Assistant / Associate Scientist
CIRES, SEG/NGDC/NOAA
(303) 497-6284
jcart...@ngdc.noaa.gov
===============================================================================

susa...@starhawk.torolab.ibm.com

unread,
Mar 20, 2001, 2:24:53 PM3/20/01
to
In article <3AB7A5FF...@ngdc.noaa.gov>,

John Cartwright <jcart...@ngdc.noaa.gov> wrote:
>Hello All,
>
>I am trying to use the "db2" command-line client on Linux to connect to
>a UDB7.1 server running on a remote NT machine.
>
>At startup I get an error message:
>SQL10007N Message "-1390" could not be retrieved. Reason code: "1".
>
>This reference for this code leads me to believe that the DB2INSTANCE
>variable must be set. The question is what should this be set to in the
>case of connecting to a remote machine?

It should be set to the userid of the instance on the client machine
(and yes, you have to create an instance on the client machine, but it
can be a client instance).

WW

--
Susan Williams
Technical Lead, DB2 on Linux
susa...@vnet.ibm.com

Darin McBride

unread,
Mar 20, 2001, 9:14:26 PM3/20/01
to
On Tue, 20 Mar 2001 11:48:31 -0700, John Cartwright wrote:

>I am trying to use the "db2" command-line client on Linux to connect to
>a UDB7.1 server running on a remote NT machine.
>
>At startup I get an error message:
>SQL10007N Message "-1390" could not be retrieved. Reason code: "1".
>
>This reference for this code leads me to believe that the DB2INSTANCE
>variable must be set. The question is what should this be set to in the
>case of connecting to a remote machine?
>
>Any help is much appreciated!

DB2INSTANCE isn't the only thing missing, most likely. You should source the
sqllib/db2profile of the instance on the client.

If your instance is 'db2inst1' (the default on Linux), you should do the
following:

# Bourne shell derivitives - ksh, bash, etc.:
. ~db2inst1/sqllib/db2profile
# C shell derivitives - csh, etc.:
source ~db2inst1/sqllib/db2cshrc

Hope this helps!


John Cartwright

unread,
Mar 21, 2001, 12:51:41 PM3/21/01
to susa...@starhawk.torolab.ibm.com
Susan,

thanks for your help. I had not understood that an "instance" was
required even on client-only machines. I went back and re-installed the
client and created and instance using my username and set the
DB2INSTANCE variable. "db2" now starts up fine, however it is still not
clear to me how I specify that I want to connect to a database on a
remote machine. Is this done through the CONNECT statement or set
somehow in a environment variable?

Thanks again!

-- john

--

Larry Menard

unread,
Mar 21, 2001, 1:20:45 PM3/21/01
to
John, it's all in how you 'catalog' the database on the client.

> db2 catalog tcpip node myserver remote ...
> db2 catalog database dbalias on node myserver ...

From then on, you simply "db2 connect to dbalias"... the CONNECT command doesn't
know or care if the database is local or remote.

John Cartwright wrote:

--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of all things Natural


John Cartwright

unread,
Mar 21, 2001, 2:29:37 PM3/21/01
to susa...@vnet.ibm.com
Problem solved and thanks to all. I finally found the information I
needed and cataloged the node and database. I can now connect to my
remote database.

-- john

0 new messages