Close menu

SQL/R A.03.00 Installation on Linux

This document contains installation instructions specific to the Linux platform.

Supported Linux releases

SQL/R is not distribution specific, however it was only tested against selected SUSE Linux and RedHat Linux distributions. Other Linux distributions are expected to work but have not been tested and may require additional manual configuration steps after installation if the distribution does not implement LSB compatibility.

The following prerequisites must be met:

Installation directory

The SQL/R A.03.00 software is installed in the "/opt/sqlr2/" directory. The SQL/R configuration files are installed in the "/etc/opt/sqlr2/" directory.

A previous SQL/R release is replaced when updating to SQL/R A.03.00. The installation procedure retains the configuration of a previous SQL/R release.

Installation

SQL/R is available as an RPM package. SQL/R packages are also released in the deb format for use by Debian and derived distributions.

The preferred option for installation on the Linux platform is to use the package repository. For simplicity, the release directory is shared with Eloquence. Using a repository will resolve any package dependencies and also make it easy to install updates once available. Depending on the Linux distribution, yum/dnf, zypper or apt is used.

Please refer to the Red Hat, SUSE and Debian/Ubuntu notes how to install SQL/R from a package repository.

The SQL/R package file may also be downloaded and installed separately. This may be required if the system has no connection to the Internet.

Installing the RPM archive

Different builds of the SQL/R software are available. Please choose the appropriate version that corresponds with your system:

SQLR-A03XX-*.x86_64.rpm
SQL/R rpm file (x86_64, 64 bit)
This build requires a 64 bit OS running on AMD64/EM64T (x86_64) based systems. Includes support for 32 bit x86 applications.

SQLR-A03XX-*.i686.rpm
SQL/R rpm file (x86, 32 bit). This build does not include any 64 bit support and should not be installed on 64 bit operating systems.

SQLR.A03XX-*.ia64.rpm
SQL/R rpm file (Itanium2, 64 bit). Includes support for 32 bit x86 applications.
Please note that Linux on Itanium is only supported as a legacy build as the Itanium platform is no longer supported by current Linux distributions.

The asterisk (*) denotes the version of the RPM archive. Higher numbers indicate a newer installation archive.

Installing the RPM archive

To install SQL/R execute the command below. This example uses the 64 bit x86_64 build.
rpm -i SQLR-A0300-*.x86_64.rpm

systemd is used preferably to manage the SQL/R sqlrodbc service. This is used for new installations if the file /etc/init.d/sqlr2 is not present during installation or update. Otherwise any existing SYSV start/stop scripts are retained.

Installation of automatic startup of SQL/R servers during boot is only performed for SUSE, RedHat, Debian or LSB compliant distributions. If using another Linux distribution, the startup and shutdown scripts need to be added manually. Template files are provided in the directory /opt/sqlr2/newconfig/startup.

Automatic startup of SQL/R server processes during system boot is configured with systemd

systemctl enable sqlr2.service
with the system/V scripts the /etc/sysconfig/sqlr2 configuration file is used.

Updating from a previous SQL/R release

A previous SQL/R release is replaced when updating to SQL/R A.03.00. The configuration of a previous SQL/R release is retained.

To update an existing SQL/R installation, please shut down SQL/R using the command below:

systemctl stop sqlr2
- or -
/etc/init.d/sqlr2 stop
Then update the RPM archive.
rpm -U SQLR-A0321-2.x86_64.rpm
If necessary, update the license key. After the update has finished SQL/R can be started with the command below:
systemctl start sqlr2
- or -
/etc/init.d/sqlr2 start

Automatic startup of SQL/R server processes during system boot is configured with systemd (systemctl enable sqlr2.service) or using the /etc/sysconfig/sqlr2 configuration file.

Uninstalling SQL/R A.03.00

To uninstall SQL/R A.03.00 from your system, please make sure the software is not currently used. The following command may be used to shut down the SQL/R background processes.
systemctl stop sqlr2
- or -
/etc/init.d/sqlr2 stop
The software is removed using the rpm utility. Please login as root and execute rpm as below
rpm -e SQLR
Please note that any modified configuration files (typically customized configuration files) are not removed. If necessary they need to be removed manually.


Red Hat (Fedora/RHEL/CentOS) specific notes

For RedHat or compatible distributions yum is used to manage packages. For Fedora 22 (or newer) the dnf command is used instead of yum.

Installation using the package repository
The recommended installation procedure uses a shared repository with Eloquence to install and update the SQL/R release. The procedure below adds the Eloquence repository, imports the package signing key and installs the most recent SQL/R version.

