If testing a connection in the oracle probe is failing with an error message such as: "Create OCI environment failed with rc = -1" or "OCIEnvCreate failed with rc = -1" follow the instructions below.
OCIEnvCreate returning -1 almost always indicates that the probe cannot find the oracle client (or doesn't have read/execute permissions).
Check the oracle probe Release Notes to see which Oracle clients are currently supported and requirements.
The first piece of information you should collect is whether the oracle_monitor probe is deployed on the same machine where the database is installed or on a different machine. If the probe is installed on a different machine then verify which 'Oracle Client' version is installed on that machine locally, and check the OS version for that server and whether the OS is 32 or 64-bit.
If customer is using zones ensure that the client and server are on the same zone even when they are on the same server.
The Release Notes for the Oracle probe contain a matrix listing the different combinations of Server and Client versions that are officially supported by the oracle probe. If you have any other version of the Oracle Client other than what is supported with your Server version then please update it to one that is officially supported.
The oracle probe requires that the Oracle client 'match' the OS (32-bit versus 64-bit) and Oracle DB server version. If you have a 64-bit OS you are running the probe on. then the Oracle client must be 64-bit as well.
Also, you will need to double-check the items below after logging in with the oracle user (you must be logged in as the oracle user instead of root)
1. Re-verify that the following variables are set on the machine where the Oracle database is installed.
d. PATH (should include the Oracle bin directory.)
NOTE: AIX OS REQUIRES the LIBPATH as well. Please see the latest release notes.
Example on how to find values:
[[email protected] ~]# su - oracle
[[email protected] ~]$ env |grep oracle
UIM Environment would be set as follows for the above:
Stop firewalld for the current session->systemctl stop firewalld.service
Confirm Firewalld is inactive-> systemctl status firewalld
For a different OS, different commands may apply to do the same.
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client export ORACLE_HOME LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME:$LD_LIBRARY_PATH export LD_LIBRARY_PATH PATH=$PATH:$ORACLE_HOME/bin export TNS_ADMIN=$ORACLE_HOME/network/admin
For an Oracle database with multiple instances/SIDs, each SID must be configured for each connection profile in the probe/instance, Service Name and Instance must be specified.
Make sure you add TNS_ADMIN to the Robot controller environment. It is the location of the
tnsnames.ora, sqlnet.ora etc files, for example:
Confirm your LD_LIBRARY_PATH is also correct, e.g.,
Note that the oracle probe version 4.71 does not support AIX 6 and 7. You need 4.90 or higher.
See below for two screenshots of a sample configuration for the Robot/controller and Oracle connection settings for an Oracle probe installed on the local Oracle database server on an AIX 7.1 machine:
Robot/controller environment (example)
Excerpt from the Robot environment section on the machine where the probe is installed:
ORACLE_HOME = /u01/app/oracle/product/184.108.40.206/db_1
ORACLE_BASE = /u01/app/oracle
LD_LIBRARY_PATH = /u01/app/oracle/product/220.127.116.11/db_1/lib
PATH = $PATH:$ORACLE_HOME/bin
TNS_ADMIN = $ORACLE_HOME/network/admin
Oracle probe Connection settings (example)