UNIX: Objectivity/SQL++ Configuration

Printer-friendly version

To configure Objectivity/SQL++, refer to the following:

Creating an Account

Create an account with the username systpe and a password of your choice. The Objectivity/SQL++ database administrator will use this account. For more information about systpe, see Objectivity/SQL++.

Setting Your OO_SQL_DIR

Set the environment variable OO_SQL_DIR to the fully qualified pathname of the Objectivity/DB installation directory (installDir). Do this for the systpe account—for example, in a startup file such as .login —and for each user that will run Interactive SQL++. Objectivity/SQL++ uses OO_SQL_DIR to find help files and error-code files.

Setting Up the ODBC Server

Objectivity/SQL++ provides an ODBC server, which enables ODBC-compliant applications to connect to a federated database. For information about the ODBC server, see "Getting Started With ODBC" in Objectivity/SQL++.

The installation and setup of the lock server varies by platform.

Linux Platforms

A default Full or Typical installation as root installs the ODBC server as a Linux init.d service that is enabled at runlevel 3 and runlevel 5. The ODBC server is also started, and will restart when the workstation reboots. To modify these settings, refer to the documentation for your Linux platform.

The ODBC service is named oosqlnw and uses TCP/IP port 1990 by default.

Other UNIX Platforms

With a default installation, the ODBC server is installed, but is not started nor is it set up to start when the system reboots.

You set up the ODBC server by:

  • Specifying a port number
  • Arranging for startup whenever the machine reboots
  • Optionally specifying a nondefault log directory

Specifying the ODBC Server’s Port Number

You must associate a port number with the Objectivity/SQL++ ODBC server so that remote ODBC-compliant applications can connect to it through the Objectivity/SQL++ ODBC Driver. To do this:

  1. Log in as root.
  2. Add the following entry to the TCP/IP services file. Typically, this file is /etc/services.
    oosqlnw                     1990/tcp        # Objectivity/SQL++ Server

    If you are using the Network Information Service (NIS), you should ask your system administrator to perform the equivalent operation for your NIS configuration.

  3. If another service already uses TCP/IP port 1990, either reassign that service to a different port (recommended) or assign a different port to the oosqlnw service.

Important: If you change the TCP/IP port for the Objectivity/SQL++ ODBC server, you must assign the same port to the oosqlnw service on each Objectivity/SQL++ ODBC Driver host.

Arranging for ODBC-Server Startup

You normally configure your workstation so that the ODBC server starts automatically whenever the machine reboots.

A running ODBC server is required for accessing Objectivity/DB federated databases with ODBC-compliant applications that use the Objectivity/SQL++ ODBC Driver. A running ODBC server is not required for using Interactive SQL++.

You must run ODBC server under the systpe account. For information about required access permissions, see "Getting Started With ODBC" in Objectivity/SQL++.

Perform the following steps when you start the ODBC server on a particular workstation for the first time:

  1. Log in as root (required for step 5).
  2. Set up a log directory for ODBC log files.
  3. Start the ODBC server to verify that it is installed properly. To start the ODBC server under the user account systpe, enter a command such as:
    su - systpe -c "installDir/bin/oosqld start"
  4. If the ODBC server does not start, check whether a port conflict exists; see Specifying the ODBC Server’s Port Number.
  5. (Optional) Configure your workstation to start the ODBC server whenever the machine reboots. To do this, edit the workstation’s startup script (usually /etc/rc.local or /etc/init.d) and add a command such as the one shown in step 3.

Setting Up a Log Directory for the ODBC Server

A running ODBC server creates log files in a log directory. By default, the ODBC server expects to write log files in the default log directory, which is /usr/spool/objy .

Note: If you are starting the ODBC server on the same host as the lock server or AMS and you created the default log directory ( /usr/spool/objy ) on that host, the ODBC server will use that directory location by default. No more steps are required if you want to use this directory.

The setup for a log directory varies by platform.

Linux Platforms

By default, a running ODBC server creates log files in /usr/spool/objy and no setup is required.

To use a different location, refer to Changing the Log Directory for the ODBC Server.

Other UNIX Platforms

Perform the following steps to set up the log directory:

  1. Log in as root.
  2. Create the /usr/spool/objy log directory.
  3. Set the log directory’s permissions to enable the ODBC server (systpe) to create and update files in this directory, and to enable all users to read and write files there. Enter:
    chmod 777 objy

