<< Click to Display Table of Contents >> Raynet One > 1.1 > User Guide Appendix B: Installing SQL*Plus for DFUS |
Oracle databases provide insights into provided features and estimations about feature usage capacity. During auditing of your Oracle databases, you are provided with the option to run special audit SQL scripts. The scripts are expected to be run by the SQL*Plus program distributed by Oracle. Raynet One aims to pave the way for a cumbersome and seamless Oracle audit experience.
In order to execute Oracle Database Feature Usage Statistics (DFUS) scripts, you need to install SQL*Plus along with all of its dependencies and reference its location in the system's PATH environment variable. Here are steps on how to proceed.
1.Visit the URL https://www.oracle.com/database/technologies/instant-client/downloads.html . Choose the platform of the runner's installation.
2.Download the (latest) Basic Package and extract the instantclient_[MAJOR]_[MINOR] folder to the (recommended) filesystem location, where [MAJOR] and [MINOR] are to be substituted by the product's version. The final recommended location of the executable files should be as following.
Windows: C:\oracle\instantclient_[MAJOR]_[MINOR]\
Linux: /opt/oracle/instantclient_[MAJOR]_[MINOR]/
3.Download the (latest) SQL*Plus Package and extract the contained instantclient_[MAJOR]_[MINOR] folder into the same location as the Basic Package, so that the SQL*Plus executable file is provided at the chosen filesystem location.
4.Follow the platform specific installation instructions at the bottom of the package download page.
5.Put the chosen filesystem location into the system's PATH environment variable, if not done already.
Linux-based platforms need special steps not mentioned in the official guide to get SQL*Plus working properly. Linux command templates executed in a shell interpreter start with the $ character.
1.$ sudo nano /etc/environment
This is the place at which you should add the filesystem location of the SQL*Plus executable to the listed PATH variable. The generic installation steps mention this requirement but do not elaborate it.
2.$ sudo nano /etc/sudoers
If you plan to run the runner using the sudo command, you need to include the filesystem location of the SQL*Plus executable to the secure_path variable override aswell. The content of this parameter is set as the PATH variable for the running sudo process.
3.$ sudo chmod 555 [full path to the sqlplus executable file]
This command changes the flags of the SQL*Plus executable file to be readable and executable by anyone (owner, group and public). This allows the runner to find and execute the binary through the system's PATH environment variable.
4.$ sudo find / -name "libaio*.so*" -print
This find command lists all available libaio dynamic link library files installed on your Linux distribution. The sqlplus binary expects the dynamic-link library libaio.so.1 to exist. If you cannot find it in the listed entries, we add the required hardlink in the next step.
In the above screenshot we see the 64-bit version of the libaio1 library. Pick the appropriate library to create the hardlink for.
5.$ sudo ln -s [full path to the libaio1 library] [base path to the libaio1 library]/libaio.so.1
This command creates the necessary dynamic-link library hardlink for the SQL*Plus executable on Linux. Due to changes in the distribution packages related to the platform architecture, this adjustment has become necessary.
Example of base path resolution: /usr/lib/x86_64-linux-gnu/somelib.so -> /usr/lib/x86-64-linux-gnu
6.Reboot the Linux machine to make the changes take effect system-wide.
7.$ sqlplus
If you have followed the installation instructions properly, you should see the login prompt of the SQL*Plus program. Your runner machine is now properly set-up for Oracle DFUS audit script execution!
We do not provide the SQL*Plus binary inside of the Docker container image for licensing reasons. Here are steps on how to include it manually.
Substitute the [MAJOR] and [MINOR] tokens below with the respective version of your Oracle instantclient.
The following default or equivalent runner Docker compose base configuration is assumed.
version: "1.0"
services:
rno-runner:
container_name: rno-runner
image: raynetgmbh/raynet-one-runner:latest
volumes:
- rno_runner_data:/app/data
volumes:
rno_runner_data:
1.Add the following entrypoint parameter to the runner service.
entrypoint: >
bash -c "apt update
&& apt install libaio1
&& echo \"/opt/oracle/instantclient_[MAJOR]_[MINOR]\" > /etc/ld.so.conf.d/oracle-instantclient.conf
&& ldconfig
&& export PATH=\"$$PATH:/opt/oracle/instantclient_[MAJOR]_[MINOR]\"
&& ./RunnerLaunch.sh"
2.Merge the following volumes list with the one of your runner service.
volumes:
- ./instantclient_[MAJOR]_[MINOR]:/opt/oracle/instantclient_[MAJOR]_[MINOR]
3.Extract the instantclient_[MAJOR]_[MINOR] folders from both of the Oracle Basic and SQL*Plus packages in the same folder as your Docker compose file.
4.Run docker compose up to verify correct functionality of the new runner configuration.
Ignore the warning about apt. We are not parsing the output of this application, so we are not subject to the mentioned instability.
5.Run docker exec rno-runner /opt/oracle/instantclient_[MAJOR]_[MINOR]/sqlplus . If you see the SQL*Plus login prompt, the application has been deployed successfully.