Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2007
    Location
    Jundiai / SP - Brasil
    Posts
    311

    Unanswered: 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://:

  2. #2
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746

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

  4. #4
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    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 http://www.dbforums.com/db2/1617102-...gin-linux.html

  5. #5
    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)

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

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

  8. #8
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  9. #9
    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 16:17.

  10. #10
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    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 02:44.

  11. #11
    Join Date
    Apr 2007
    Location
    Jundiai / SP - Brasil
    Posts
    311
    Ok, thank you for all attention!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •