In a previous blog post, I described the steps to streamline the pre-installation steps on Oracle Linux for Oracle Database 12c using the Database preinstallation package. In this post you will learn how to perform a fully automated installation of Oracle Database 21c on Oracle Linux running in an Oracle VM VirtualBox guest. The tutorial is based on a Vagrantfile published in our Vagrant Projects repo on GitHub and installs Oracle Database 21c Express Edition.
Because this installation method uses Oracle VM VirtualBox, Vagrant and an Oracle Linux Vagrant box, the whole process can be automated, requiring minimal to no input. Assuming you have VirtualBox, Vagrant and git installed, these are the steps to install Oracle Database:
After this, the database is up and running and ready to use. The commands are straightforward:
git clone https://github.com/oracle/vagrant-projects
cd vagrant-projects/OracleDatabase/21.3.0-XE
# Optional: download the Oracle Database installation file and place it in this directory
vagrant up
The steps summarized earlier cause Vagrant to do the following:
After the installation has completed, you can either log in to the guest VM itself and interact with the Database there or, you can leave the VM running —headless— and connect from the host operating system to the Database using tools such as SQL Developer. Be sure to make a note of the generated password at the end of the Vagrant installation.
To log in to the VM and interact with the database from the command line:
The command are:
vagrant ssh
sudo su - oracle
sqlplus pdbadmin/"<PASSWORD GOES HERE>"@xepdb1
In this post I explained how to perform an automated installation of Oracle Database 21c Express Edition in a virtual machine and connect to it. If your goal is to set up an Oracle database on your local development machine as quickly as possible while keeping it self contained, the method outlined here is a fantastic option.