Accessing a Remote Database on Linux and UNIX

In this example, the TimesTen Client application system is client.example.com. The client application is accessing the Server DSN database1 on the remote server system, server.example.com. The logical server name is LogicalServer. The instance name of the TimesTen installation is instance.

  1. On the server system server.example.com, use the ttStatus utility to verify that the TimesTen server is running and to verify the port number on which it is listening.

  2. Verify that the server DSN database1 exists in the system sys.odbc.ini file on server.example.com.

    There should be an entry in the sys.odbc.ini file as follows. Note that /disk1/timesten is the timesten_home.

    [database1]
    DataStore=/disk1/timesten/server/database1
  3. Create a logical server name entry for the remote TimesTen server in the ttconnect.ini file on client.example.com.

    [LogicalServer]
    Network_Address=server.example.com
    TCP_Port=6625
  4. On the client system, client.example.com, create a client DSN corresponding to the remote server DSN, database1.

    There should be an entry in the odbc.ini file as follows:

    [database1CS]
    TTC_Server=LogicalServer
    TTC_Server_DSN=database1
  5. Run the client application from the system client.example.com using the client DSN, database1CS. The example below uses the ttIsql program that is installed with TimesTen client.

    ttIsqlCS -connStr "DSN=database1CS"

The next example describes how to access a TimesTen server that is listening on a port numbered other than the default port number.

Let us consider the network address of the TimesTen server is server.example.com and the server is listening on Port 6625. The following methods can be used to connect to a server DSN:

  1. Define the logical server name LogicalServer with server.example.com as the network address and 6625 as the network port. Define Client_DSN as the client DSN with LogicalServer as the server name and Server_DSN as the server DSN. Run the command:
    ttIsqlCS -connStr "DSN=Client_DSN"
  2. Alternatively, define the logical server name logical_server with server.example.com as the network address and the default port number as the network port. Define a client DSN with LogicalServer as the server name and Server_DSN as the server DSN. Overwrite the port number in the command:
    ttIsqlCS -connStr "DSN=Client_DSN;TCP_Port=6625"
  3. Alternatively, define the server in the connection string. In this case you do not need to define a client DSN, nor a logical server name.
    ttIsqlCS -connStr "TTC_Server=server.example.com;TTC_Server_DSN=Server_DSN;TCP_Port=6625"

    See Creating and Configuring Client DSNs on Linux and UNIX for information on the creating a ttconnect.ini file. See Overview of User and System DSNs for information on the location of the proper odbc.ini file.

Testing Connections

You can test client application connections to TimesTen databases.

  1. Verify that the client system can access the server system.
  2. Run ping from the client system to see if a response is received from the server system.
  3. Verify that the TimesTen server is running on the server system.
    • Use telnet to connect to the port on which the TimesTen server is listening. For example:

      telnet server.example.com 6625
    • If you successfully connect to the TimesTen server, you see a message similar to:

      Connected to server.example.com
    • If the server system responds to a command, but TimesTen server does not, the TimesTen server may not be running. In the case of a failed connection, you see a message similar to:

      telnet: Unable to connect to remote host: Connection refused
    • Use the ttStatus utility on the server system to determine the status and port number of the TimesTen server. Generally, the TimesTen server is started at installation time. If the TimesTen server is not running, you must start it. See Modifying the TimesTen Server Attributes.

  4. Verify that the client application can connect to the database. If you cannot establish a connection to the database, check that the ttconnect.ini file contains the correct information.
  5. If the information in the ttconnect.ini file is correct, check that a server DSN corresponding to the database has been defined properly in the system sys.odbc.ini file on the host where the database resides and where the TimesTen Server is running.