DB2/LUW – Connectivity – Day 1

Background

Experiencing database connectivity issues and so wanted to go back to the basics.

Let us review what we need to successfully connect to a DB/2 LUW Instance.

Introuduction

We will look at what we need through the Client Server Analogy.

At the Server Node, we will review configuration in terms of network protocol, port number, authentication mechanism, and which databases are currently online.

And, on the client nodes, we will review registered nodes and databases.

Server

Outline

  1. Database Manager Configuration
    • CLP
      • Get Database Manager Configuration
  2. Active Databases
    • CLP
      • List active databases

Database Manager Configuration

Database Manager Configuration File

Read Individual entries

Syntax

db2 get dbm cfg

Sample

db2 get dbm cfg | grep 'SVCE\|TCP\|authentication'

Output

 Database manager authentication        (AUTHENTICATION) = SERVER
 Alternate authentication           (ALTERNATE_AUTH_ENC) = NOT_SPECIFIED
 Trusted client authentication          (TRUST_CLNTAUTH) = CLIENT
 Bypass federated authentication            (FED_NOAUTH) = NO
 TCP/IP Service name                          (SVCENAME) = 60000
 SSL service name                         (SSL_SVCENAME) =

Explanation
  1. Database Manager Authentication
    • Server
      • Authentication happens on the server
  2. Trusted Client authentication
    • trust_clntauth – Trusted clients authentication configuration parameter
      Link
      This parameter specifies whether a trusted client is authenticated at the server or the client when the client provides a userid and password combination for a connection. This parameter (and trust_allclnts) is only active if the authentication parameter is set to CLIENT. If a user ID and password are not provided, the client is assumed to have validated the user, and no further validation is performed at the server
  3. TCP/IP Service Name
    • Service name or Port Number
      • 60000
  4. SSL Service Name
    • Is SSL On ?

Active databases

CLP

List active databases

Syntax

db2 list active databases

Output
Output #1

Database name                    = Inventory
Applications connected currently = 318
Database path                    = /data/db2/dbdir/db2inst1/NODE0000/SQL00001/MEMBER0000/

Client

Outline

  1. Node Configuration
    • CLP
      • List Node Configuration
  2. Database Configuration
    • CLP
      • List database configuration

Node Configuration

CLP

List Node Configuration

Syntax

db2 list node directory

Output

$ db2 list node directory

 Node Directory

 Number of entries in the directory = 4

Node 1 entry:

 Node name                      = DEV1
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = dwd01
 Service name                   = 50001

Node 2 entry:

 Node name                      = DEV2
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = dwd02
 Service name                   = 50001

Node 3 entry:

 Node name                      = EASDEV
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = db2-d01
 Service name                   = 60000

Node 4 entry:

 Node name                      = FILENET
 Comment                        =
 Directory entry type           = LOCAL
 Protocol                       = TCPIP
 Hostname                       = fndbd02
 Service name                   = 60000

Explanation
  1. Node Name
    • Alias
  2. Directory Entry Type
    • Type of entry
      • Local
        • Locally registered
        • Local node directory file
      • LDAP
        • LDAP registered
        • LDAP means the entry is found on the LDAP server or LDAP cache.
  3. Protocol
    • Network Protocol
      • TCPIP
  4. Hostname
    • Applicability
      • Actual network host or computer
      • DNS Alias
  5. Service name
    • Port Number
      • Applicability
        • If Numeric
          • Actual Port Number
        • If Alpha-numeric
          • On Linux
            • Please Check /etc/services file

Database Configuration

CLP

List Database Configuration

Syntax

db2 list database directory

Output

$ db2 list database directory

 System Database Directory

 Number of entries in the directory = 2

Database 1 entry:

 Database alias                       = XMETA
 Database name                        = XMETA
 Local database directory             = /data/db2/dbdir/xmeta
 Database release level               = 10.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

Database 2 entry:

 Database alias                       = NEXUS
 Database name                        = NEXUS
 Node name                            = FILENET
 Database release level               = 10.00
 Comment                              =
 Directory entry type                 = Remote
 Catalog database partition number    = -1
 Alternate server hostname            =
 Alternate server port number         =

Explanation
  1. Database Alias
    • Alias name assigned to database
  2. Database Name
    • Alias
  3. Node Name
    • Node name registered
  4. Database release level
    • Sample
      • 10.00
  5. Comment
  6. Directory Entry Type
    • Entries
      • A Remote entry describes a database that resides on another node.
      • An Indirect entry describes a database that is local. Databases that reside on the same node as the system database directory are thought to indirectly reference the home entry (to a local database directory), and are considered indirect entries.
      • A Home entry indicates that the database directory is on the same path as the local database directory.
      • An LDAP entry indicates that the database location information is stored on an LDAP server.
  7. Catalog database partition number
    • Specifies which node is the catalog database partition. This is the database partition on which the CREATE DATABASE command was issued.
  8. Alternate server hostname
    • failover
  9. Alternate server port number
    • failover

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s