Configuring the data sources to connect to targets  For DirectConnect for Informix (wire protocol driver)

Chapter 5: Installing DirectConnect

For DirectConnect for DB2 UDB

In the UNIX environment, the ODBC driver allows you to establish a centralized ODBC system information file that you can control. To do so, set the environment variable ODBCINI by executing the DirectConnect environment script to point to the qualified path name of the centralized file, provided by DirectConnect install. For example:

For C shell:

DC_SYBASE.csh

For Bourne or Korn shell:

DC_SYBASE.sh

Executing the script sets ODBCINI to $SYBASE/$SYBASE_ECON/odbcini.

Remember, there must be an [ODBC] section in the system information file that includes the InstallDir keyword. Be sure that the keyword value is the path to the directory $SYBASE/$SYBASE_ECON.


To define data source entries

To create and configure data source entries for DRDA, edit the odbc.ini file using the attributes in each of these categories, or sections:

Each of these sections is delimited with comments.

As you edit the odbc.ini file, be sure you have the following parameters available on your worksheet. For all others, you can accept the default or provide a value appropriate for your site.

General parameters

The following table contains the General parameters; the required parameters are indicated by an asterisk (*).

Table 5-1: General parameters for DB2 UDB

Parameter

Comments

*Driver

The fully qualified path to the driver.

*Ip address

The IP (Internet Protocol) address of the machine where the catalog tables are stored. Specify the address using the machine's numeric address (for example, 123.456.78.90) or its host name.

WARNING! For Solaris systems, use the numeric IP address, not the host name.

If you enter a host name, the driver must find this name (with the correct address assignment) in the HOSTS file on the workstation or in a DSN server.

*TcpPort

The port number that is assigned to the DB2 server on the machine where the catalog tables are stored. Specify either this port's numeric address or its service name. The default numeric port address varies, depending on the OS of the DB2 server machine. For DB2, the default may be 50000. For AS/400, the default is 446.

If you specify a service name, the driver must find this name (with the correct port assignment) in the SERVICES file on the workstation.

*Location (Required for DB2 UDB on AS/400 and z/OS only)

This field is valid only if you are connecting to a DB2 database running on z/OS or AS/400. Type the DB2 location name, using the name defined during the local DB2 installation.

NoteThis parameter is not applicable if the Database Name field is populated.

*Collection (Required for DB2 UDB on AS/400 and z/OS only)

A field that is valid only if you are connecting to a DB2 database running on z/OS or AS/400. Enter the name that identifies a group of packages that include the DirectConnect DC DB2 DRDA driver packages. The default for DB2 and AS/400 is the user ID.

NoteThis field is not applicable if the Database Name field is populated.

*Database (Required for connecting to DB2 on Windows and UNIX)

The name of the database to which you want to connect to, by default.

NoteThis parameter is not used for AS/400 and z/OS.

*IANAAppCodePage (Required for UNIX platforms)

A driver code page configuration property for the DB2 UDB driver. The following are a few examples; 3, 4, 2004, and 2250. For a complete list of the values and their descriptions, go to the following URL .

WorkArounds2

The name of the string key to allow the driver to pad the DB2 char for bit data field with spaces. The value is 131072.

After entering these parameters, use the odbct tool (see Chapter 10, “Troubleshooting,”) to test connectivity to the DirectConnect for DB2 UDB source.

Advance parameters

The default values for the Advanced parameters described in the following table should be sufficient for most DirectConnect for DB2 UDB installations.

Table 5-2: Advanced parameters for DB2 UDB

Parameter

Comments

AlternateID

A value that is substituted at connect time for the current schema. This sets the default qualifier for unqualified object names in SQL statements. If the attempt to change the current schema fails, the connection fails with "Invalid value for Alternate ID." DB2 permissions should be set to SYSADM. (Not valid for AS/400 V5R1.)

WithHold

The cursor behavior for the application used with this data source—either DB2 closes all open cursors (Delete cursors) after a commit or rollback, or leaves them open (Preserve cursors).

  • When this option is 1 (the default), the cursor behavior is Preserve. Sybase recommends this option.

  • When this option is 0, the cursor behavior is Delete.

AddStringToCreate Table

Use this parameter if you want to append the in tablespace clause to create table commands.

To define data source entries

The following table contains the Bind parameters, with the required parameters, indicated by an asterisk (*).

Table 5-3: Bind parameters for DB2 UDB

Parameters

Comments

*GrantExecute

An indicator to grant privileges on the package that you are creating.

*GrantAuthid

The ID of the person to whom the GrantExecute privileges were assigned. The default value is Grant Execute privileges on the package to PUBLIC.

*IsolationLevel

The Isolation Level method by which locks are acquired and released by the system. Valid values are:

  • ALL – prevents any other process from accessing data that your application has read or modified. All read or modified data is locked until the end of the transaction.

  • CHANGE – allows other processes to read from the database. Only modified data is locked until the end of the transaction

  • Cursor_Stability (the default) – allows other processes to change a row that your application has read if the cursor is not on the row you want to change. Prevents other processes from changing records that your application has changed until your program commits them or terminates. It prevents your program from reading a modified record that has not been committed by another process.

  • No_Commit – allows your program to read modified records even if they have not been committed by another person.

  • Repeatable_Read – prevents other processes from changing records that are read or changed by your application (including phantom records) until your program commits them or terminates. It prevents the application from reading modified records that have not been committed by another process. If your program opens the same query during a single unit of work under this isolation level, the results table will be identical to the previous table; however, it can contain updates made by your program.

