Solved

db2 how to connect to remote database from my

Posted on 2014-12-28
3
346 Views
Last Modified: 2014-12-28
Hi, how to  define the remote connection in my local db2 instance running on mac, I want to connect to  a db2 database running on port 5000 on some IP address. On my local mac I have db2 instance running, and db2 prompt
0
Comment
Question by:sniger
  • 2
3 Comments
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 40520626
Hi sniger,

From the DB2 command line processor, use the CATALOG TCPIP NODE and the CATALOG DATABASE commands

  CATALOG TCPIP NODE nodename REMOTE {hostname | IP address} SERVER 50000
  CATALOG DATABASE dbname [as localname] AT NODE {nodename}

Good Luck!
Kent
0
 

Author Comment

by:sniger
ID: 40520781
So, I don't need connect command ?

How to SQL then dbname ?
0
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 500 total points
ID: 40520837
You do need the CONNECT command.  The 2 CATALOG statements (shown above) identify the server and database to your local client.  This is a 1-time thing.  The client stores the information locally so you can continue to connect to that database until you UNCATALOG it.

You then execute

  CONNECT TO localname

every time that you want to create a connection.

Good Luck!
Kent
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
OPENQUERY INSERT not recognizing linked server 12 569
the encoding configuration of DB2 V8.02 3 444
db2 timestamp 5 65
MS/SQL OpenQuery to linked DB2 Server error 3 128
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question