Oracle provides Vagrant configuration files for installing several versions of Oracle Database in the oracle/vagrant-boxes GitHub repository. The Oracle Database box installers allow running user-defined scripts automatically after the database has been set up and started. This document provides instructions and scripts that use this functionality to install SQLcl.
- The procedure below installs SQLcl for the vagrant user only.
- Oracle envrionment variables are set for the vagrant user (using
oraenv
), so that SQLcl can find the database's tnsnames.ora file, and the vagrant user can run the database utilities, like SQL*Plus and RMAN. - SQLcl requires Java 1.8 or above. The procedure installs the latest OpenJDK from the Oracle Linux Yum Server, and creates a script to allow the vagrant user to run SQLcl without Java version conflicts, while preserving the ORACLE_HOME environment variable.
- Oracle Database 18.3.0 already includes SQLcl 17.3.0, and Oracle Database 19.3.0 already includes SQLcl 19.1.0. The procedure installs the latest version (19.2.1.206.1649 as of 19 August 2019) without disturbing the original installation.
- Clone or download Oracle's vagrant-boxes repository.
- Download the appropriate Oracle Database installer file(s) as instructed in the
README.md
file for the database version you want to install. - Download the SQLcl zip file from https://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html to the same directory as the database installer file(s).
- Copy the script below for the database version that you want to install and place it in the
userscripts
directory (this is one level below the directory that contains the database and SQLcl installer files). - Run
vagrant up
. SQLcl will be installed automatically. - To run SQLcl, SSH to the box (
vagrant ssh
) and entersql
at the prompt.