Before you begin to create and configure the DirectConnect server, make sure that:
The name for a valid Microsoft SQL Server account is available. This name is used as the administrator for the DirectConnect server.
The number of the unused port to be used by the DirectConnect server is available.
Creating and configuring a DirectConnect server
Start the Create Server wizard by navigating to the %SYBASE%\DC-15_0\DCWizard directory and executing the DCWizard script. The DirectConnect server creation wizard starts. Click Next.
Select ECDA Option for ODBC. Click Next.
Enter the server name for the new DirectConnect server (for example, “DCServer”) and the port number that you want the server to listen on. Click Next.
Enter the ECDA access service name that you want to use for the standby Microsoft SQL Server database, for example, my_standby_mssql_service. Click Next.
Verify the DirectConnect server information. If correct, select Create Server. Otherwise, click Back to return to the previous window and provide the correct information.
Click Next when the DirectConnect server prompts you.
When the Start DirectConnect Server (Optional) screen appears, click Finish.
If you have accidentally started the DirectConnect server, shut it down before proceeding:
%SYBASE%\DC-15_0\bin\stopsrvr -SDCServer
where DCServer is the name of the DirectConnect server.
Using a text editor, open the %SYBASE%\DC-15_0\servers\<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 Microsoft SQL Server access service that you created in step 4 using the DCWizard. Under that, set the ConnectionSpec1 parameter to the name of the Microsoft SQL Server ODBC data source you created. Make sure that the file has at minimum the following configuration lines and that the options are set as follows:
[Service Library]
{Client Interaction}
[my_standby_mssql_service]
{ACS Required}
ConnectionSpec1=my_standby_mssql_datasource
{Client Interaction}
EnableAtStartup=yes
TransactionMode=long
TransactionMode=long indicates
that the client session will manually issue the commit command
for transactions.
Save the file.
Start the DirectConnect server:
Open a command window, and navigate to the DirectConnect installation directory. For example:
cd %SYBASE%\DC-15_0
Execute the DC_SYBASE.bat script to set the DirectConnect environment variables.
Navigate to the DirectConnect bin directory:
cd bin
Start the DirectConnect server. This also starts all of the configured access services:
DCStart -SDCServer
where DCServer is the name of the DirectConnect server.
Wait until the DirectConnect server indicates that it is ready for connections before proceeding to the next step.
To verify that you can connect to Microsoft SQL
Server
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 executing the %SYBASE%\DC_SYBASE.bat file.
Use the Sybase isql utility to log in to Microsoft SQL Server through the DirectConnect service:
isql –Uvaliduser –Ppassword –Smy_standby_mssql_service
Here, validuser and password are any valid user and password, and my_standby_mssql_service is the ECDA access service name identified in the previous procedure.
If the message
Data source not found
is
returned and the data source has been entered correctly in the dcany.cfg file,
you may need to set up the data source as a user data source under
the User DSN tab of the ODBC Data Source Administrator instead of
the System DSN tab. To do this, stop the DirectConnect server and
return to “Configuring the Microsoft SQL Server ODBC driver”.
Verify the connection to the standby Microsoft SQL Server database by obtaining the DBMS name and version number:
select @@sqldbmsname
go
SQLDbmsName
---------------------
Microsoft SQL Server
select @@sqldbmsver
go
SQLDbmsVer
---------------------
09.00.1399
Exit the isql session with the quit command.