To use a different location, refer to Changing the Log Directory for the ODBC Server.

Changing the Log Directory for the ODBC Server

To use a nondefault log directory:

  1. Create the directory with the appropriate permissions.
  2. Set the environment variable OO_SQL_TMP_DIR to the directory pathname before you start the ODBC server.

If you are configuring your workstation to restart the ODBC server on reboot, this environment variable must be set before the ODBC server is restarted. You can do this by editing a startup file (such as .login ) for the userName account, and adding a command to set the environment variable.

Note: The ODBC server will consult the OO_SQL_TMP_DIR environment variable before it looks for the default log directory.

For information on changing the log directory for ODBC log files, see "Getting Started With ODBC" in Objectivity/SQL++.

Testing Interactive SQL++

You can test whether the Interactive SQL++ component of Objectivity/SQL++ has been set up correctly by building and running the provided sample application. This sample application builds an Objectivity/DB federated database that is then queried through Interactive SQL++.

To build and run the Interactive SQL++ sample application:

  1. If you have not already done so, set up a default Objectivity license file.
  2. (Optional) Make a backup copy of the Interactive SQL++ sample directory.
  3. Edit the makefile in the Interactive SQL++ samples directory:
    • Set INSTALL_DIR to the location of the Objectivity/DB installation directory—for example:
      INSTALL_DIR = /opt/Objectivity/version
    • Set LS_HOST to the name of the lock-server host—for example:
      LS_HOST = myLockServerHost
  4. Edit the demo file to set passwd to be the password of the Objectivity/SQL++ administrator account (systpe) you created previously—for example:
  5. Check whether the lock server is running; start it, if necessary.
  6. Build the sample application and create the federated database. Enter:
  7. Run the sample application. Enter:

If Interactive SQL++ is set up correctly, you will see messages like these:

Creating the Objectivity/DB Database.
Running OOISQL to create views.
Running OOISQL to test out various SQL statements.
Test PASSED -- The expected results were achieved.

Note: If you want to repeat this demo, you must first make clean . However, you should not make clean if you plan to perform the Objectivity/SQL++ ODBC Driver demo, because the same federated database is used by that demo.

Preparing the ODBC Server for Testing

At some sites, a database administrator or a system administrator is responsible for installing Objectivity/SQL++, while individual users of ODBC-compliant client applications can install their own copies of the Objectivity/SQL++ ODBC Driver. If you are installing Objectivity/SQL++ at such a site, you probably need to set up the federated database and ODBC server so that other users can perform the Objectivity/SQL++ ODBC Driver demo.

To prepare for the Objectivity/SQL++ ODBC Driver demo, perform the following steps on the Objectivity/SQL++ ODBC server host:

  1. If you have not already done so, run the Interactive SQL++ demo above. Be sure to leave the lock server running.
  2. Check whether the lock server is running; start it, if necessary.
  3. Check whether the ODBC server is running; start it, if necessary. For example, if you are logged in as systpe, enter:
    oosqld start
  4. If the Objectivity/SQL++ ODBC Driver demo is to be performed by another user, give that user the TCP/IP name of the ODBC server host, the service name under which the ODBC server is running (oosqlnw), and the location and name of the boot file (installDir/samples/sql/ooisql/DEMO).
  5. Grant all access rights to all users for the tables in the demo federated database. If you omit this step, only the Objectivity/SQL++ database administrator (systpe) will have access to these tables. To grant access rights to all users:
    • Start Interactive SQL++ for the demo federated database:
      ooisql -user systpe -passwd adminpassword installDir/samples/sql/ooisql/DEMO

      Where adminpassword is the password of the Objectivity/SQL++ administrator account ( systpe ).

    • Enter the TABLE statement to obtain a list of the demo tables: table;
    • For each table listed, grant all rights to every user with a user account on the Objectivity/SQL++ ODBC server host. Enter commands such as the following: grant all on tablename to public;
    • Commit the new access rights and exit from Interactive SQL++: commit work;

Users can now perform the Objectivity/SQL++ ODBC Driver demo described in UNIX: Objectivity/SQL++ ODBC Driver Configuration. (This information can also be found in Windows: Objectivity/SQL++ ODBC Driver Configuration.)

The demo can be repeated as long as the lock server and the Objectivity/SQL++ ODBC server are both running, and the demo federated database exists.


Monday, August 20, 2012