Solved

db2 how to connect to remote database from my

Posted on 2014-12-28
3
340 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:Kdo
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:
Kdo 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

832 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