download

Matakuliah
Tahun
: T0413
: 2009
Client Connectivity
Pertemuan 5
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
Bina Nusantara University
3
I) Setup required at the server
From the Configuration Assistant (CA)
a) DB2COMM
myhost.ibm.com
Instance “DB2”
Choose Configure  DB2 Registry
b) SVCENAME
Choose Configure  DBM configuration
Find “Communications” section.
Or
mydb1
From the Control Center
a) DB2COMM
Right click on instance and choose “Set up communications...”
b) SVCENAME
Right click on instance and choose “Configure parameters...”
Find “Communications” section.
Bina Nusantara University
DB2COMM=TCPIP
Port = 50000
User defined in O/S:
User ID = myuser
Password = mypsw
4
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
Bina Nusantara University
5
Launching Configuration Assistant (CA)
Start > Programs > IBM DB2 > Set-up Tools > Configuration Assistant
Bina Nusantara University
6
Configuration Assistant
Cataloged databases
Bina Nusantara University
7
Verifying the DB2COMM Registry Variable
Bina Nusantara University
Configuration Assistant > Configure menu > DB2 Registry
8
DB2COMM Registry Variable
• Note: Changing
this parameter
requires an
Instance re-start
Bina Nusantara University
9
II) Setup required at the client
Client
Application
connect to mydb1
user myuser
using mypsw
db directory
node directory
mydb1
mynode
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
Bina Nusantara University
10
Putting both setups together: At the client and server
myhost.ibm.com
Client
Application
connect to mydb1
user myuser
using mypsw
db directory
node directory
mydb1
mynode
Instance “DB2”
network
Two commands to run at the client:
mydb1
DB2COMM=TCPIP
Port = 50000
1) catalog tcpip node mynode
remote myhost.ibm.com server 50000
2) catalog database mydb1 at node mynode
Bina Nusantara University
User defined in O/S:
User ID = myuser
Password = mypsw
11
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
- Choose “Add database using wizard...”
- From the “All databases”
folder, right click and choose
“Add”
Bina Nusantara University
12
Launching the Add Database Wizard from the CA
Configuration Assistant > Selected menu > Add Database Using Wizard
Bina Nusantara University
13
Add Database Wizard
Bina Nusantara University
14
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
Bina Nusantara University
15
Search and Known methods (Discovery Mode)
Search the
network
for any
server
Bina Nusantara University
Enter server
name and
choose
protocol
16
Discovery by DB2 Clients
DB2 Client
• Search and locate DB2 servers on
the network
Discovery Message
• Requires the DAS to be running
on the DB2 server in order to
discover databases
• Can prevent or "hide" a server /
database from being discovered
by setting the appropriate DAS,
Instance, and Database level
configuration parameters
Bina Nusantara University
DB2 Server
DAS Level
DISCOVER=SEARCH
Instance Level
DISCOVER_INST=DISABLE
DISCOVER_INST=ENABLE
Database Level
DISCOVER_DB=DISABLE
DISCOVER_DB=ENABLE
17
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
Bina Nusantara University
18