*DynamicSections

The number of statements that the DB2 Wire Protocol driver package can prepare for a single user. The default is 64. This value determines the maximum cursors or dynamic statements that a single connection may have open simultaneously.

NoteFor version 12.6, packages are created automatically on the initial connection to the DB2 UDB server. The Bind utility is only needed to modify the package settings.

Use the bind20 utility included in the bin subdirectory to create packages. The bind20 utility will use the bind options defined in your DRDA DSN to configure the package and grant proper ownership. The bind20 syntax is:

bind20 db2-dsn

The utility will prompt for a DB2 user ID and password, create the packages, and then report a final status.

A separate package is not needed for each DirectConnect for DRDA access service; however, if an access service has different characteristics in its parameters that suit it for a specific solution, you can create other packages for other solutions.

The following examples identify the DSN parameters required and used for DRDA to the following targets:


Example of an odbc.ini file for DB2 UDB on AS/400

Following is an example of the contents of an odbc.ini file for DB2 UDB AS/400, with comments added:

;; DB2 Driver for DB2 UDB AS/400
;;
;; Use values from installation worksheet.
;;
;; Data Source Name
[dcdb2udbas400]
Driver=/sybase/DC-12_6/lib/MVdb220.so
IPAddress=
TcpPort=
Location=
Collection=
SecurityMechanism=0
WorkArounds2=131072
;;
;; Advanced options
;;
AddStringToCreateTable=
AlternateID=
CatalogSchema=
IsolationLevel=CURSOR_STABILITY
CharsetFor65535=0
ReportCodePageConversionErrors=0
ApplicationUsingThreads=1
UseCurrentSchema=1
WithHold=1
;;
;; Bind options - for DSNs used with bind20 utility
;;
GrantExecute=1
GrantAuthid=PUBLIC
DynamicSections=64
;;
;; Optional Failover options 
;;
LoadBalancing=0
AlternateServers=
ConnectionRetryCount=0
ConnectionRetryDelay=3

Example of an odbc.ini file for DB2 UDB on z/OS

Following is an example of the contents of an odbc.ini file for DB2 UDB on z/OS, with comments added:

;; DB2 Driver to DB2 UDB z/OS
;;
;; Use values from installation worksheet.
;;
;; Data Source Name
[dcdb2udbosz/OS]
Driver=/sybase/DC-12_6/lib/MVdb220.so
IPAddress=
TcpPort=
Location=
Collection=
SecurityMechanism=0
WorkArounds2=131072
;;
;; Advanced options
;;
AddStringToCreateTable=
AlternateID=
CatalogSchema=
IsolationLevel=CURSOR_STABILITY
CharsetFor65535=0
ReportCodePageConversionErrors=0
ApplicationUsingThreads=1
UseCurrentSchema=1
WithHold=1
;;
;; Bind options - for DSNs used with bind20 utility
;;
GrantExecute=1
GrantAuthid=PUBLIC
DynamicSections=64
;;
;; Optional Failover options 
;;
LoadBalancing=0
AlternateServers=
ConnectionRetryCount=0
ConnectionRetryDelay=3

Example of an odbc.ini file for DB2 UDB on Windows

Following is an example of the contents of an odbc.ini file for the DB2 UDB for Windows, with comments added:

;; DB2 Driver for DB2 UDB Windows
;;
;; Use values from installation worksheet.
;;
;; Data Source Name
[dcdb2udbwin]
Driver=/sybase/DC-12_6/lib/MVdb220.so
IPAddress=
TcpPort=
Database=
SecurityMechanism=0
WorkArounds2=131072
;;
;; Advanced options
;;
AddStringToCreateTable=
AlternateID=
CatalogSchema=
IsolationLevel=CURSOR_STABILITY
CharsetFor65535=0
ReportCodePageConversionErrors=0
ApplicationUsingThreads=1
UseCurrentSchema=1
WithHold=1
;;
;; Bind options - for DSNs used with bind20 utility
;;
GrantExecute=1
GrantAuthid=PUBLIC
DynamicSections=64
;;
;; Optional Failover options 
;;
LoadBalancing=0
AlternateServers=
ConnectionRetryCount=0
ConnectionRetryDelay=3

Example of an odbc.ini file for DB2 UDB on UNIX

Following is an example of the contents of an odbc.ini file for DB2 UDB on UNIX, with informational comments added:


;; DB2 Driver to DB2 UDB UNIX
;;
;; Use values from installation worksheet.
;;
;; Data Source Name
[dcdb2udbunix]
Driver=/sybase/DC-12_6/lib/MVdb220.so
IPAddress=
TcpPort=
Database=
SecurityMechanism=0
WorkArounds2=131072
;;
;; Advanced options
;;
AddStringToCreateTable=
AlternateID=
CatalogSchema=
IsolationLevel=CURSOR_STABILITY
CharsetFor65535=0
ReportCodePageConversionErrors=0
ApplicationUsingThreads=1
UseCurrentSchema=1
WithHold=1
;;
;; Bind options - for DSNs used with bind20 utility
;;
GrantExecute=1
GrantAuthid=PUBLIC
DynamicSections=64
;;
;; Optional Failover options 
;;
LoadBalancing=0
AlternateServers=
ConnectionRetryCount=0
ConnectionRetryDelay=3




Copyright © 2005. Sybase Inc. All rights reserved. For DirectConnect for Informix (wire protocol driver)

View this book as PDF