You are on page 1of 25

®

IBM Software Group

Lesson 5: Client Connectivity


(DB2 on Campus Lecture Series)

Raul F. Chong
IBM Toronto Laboratory

© 2005 IBM Corporation


IBM Software Group | DB2 Information Management Software

Agenda

ƒ DB2 Directories
ƒ Setup required at the server
ƒ Setup required at the client
ƒ Other methods to setup connectivity

2
IBM Software Group | DB2 Information Management Software

Agenda

ƒ DB2 Directories
ƒ Setup required at the server
ƒ Setup required at the client
ƒ Other methods to setup connectivity

3
IBM Software Group | DB2 Information Management Software

Directories
ƒ System database directory
 list db directory

ƒ Local database directory


 list db directory on <drive/path>

ƒ Node directory
 list node directory

ƒ DCS directory
 list dcs directory

4
IBM Software Group | DB2 Information Management Software

Agenda

ƒ DB2 Directories
ƒ Setup required at the server
ƒ Setup required at the client
ƒ Other methods to setup connectivity

5
IBM Software Group | DB2 Information Management Software

I) Setup required at the server


ƒFrom the Configuration Assistant (CA) myhost.ibm.com

a) DB2COMM Instance “DB2”


Choose Configure Æ DB2 Registry

b) SVCENAME
Choose Configure Æ DBM configuration mydb1
Find “Communications” section.

Or
DB2COMM=TCPIP

ƒFrom the Control Center Port = 50000

a) DB2COMM User defined in O/S:


User ID = myuser
Right click on instance and choose “Set up communications...”
Password = mypsw

b) SVCENAME
Right click on instance and choose “Configure parameters...”
Find “Communications” section.
6
IBM Software Group | DB2 Information Management Software

Setup required at the server


Or

ƒ Manually using commands:

a) SVCENAME (service name) in DBM CFG


update dbm cfg using svcename <port # or service name>
If you use a service name, ensure to update these files:
– Linux: /etc/services
– Windows: c:\winnt\system32\drivers\etc\services
Example: db2cdb2inst1 50000/tcp

b) DB2COMM in the DB2 Registry


db2set DB2COMM=TCPIP

7
IBM Software Group | DB2 Information Management Software

Launching Configuration Assistant (CA)

Start > Programs > IBM DB2 > Set-up Tools > Configuration Assistant
8
IBM Software Group | DB2 Information Management Software

Configuration Assistant

Cataloged databases

9
IBM Software Group | DB2 Information Management Software

Verifying the DB2COMM Registry Variable

Configuration Assistant > Configure menu > DB2 Registry


10
IBM Software Group | DB2 Information Management Software

DB2COMM Registry Variable

ƒ Note: Changing this


parameter requires an
Instance re-start

11
IBM Software Group | DB2 Information Management Software

Agenda

ƒ DB2 Directories
ƒ Setup required at the server
ƒ Setup required at the client
ƒ Other methods to setup connectivity

12
IBM Software Group | DB2 Information Management Software

II) Setup required at the client


Client

Application db directory node directory


connect to mydb1
user myuser mydb1 mynode
using mypsw

Two commands to run at the client:

1) catalog tcpip node mynode


remote myhost.ibm.com server 50000

2) catalog database mydb1 at node mynode

13
IBM Software Group | DB2 Information Management Software

Putting both setups together: At the client and server


Client myhost.ibm.com

Instance “DB2”
Application db directory node directory
connect to mydb1
user myuser mydb1 mynode network
using mypsw
mydb1

Two commands to run at the client: DB2COMM=TCPIP

Port = 50000

1) catalog tcpip node mynode User defined in O/S:


User ID = myuser
remote myhost.ibm.com server 50000 Password = mypsw

2) catalog database mydb1 at node mynode

14
IBM Software Group | DB2 Information Management Software

Setup required at the client


Two commands to run at the client:

1) catalog tcpip node mynode


remote myhost.ibm.com server 50000
2) catalog database mydb1 at node mynode

OR

ƒThe Configuration Assistant ƒControl Center


- Right click on white space - From the “All databases”
- Choose “Add database using wizard...” folder, right click and choose
“Add”

15
IBM Software Group | DB2 Information Management Software

Launching the Add Database Wizard from the CA

Configuration Assistant > Selected menu > Add Database Using Wizard
16
IBM Software Group | DB2 Information Management Software

Add Database Wizard

17
IBM Software Group | DB2 Information Management Software

Caution!

ƒ The Configuration Assistant will allow you to catalog databases with


invalid hostnames, port numbers, etc.

ƒ Everything might look correct; however, when you try to connect to the
database, you will receive a connection error!

ƒ Also ensure the user ID and password you provide to connect to the
remote database is correct
 By default the authentication takes place on the DB2 server you are trying to
connect to, therefore, you must provide a user ID and password defined on
that server

18
IBM Software Group | DB2 Information Management Software

Agenda

ƒ DB2 Directories
ƒ Setup required at the server
ƒ Setup required at the client
ƒ Other methods to setup connectivity

19
IBM Software Group | DB2 Information Management Software

Search and Discover Modes

Search the Enter server


network name and
for any choose
server protocol

20
IBM Software Group | DB2 Information Management Software

Discovery by DB2 Clients

DB2 Client

Discovery Message

DB2 Server
ƒ Search and locate DB2 servers on the
network
DAS Level
DISCOVER=SEARCH

ƒ Requires the DAS to be running on the


DB2 server in order to discover databases Instance Level

DISCOVER_INST=DISABLE DISCOVER_INST=ENABLE

ƒ Can prevent or "hide" a server / database


from being discovered by setting the Database Level
appropriate DAS, Instance, and Database DISCOVER_DB=DISABLE DISCOVER_DB=ENABLE
level configuration parameters

21
IBM Software Group | DB2 Information Management Software

Client and Server Profiles

ƒ If you are configuring a large number of servers or clients, rather than


set up each one individually, you can fully set up one, export a profile
(i.e. configuration file) from it, then apply the profile to the other
clients/servers

ƒ This saves an administrator a lot of time when setting up the


environment

22
IBM Software Group | DB2 Information Management Software

Quicklab # 6 - Using the Configuration Assistant

ƒ In this Quicklab, you will use the Configuration Assistant to


catalog a database on one of your neighbor’s workstations
ƒ You can follow the same procedure to catalog a database on a
client in your own environment
ƒ Refer to the Quicklab #6 instructions

23
IBM Software Group | DB2 Information Management Software

Good references
ƒ DB2 Connectivity Cheat sheet series from developerWorks
(www7b.boulder.ibm.com/dmdd) by Raul F. Chong

24
IBM Software Group | DB2 Information Management Software

What’s Next?

Lesson 1 Installation & the DB2 editions


Lesson 2 The DB2 Environment
Lesson 3 Tools & scripting
Lesson 4 The DB2 architecture
Lesson 5 Client connectivity COMPLETED!
Lesson 6 Working with data objects

Lesson 7 Data movement


Lesson 8 Security
Lesson 9 Backup & recovery
Lesson 10 Maintenance

25

You might also like