Install Oracle ODBC Connector on Solaris

The following install was on x86 Solaris 10. The steps are similar on a Sparc Solaris 10 and on Solaris 11. Download the appropriate ZIP files (instantclient-basic and instantclient-odbc) to a directory. For example, /tmp/Oracle.

For Solaris Sparc 10, the 2 hosts pbul-qa-spsol11z-01 and pbul-qaspsol11z-02 already have Oracle ODBC installed. When installing PMUL, you must create odbc.ini in /opt/<prefix>pbul<suffix>/etc.

PMUL binaries are 32-bit. You must ensure 32-bit versions of unixODBC and Oracle ODBC connectors are installed on Solaris 10 and 11.

  1. Step 1 is the same as for Linux. Use the existing Oracle database/server and create your user.
  2. Run the following steps on the log server:
  3. # pkgadd -d
    # export PATH=$PATH:/opt/csw/bin
    # pkgutil -U -u -y
    # pkgutil -i -y unixodbc
    # mkdir /opt/oracleODBC
    # cd /opt/oracleODBC/
    # unzip /tmp/Oracle/
    # unzip /tmp/Oracle/
    # unzip /tmp/Oracle/
  1. In pb.settings set:
  2. eventdestinations authevt=odbc=Oracle
    odbcinidir  /opt/pbul/etc
  1. Create /etc/tnsnames.ora:
  2. # cat /etc/tnsnames.ora

The tnsnames.ora file needs to be in /etc. Copying it elsewhere and setting TNS_ADMIN to the new directory does not work.

  1. Create /opt/pbul/etc/odbcinst.ini:
  2. [oracle]
    Description = Oracle 18
    Driver      = /opt/oracleODBC/instantclient_18_3/
    ServerName  = ORCLCDB
  1. Create /opt/pbul/etc/odbc.ini:
  2. [oracle]
    Description = Oracle
    Driver      = oracle
    DSN         = ORCLCDB
    ServerName  = ORCLCDB
    UserID      = mdavis
    Password    = mdavis

Use the user name you created in step 1.

  1. Set LD_LIBRARY_PATH and TNS_ADMIN for the pblighttpd service:
  2. svccfg -s application/security/pblighttpd setenv LD_LIBRARY_PATH /opt/oracleODBC/instantclient_18_3:/opt/csw/lib
    svccfg -s application/security/pblighttpd setenv TNS_ADMIN /etc
    svcadm refresh pblighttpd
    svcadm restart pblighttpd
  1. Set LD_LIBRARY_PATH in the environment for pblog to work. Add the following to /etc/profile:
  2. LD_LIBRARY_PATH="/usr/lib:/lib:/opt/oracleODBC/instantclient_18_3:/opt/csw/lib"
    export LD_LIBRARY_PATH
    export TNS_ADMIN


Make sure /usr/lib is first in LD_LIBRARY_PATH.

  1. To use oracle SSL authentication, create sqlnet.ora file, update TNS_NAMES configurations for pblighttpd and restart pblighttpd.
    • Create /etc/sqlnet.ora.
  2. #cat /etc/sqlnet.ora
    WALLET_LOCATION = (SOURCE =(METHOD = FILE)(METHOD_DATA =(DIRECTORY = /home/oracle/app/oracle/wallet)) )	
    ls /etc/*.ora
    /etc/sqlnet.ora  /etc/tnsnames.ora
    • Set the environment variable TNS_ADMIN=/etc/ to pblighttpd service.

    Use the below commands to set the variable:

    svccfg -s pblighttpd setenv TNS_NAME /etc/
    svcadm refresh pblighttpd

    Validate the configuration using below command:

    svcprop -p start/environment pblighttpd

TNS_ADMIN is the location from where ODBC drivers read sqlnet.ora and tnsnames.ora.

    • Restart pblighttpd.

  1. Run pbrun and verify using:
  2. # pblog --odbc -f Oracle

Export TNS_ADMIN=/etc if you are using oracle SSL connections.

  1. Check pbrest.log and other logs to make sure there is no error.


Set LD_LIBRARY_PATH with /opt/csw/lib:

When LD_LIBRARY_PATH is set to contain /opt/csw/lib without /usr/lib first, and we either validate or import pblighttpd-smf.xml, svccfg segfault on Solaris:

# LD_LIBRARY_PATH=/opt/oracleODBC/instantclient_18_3:/opt/csw/lib
# svccfg validate /usr/lib/beyondtrust/pb/rest/etc/pblighttpd-smf.xml
Segmentation Fault (core dumped)
# LD_LIBRARY_PATH=/opt/oracleODBC/instantclient_18_3
# svccfg validate /usr/lib/beyondtrust/pb/rest/etc/pblighttpd-smf.xml


# LD_LIBRARY_PATH=/usr/lib:/opt/oracleODBC/instantclient_18_3:/opt/csw/lib
			# svccfg validate /usr/lib/beyondtrust/pb/rest/etc/pblighttpd-smf.xml

The reason for the segfault is a library conflict in /usr/lib and /opt/csw/lib.

# ldd /usr/sbin/svccfg =>  /usr/lib/ =>   /usr/lib/ =>     /usr/lib/ =>         /usr/lib/ =>  /usr/lib/ =>  /usr/lib/ =>   /usr/lib/ =>         /usr/lib/ =>     /usr/lib/ =>       /usr/lib/ =>     /usr/lib/ =>     /usr/lib/ =>        /usr/lib/ =>   /usr/lib/ =>   /usr/lib/ =>        /usr/lib/ =>    /usr/lib/ =>    /usr/lib/

If LD_LIBRARY_PATH does not have /usr/lib first, we get:

# LD_LIBRARY_PATH=/opt/oracleODBC/instantclient_18_3:/opt/csw/lib
# ldd /usr/sbin/svccfg =>  /usr/lib/ =>   /lib/ =>     /usr/lib/ => /lib/ =>  /lib/ =>  /lib/ =>   /lib/ => /usr/lib/ =>     /lib/ =>  /lib/ =>     /opt/csw/lib/ (SUNW_1.1) =>  (version not found) =>     /lib/ => /lib/ =>   /lib/ =>   /lib/ => /lib/> =>    /lib/ =>    /lib/

For more information, please see Install Oracle ODBC Connector on Linux.