Before you begin to create and configure the DirectConnect server, make sure that:
The DB2 client has been configured as described in “Cataloging a node and a database in an IBM DB2 Universal Database client”.
The port to be used by the DirectConnect server is unused and available.
Creating and configuring a DirectConnect server
Start the Create Server wizard with the following command:
DCWizard.sh
When the Welcome Create Server Wizard window appears, click Next. The Create DirectConnect Server Options window appears.
Select the ECDA Option for ODBC option and click Next.
The Server Name and Port Information window appears.
Enter the Server Name for the new DirectConnect server and the Port Number that you want the server to “listen” on. Click Next.
The ECDA - ODBC Driver Manager Options window appears.
Select the unixODBC Driver Manager without a Driver Manager Option and click Next. The Driver Manager Information window appears.
Select the following from the browse files:
The path to the IBM DB2 Universal Database ODBC Driver file, for example:
/software/IBM/db2_08_01/lib/libdb2.so
Version 9.1 of the HP Itanium IBM DB2 Universal Database ODBC
64-bit driver has a new name (“libdb2o.so”).
The DB2 script file that must be sourced before the DirectConnect server is started. If you have customized the IBM DB2 Universal Database environment script as described in “Setting IBM DB2 Universal Database environment variables”, use the path to that script. Otherwise, use the path to the original IBM DB2 Universal Database script, either db2cshrc or db2profile.
For example, to use your customized script for C shell, enter the following:
source path/mydb2cshrc
Here, path is the full path to the directory in which you saved your customized file.
For example, to use the original IBM DB2 Universal Database script for Bourne or Korn shell, enter the following:
. path/sqllib/db2profile
Here, path is the home directory of the owner of the replicate IBM DB2 Universal Database instance.
Click Next. The DirectConnect Service Name window appears.
Enter the ECDA access service name that you want to use for this server and click Next. The ECDA Server Summary and Build window appears.
Verify the ECDA Server information that appears:
If correct, select Create Server. The Start DirectConnect server (Optional) window appears.
If incorrect, click Back to change the information.
Using a text editor, open the %SYBASE%\DC-15_0\servername\cfg\dcany.cfg file, where servername is the name of the server you created in step 3 using the DCWizard.
In the file, locate the name of the IBM DB2 Universal Database access service that you created in step 4 above using the DCWizard. Under that, set the ConnectionSpec1 parameter to the name of the IBM DB2 Universal Database ODBC data source you created. For example:
[Service Library] {Logging} LogSvcLibStatistics=0 {Client Interaction} SvclibDescription=Access Service Library for ODBC [my_udb_access_service] {ACS Required} ConnectionSpec1=my_udb_datasource_name
Start the DirectConnect server:
Navigate to the DirectConnect installation directory, for example:
cd /software/sybase/DC-15_0
Execute the DC_SYBASE.csh script to set the DirectConnect environment variables.
Navigate to the DirectConnect bin directory:
cd bin
Start the DirectConnect server in the background, which also starts all the configured access services:
DCStart -Sservername &
Here, servername is the name of the DirectConnect server.
To verify that you can connect to IBM DB2 Universal
Database
Open a command window in the $SYBASE directory of your ECDA installation.
Change to the $SYBASE/DC-15_0 directory.
Set the environment variables by sourcing the $SYBASE/DC_SYBASE.csh file.
Use the isql utility to log in to the IBM DB2 Universal Database through the DirectConnect server:
isql –Uvaliduser –Ppassword –SDCServer
Here, validuser and password are any valid user and password, and DCServer is the DirectConnect server name.
Verify the connection to the replicate IBM DB2 Universal Database:
select @@sqldbmsname
go
SQLDbmsName
---------------------
DB2/SUN
select @@sqldbmsver
go
SQLDbmsVer
---------------------
08.02.0005
Exit the isql session with the quit command.