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 > running db2look against a remote server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-07, 11:11
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
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:

Quote:
-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:

Quote:
-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.
__________________
elsasoft.org
Reply With Quote
  #2 (permalink)  
Old 01-20-07, 13:22
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 01-20-07, 19:18
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
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!
__________________
elsasoft.org
Reply With Quote
  #4 (permalink)  
Old 01-20-07, 23:01
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 01-20-07 at 23:19.
Reply With Quote
  #5 (permalink)  
Old 01-20-07, 23:19
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
excellent, thanks!
__________________
elsasoft.org
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