If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Linux client - how configure ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-10, 13:48
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Linux client - how configure ?

Hi !

I'm DBA Informix and new to DB2 , so sorry for the silly question.

I install the DB2 client here (v9.7fp2_linuxia32_client.tar.gz), and during the instalation I don't configure any instance.

Now obvious (for me) , any command what I try to execute don't work because don't have the variables defined and isn't create the directory "sqllib" for any user .
What I deduce , is missing is the profile definition (db2profile). But, how create it??? If any command works...

Code:
root@note-cim:/opt/ibm/db2/V9.7/bin# ./db2
SQL10007N Message "-1390" could not be retrieved.  Reason code: "3".

root@note-cim:/opt/ibm/db2/V9.7/bin# ./db2ca
./db2ca: line 15: db2javit: command not found

root@note-cim:/opt/ibm/db2/V9.7/bin# ./db2cc
./db2cc: line 26: db2javit: command not found

root@note-cim:/opt/ibm/db2/V9.7/bin# ./db2help
cat: ./ctrl/.instuse: No such file or directory
./db2help: line 93: /bin/db2langdir: No such file or directory
./db2help: line 332: db2set: command not found
./db2help: line 335: db2set: command not found
./db2help: line 340: db2set: command not found
./db2help: line 343: db2set: command not found
/usr/bin/firefox http://:
Reply With Quote
  #2 (permalink)  
Old 06-24-10, 01:52
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Reply With Quote
  #3 (permalink)  
Old 06-24-10, 07:23
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Hi,
Thanks for the link, but don't help...
My problem is before reach this steps... I could not execute the "db2" command....
Reply With Quote
  #4 (permalink)  
Old 06-24-10, 08:04
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Quote:
Originally Posted by ceinma View Post
during the instalation I don't configure any instance
That is correct
You never create an instance on a client.
What you do is catatalog tcpip nodes & databases.

But you'r not there yet. Please read this How to automaticaly execute db2profile after user login on Linux?
Reply With Quote
  #5 (permalink)  
Old 06-24-10, 09:31
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Thank you!

Is exactly this the problem. Run the "db2icrt -s client <instance>"

My problem is the misunderstand the concept of "client instance" on DB2... for who incoming from Informix this is a little odd...

I read the DB2 Client Installation before and see this command, but before this messages here, I don't understand the need of create a "instance" for client too...

Just a question about this "client instance".
For Linux/Unix environment, we need create a user for each "client instance".
On Windows client... how this works? I already installed and see the directory sqllib on the "Program FIles" what isn't specific from any user...

I'm looking on the manuals an explanation about this concepts but not found anything yet... (easy to understand)
Reply With Quote
  #6 (permalink)  
Old 06-24-10, 12:37
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
You do not need to create a client instance if you installed the client code.

On Linux/Unix, the DB2 instance is installed by default to the home directory of the instance owner. In acutally, most of the files are symbolic links to the code install directory (such as /opt/ibm/db2/V9.7...).

Any local user can use the instance if they execute the db2profile file in the home directory of the instance owner (this allows a local user to access different instances by executing different profiles). Remote TCP/IP users don't have to worry about this as they connect directly to the DB2 service port for that instance with the database name and credentials.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #7 (permalink)  
Old 06-24-10, 12:58
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Ok, let's see if I understand .... please correct me if something don't make sense.

For applications what connect to a database on a remote machine (TCP/IP):
- They use the driver installed locally.
- The own application configure the connection , for example, like string connection from a .net or java code,
- The Client instance don't need exist's (I mean, create a user instance, sqllib directory and db2profile script).
- Don't need to catalog the node and database with "db2" command or "db2ca"
- In this situations, how define the environment variables on client? (db2instance, ld_library_path, path, etc). Have some script or must be manually?

If I want to access from a remote client using the "db2", "db2cli" or any other db2 command tool:
- Need to create a client instance (create user, execute db2icrt)
- Execute the profile (db2profile)
- Catalog the node and database for use.
- Then will be possible execute any connection (just a test connection for example).

Have any other situation what need to create a client instance on a remote client and catalog the node/database?
Reply With Quote
  #8 (permalink)  
Old 06-24-10, 14:14
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I am a little confused about what you need.

If you istall the DB2 client only, the client instance is automatically created during the install.

If you install a DB2 Server, as soon as you create a database server instance, it includes the client software needed to connect remotely to another server or instance (and database) via TCP/IP, or a database within the local instance.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #9 (permalink)  
Old 06-24-10, 15:12
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Question

Hi Marcus,

Thanks a lot for your attention.

My objective here is
- Understand the concept of how works the db2 client configuration (Linux and windows)
- How configure manually it... not using the wizard (I don't like wizards.. and on my environment will be very common install and configure clients without graphical option (slow ssh connections, without XDMCP forward)

If you check my first message, I don't configure the instance on the wizard installation. So because that, after I could not have any profile to set and test a connection to database...

My definitions about how the client works in my last post, are correct???

Just a note , I'm always think like as "client machine" where the "database server" is on other machine....

Last edited by ceinma; 06-24-10 at 15:17.
Reply With Quote
  #10 (permalink)  
Old 06-25-10, 01:39
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
In my words:
When you access a remote DB2 from java you do not need to install anything: the JDBC type 4 is enough.
When you access a remote DB2 with CLI and/or ODBC you need to install (at least) the db2-client package.

Lets suppose that your databaseserver is at 192.168.0.100, the instance is called "db2inst1" (you use the default port 50000) and the database is called "sample". This is pretty standard in DB2land.

is your client windows? never use the "cmd" window, use "db2cmd" instead

From the client you must first make contact to the instance, so you type:
Code:
db2 catalog tcpip node dbservI remote 192.168.0.100 server 50000
Now you can perform your 1st test, type:
Code:
db2 attach to  dbservI user db2inst1
you will be prompted for the password of the db2inst1 user.
If that was successful type:
Code:
db2 catalog database sample at node dbservI
Now you can perform your 2nd test, type:
Code:
db2 connect to sample user db2inst1
you will be prompted for the password of the db2inst1 user.
If that was successful and your client is windows you can optionally type:
Code:
db2 catalog system odbc data source sample
Now you should be able to access the database thru ODBC
Please understand that the "dbservI" on your client is now an alias for the "db2inst1" on the databaseserver .

That's basically all. Want deeper? Google for "db2cli.ini"

Last edited by dr_te_z; 06-25-10 at 01:44.
Reply With Quote
  #11 (permalink)  
Old 06-25-10, 13:55
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
Ok, thank you for all attention!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On