Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313

    Unanswered: running db2look against a remote server

    Is there any way to use db2look on a client against a remote server to generate DDL for tables, etc? I would be running db2look on a Windows client.

    I looked at the cmd line args here: http://publib.boulder.ibm.com/infoce...e/r0002051.htm

    but there doesn't seem to be any way to specify the remote server name, or port, the way you would do in a OLEDB connection, for example. It does say this however:

    -i userid
    Use this option when working with a remote database. | |
    -w password
    Used with the -i option, this parameter allows the user to |run db2look against a database that resides on |a remote system. The user ID and the password are used by db2look to log on to the remote system. | |
    Note:
    If working with |remote databases, the remote database must be the same version as the local |database. The db2look utility does not have down-level |or up-level support.
    The problem is there doesn't seem to be a way to specify which remote server you want to connect to. You can specify the database with the -d flag, just not the server.

    There is the -server flag, but that's not for specifying what server to connect to, rather it's for specifying that you want certain server level stuff to be scripted:

    -server Sname
    Generates DDL statements for federated objects that apply to this server. |The federated DDL statements that might be generated include: CREATE WRAPPER, |CREATE SERVER, CREATE USER MAPPING, CREATE NICKNAME, CREATE TYPE MAPPING, |CREATE FUNCTION ... AS TEMPLATE, CREATE FUNCTION MAPPING, CREATE INDEX SPECIFICATION, |and GRANT (privileges to nicknames, servers, indexes). Only one server name |is supported; an error is returned if less than one or more than one is specified. |This option cannot be used if the -wrapper option is used.
    I am using a cmd line like this currently (for scripting a view in this case):

    Code:
    db2look.exe -d SAMPLE -e -i username -w password -z JESSE -v VEMPDPT1
    Am I missing something? Note that I am very new to DB2 so that is very likely.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You connect to the remote database first. In order to this you must:

    1. catalogue the remote tcpip node.
    2. catalogue the database to the remote node in 1 above.

    You might also be able to just attach to the instance catalogued in 1 above without connecting to a database. If you connect to a database, you are automatically attached to the instance it belongs to.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Quote Originally Posted by Marcus_A
    You connect to the remote database first. In order to this you must:

    1. catalogue the remote tcpip node.
    2. catalogue the database to the remote node in 1 above.

    You might also be able to just attach to the instance catalogued in 1 above without connecting to a database. If you connect to a database, you are automatically attached to the instance it belongs to.
    Thanks for the reply.

    Unfortunately I don't know what it means to "catalogue" the remote tcpip node. Likewise I don't understand what your step 2 means either.

    I am guessing a catalog is a mapping between a logical database name on the client and a remote server/database pair? If so then I can see how db2look might know what remote server to go to - it just looks it up in the "catalog".

    I assume this catalog lives on the client - is it a file somewhere? Or am I totally off track?

    Thanks for your patience!

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Yes, when you catalog a remote database from the client, the configuration is stored in the node directory and the database directory on the client.
    db2 list node directory
    db2 list db directory

    The catalog commands are in the Command Reference manual, or you can use the Client Configuration Assistant GUI (usually under DB2 Set-up Tools).
    Last edited by Marcus_A; 01-21-07 at 00:19.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    excellent, thanks!

Posting Permissions

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