Skip to content

3. Configuration of Database Link#

This chapter describes the configuration prerequisite to the use of Altibase Database Link.

DB Link processes in the following steps:

  1. The user requests SQL statements, including queries to be executed on the remote server, to the local server.
  2. The local query processer parses the SQL statements and prepares the queries that are to be sent to the remote server.
  3. The prepared queries are sent to AltiLinker.
  4. AltiLinker receives the queries and requests the execution of queries to the remote server. The JDBC interface is used for this step.
  5. The remote server executes the requested queries and returns the results to AltiLinker.
  6. AltiLinker sends the queried results received from the remote server to the local server. The local server converts the received data according to its purpose and uses it.

For the above third and sixth steps, only TCP connection is supported between the Altibase server and AltiLinker, and data exchange conforms to the ADLP protocol. Also, AltiLinker accesses the remote database server by using the JDBC interface. Configuration of the JDBC can differ by environment and circumstance; this chapter provides an explanation based on the Java SE 1.5 environment.


Configuration#

This section describes the JDBC settings necessary to use Altibase Database Link in the following steps:

  • Installing JRE
  • Installing the JDBC Driver
  • Configuring the AltiLinker Properties File
  • Configuring the Altibase property file

Installing JRE#

Since AltiLinker is a java application program which runs on JRE 1.5 or higher, JRE 1.5 or higher must be installed on the server on which AltiLinker is to run.

If the JDBC driver of the remote database to which AltiLinker is to connect runs on a higher version of JRE 1.5, a JRE version that is compatible with the given JDBC driver must be installed.

After installing JRE, environment variables such as JAVA_HOME and CLASSPATH must be configured. The example below configures environment variables related to JRE on UNIX-like operating systems.

$ export JAVA_HOME=<the path in which JRE in installed>
$ export CLASSPATH=${JAVA_HOME}/lib:${CLASSPATH}
$ export PATH=${JAVA_HOME}/bin:${PATH}

Installing the JDBC Driver#

To use database links, the JDBC driver must be installed on the server on which AltiLinker runs. The JDBC driver to be installed must be one provided by the remote database to be connected through a database link. For example, if the remote database is Oracle, a version of the JDBC driver which complies with the Oracle database server should be checked on the Oracle homepage, downloaded and installed. Moreover, ODBC Driver which supports XA should be installed when using 2PC(Two-Phase Commit) protocol.

Configuring the AltiLinker Properties File#

Properties necessary for connecting to the remote server, and properties related to the AltiLinker process are configured in the AltiLinker properties file.

The AltiLinker properties file exists as the dblink.conf file beneath $ALTIBASE_HOME/conf. The following properties can be specified in this file.

  • ALTILINKER_ENABLE

    To activate the AltiLinker process, the value of the ALTILINKER_ENABLE property must be set to 1.

  • ALTILINKER_PORT_NO

    The TCP listening port number can be specified in the ALTILINKER_PORT_NO property.

  • TARGETS

    The connection information necessary for AltiLinker to connect to the remote database server is specified as the following properties in the TARGETS property.

    • JDBC_DRIVER

      The absolute path of the JDBC driver file.

    • CONNECTION_URL

      The connection URL of the remote database server to be connected.

    • USER

      The user name to connect to the remote database server.

    • PASSWORD

      The user password to connect to the remote database server.

    • XADATASOURCE_CLASS_NAME

      The XADataSource class name. Altibase is located in Altibase.jdbc.driver.AltibaseXADataSource.

    • XADATASOURCE_CLASS_URL_SETTER_NAME

      It can be set as URL of XADataSource or setURL.

    NAME, JDBC_DRIVER, and CONNECTION_URL must be specified in the AltiLinker property file.

    USER and PASSWORD can be specified either in the AltiLinker property file or when creating the database link object. The remaining parameters can only be specified in the AltiLinker property file.

    The settings specified at the time of database link object creation take precedence over those in the AltiLinker property file.

    The TARGETS property can be specified in the following manner. This property can specify a multiple number of remote servers.

    TARGETS = (
      (
         NAME = "alti1"
         JDBC_DRIVER = "/home/user/altibase_home/lib/Altibase.jar"
         CONNECTION_URL = "jdbc:Altibase://127.0.0.1:20300/mydb"
         USER = "sys"
         PASSWORD = "manager"
         XADATASOURCE_CLASS_NAME= "Altibase.jdbc.driver.AltibaseXADataSource"
         XADATASOURCE_URL_SETTER_NAME = "setURL"
      ),
      (
         NAME = ..
         JDBC_DRIVER = ..
         CONNECTION_URL = ..
      )
    )
    

For more detailed information on the AltiLinker property, please refer to "Appendix A. Properties and Data Dictionary".

Configuring the Altibase property file#

In order to use Altibase Database Link, the value of the DBLINK_ENABLE property in the altibase.properties file must be set to 1.

If the Altibase server is started up after setting all properties, the AltiLinker process starts with the Altibase server process.

For more detailed information on properties related to database links, please refer to the database link-related properties of General Reference.