Add the repository

yum-config-manager --add-repo \
    https://marxmeier.com/download/repo/rpm/eloquence.repo
SQL/R uses a distinctive beta release repository. Please use the sqlr-beta.repo instead to subscribe to SQL/R beta test releases.

As an alternative to yum-config-manager the following commands may be used:

( cd /etc/yum.repos.d/ && wget \
    https://marxmeier.com/download/repo/rpm/eloquence.repo )
Import the public key to verify package integrity and authenticity (recommeded but optional)
rpm --import \
    https://marxmeier.com/download/repo/rpm/RPM-GPG-KEY
Install SQL/R
yum install SQLR

Installation without a package repository
The yum (or dnf) command may also be used to install SQL/R without a package repository. The example below downloads the rpm archive and installs it. As an optional (but recommended) step the SQL/R package signing key is imported so the package integrity and authenticity can be verified.

Import the public key to verify package integrity and authenticity (recommeded but optional)

rpm --import \
    https://marxmeier.com/download/repo/rpm/RPM-GPG-KEY
Download and install the rpm file
yum install https://marxmeier.com/download/sqlr/A0300/linux/\
SQLR-A0321-2.x86_64.rpm 

The rpm file may also be downloaded and installed separately. This may be required if the system has no connection to the Internet. It is also recommended to download and import the Eloquence package signing key as shown above.

yum localinstall SQLR-A0321-2.x86_64.rpm

The rpm command may also be used to install the SQL/R package. However, this requires to resolve any dependencies manually.

Installing the SQL/R 64-bit rpm on Fedora or RHEL 6 may require installation of the 32-bit glibc library to resolve a dependency error on glibc. The 64-bit SQL/R rpm includes some 32-bit libraries to allow interoperability with 32-bit applications. However, 64-bit Fedora or RHEL may not install the 32-bit glibc library. In this case please install the glibc.i686 package.


SUSE (openSUSE/SLES) specific notes

On SUSE and compatible distributions zypper is used preferably to manage packages.

Installation using the package repository
The recommended installation procedure uses a shared repository with Eloquence to install and update the SQL/R release. The procedure below adds the Eloquence repository, imports the package signing key and installs the most recent SQL/R version.

Add the repository

zypper addrepo -f \
    https://marxmeier.com/download/repo/rpm/eloquence.repo
SQL/R uses a distinctive beta release repository. Please use the sqlr-beta.repo instead to subscribe to SQL/R beta test releases.

Import the public key to verify package integrity and authenticity (recommeded but optional)

rpm --import \
    https://marxmeier.com/download/repo/rpm/RPM-GPG-KEY
Please note that some older rpm versions may not support fetching the key from a remote server. In this case please download the public key file and perform the rpm --import on the local file.

Install SQL/R

zypper install SQLR

Installation without a package repository
The zypper command may also be used to install SQL/R without a package repository. The example below downloads the rpm archive and installs it. As an optional (but recommended) step the Eloquence package signing key is imported so the package integrity and authenticity can be verified.

Import the public key to verify package integrity and authenticity (recommeded but optional)

rpm --import \
    https://marxmeier.com/download/repo/rpm/RPM-GPG-KEY
Please note that some older rpm versions may not support fetching the key from a remote server. In this case please download the public key file and perform the rpm --import on the local file.

Download and install the rpm file

zypper install https://marxmeier.com/download/sqlr/A0300/linux/\
SQLR-A0321-2.x86_64.rpm 
The rpm file may also be downloaded and installed separately. This may be required if the system has no connection to the Internet. It is also recommended to download and import the Eloquence package signing key as shown above.
zypper install SQLR-A0321-2.x86_64.rpm

The rpm command may also be used to install the SQL/R package. However, this requires to resolve any dependencies manually.


Debian/Ubuntu specific notes

The following notes apply to Debian or Linux distributions derived from Debian (such as Ubuntu).

Installation using the package repository
The recommended installation procedure uses a shared repository with Eloquence to install and update the SQL/R release. The procedure below adds the Eloquence debian repository, imports the package signing key and installs the most recent SQL/R version.

To add the repository please add the .list file to /etc/apt/sources.list.d

( cd /etc/apt/sources.list.d && wget \
    https://marxmeier.com/download/repo/deb/eloquence.list )
SQL/R uses a distinctive beta release repository. Please use the sqlr-beta.list instead of eloquence.list to subscribe to SQL/R beta test releases.

Import the repository signing key to the apt key ring. This is used to verify the integrity of the repository.

wget -O /etc/apt/trusted.gpg.d/eloquence.asc \
    https://marxmeier.com/download/repo/deb/signing.key
Refresh the apt cache and install SQL/R
sudo apt-get update
sudo apt-get install sqlr

Installation without a package repository
The SQL/R package file may also be downloaded and installed separately. This may be required on systems that are not connected to the Internet.

SQL/R does provide a Debian specific .deb installation package. You may install SQL/R with the command below:

sudo dpkg -i sqlr_3.21-2_amd64.deb
Please keep in mind that when installing packages manually (instead of using apt) any dependencies may need to be resolved manually. On x86_64 systems, installation of the ia32-libs or libc6:i386 package may be necessary as SQL/R supports both 32 bit and 64 bit applications:
sudo apt-get install ia32-libs   # prior to MultiArch
- or -
sudo apt-get install libc6:i386  # if using MultiArch
When systemd is not used, the configuration file /etc/default/sqlr2 is used for configuring the start/stop scripts and the automatic startup on system boot.


sqlrodbc TCP service name

The default SQL/R configuration expects the sqlrodbc service name to be defined. A default definition is added during the installation procedure to the /etc/services file:
sqlrodbc    8003/tcp   # SQL/R ODBC
The first column specifies the service name ("sqlrodbc"), the second column the associated port number and protocol ("8003/tcp"). This entry associates the service name "sqlrodbc" with the TCP port number 8003. The service name "sqlrodbc" is used as a default.

In rare cases it might be necessary to modify this preset configuration, for example if the port number is already in use or does not match the one configured on other systems.

Encryption Support

SQL/R uses the OpenSSL software on Linux for cryptographic functions. The OpenSSL software must be installed to use the (optional) SQL/R cryptographic functions (encrypted passwords or encrypted communication).

SQL/R was tested with the OpenSSL 0.9.7, 0.9.8, 1.0 and 1.1 library versions. The OpenSSL library must be available as libcrypto.so. A symbolic link in the SQL/R lib and lib64 directories is created during installation. To force SQL/R to use a specific crypto library, this symbolic link may be changed.

ln -s /lib/libcrypto.so.1.0.0 /opt/sqlr2/lib/libcrypto.so
ln -s /lib64/libcrypto.so.1.0.0 /opt/sqlr2/lib64/libcrypto.so


LDAP Support

The SQL/R LDAP support on Linux uses the OpenLDAP client to access the LDAP server. The openldap2-client package must be installed to use the LDAP support.

To use LDAP, the server process dynamically loads a libldap.so library. The SQL/R specific lib directory has precedence in locating the library. The LD_LIBRARY_PATH environment variable may be used to select a specific library to be loaded. Otherwise the system default is used.


Configuring the Server

Configuring SQL/R startup

Automatic startup of SQL/R server processes during system boot is configured with systemd
systemctl enable sqlr2.service

If the System/V start/stop script is used, the /etc/sysconfig/sqlr2 configuration file is used and is enabled by default. Autostart should be disabled when the SQL/R server component is not used (eg. only the ODBC driver is used to access a remote database).

SQRL/R kernel resources

Upon startup, the sqlrodbcd process allocates a semaphore set and a shared memory segment. A fixed key is used to identify the shared memory and semaphore. As a consequence, the sqlrodbcd server will refuse to start if either another sqlrodbcd process is active or the sqlrodbcd main process aborted unexpectedly.

If a previous sqlrodbcd main process aborted without cleaning up the shared resources a message as below is output:

The SQL/R ODBC server semaphore exists but there is no active
server process. If the SQL/R ODBC server crashed, you can
remove any pending IPC resources by executing
ipcrm -s #
ipcrm -m #
Where # is the id of a semaphore or shared memory object. To manually remove the shared resources, please execute the commands as shown.

The main sqlrodbcd process runs in background and listens for new connections. For each active connection a new sqlrodbcd process is forked.

Configuring the server

The SQL/R ODBC server is configured with the configuration file odbc.cfg. The configuration file is read by the SQL/R ODBC server when it is started.

The odbc.cfg configuration file is located in the /etc/opt/sqlr2/ directory.

User and Group

The User and Group configuration items in the odbc.cfg specify a user and group that is used to run the SQL/R server process. The default account and group is sqlr.
These options are ignored if the server is not started with root privileges.
A configuration value is required when the server is started with root privileges.
User = sqlr
Group = sqlr

MaxUsers

The MaxUsers configuration item in the odbc.cfg file specifies the maximum number of concurrent processes connecting to the SQL/R ODBC server. The default is 40 simultaneous connections.
MaxUsers = 40