Installation

These instructions follow virtual machine approach, i.e. at the end of the installation you will have the following configuration to work with Oracle

Host OS (Windows/Linux/Mac) -> VirtualBox -> Windows (guest OS) -> Oracle 21c + SQL developer

Install Virtual Box

Download and install VirtualBox for your OS from https://www.virtualbox.org/wiki/Downloads.

Install Windows (Guest OS) in VirtualBox

Download Windows 10 installer/iso from https://www.microsoft.com/en-us/software-download/windows10.
  • If you are using Windows as host OS, you might be prompted to download installer file, which you can use to prepare an .iso:which image.

  • If you are using Linux as host OS, you might be asked to download .iso.

Prepare .iso for Windows as host OS

  • Download Windows 10 installer from https://www.microsoft.com/en-us/software-download/windows10.

  • Installer might look as follows in your downloads folder
    • ../../_images/downloader.png
  • Execute the above installer file to create .iso image which we will use to install Windows in VirtualBox later. Here are the snapshots that will help you go through the .iso generation process.
    • ../../_images/creating-disk-1.png
    • ../../_images/creating-disk-2.png
    • ../../_images/creating-disk-3.png
    • ../../_images/creating-disk-4.png
    • ../../_images/creating-disk-5.png
    • ../../_images/creating-disk-6.png

Create VirtualBox Image

  • Open the installed VirtualBox and create Windows image as follows:

  • Launch an installer window using New
    • ../../_images/vbox-1.png
  • Fill in the details, as well as point to correct location for Windows.iso file
    • ../../_images/vbox-2.png
  • Allocate 6GB of RAM (based on my tests, 4GB resulted in longer installation time for Oracle)
    • ../../_images/vbox-3.png
  • Allocate disk space, I used 75GB
    • ../../_images/vbox-4.png
  • Finally, a look at the summary page
    • ../../_images/vbox-5.png

Install Windows 10 along with guest additions

  • Follow these steps to install Windows 10 along with guest additions. These snapshots are self-explanatory
    • ../../_images/install-windows10-1.png
    • ../../_images/install-windows10-2.png
    • ../../_images/install-windows10-3.png
    • If you don’t have a product key, please click on “I don’t have a product key
      • ../../_images/install-windows10-4.png
    • ../../_images/install-windows10-5.png
    • ../../_images/install-windows10-6.png
    • ../../_images/install-windows10-7.png
    • ../../_images/install-windows10-8.png
    • ../../_images/install-windows10-9.png
  • Finish the final setup
    • ../../_images/install-windows10-10.png
  • Install guest additions as follows
    • ../../_images/install-guest-additions-1.png
    • ../../_images/install-guest-additions-2.png
    • ../../_images/install-guest-additions-3.png
    • ../../_images/install-guest-additions-4.png
    • ../../_images/install-guest-additions-5.png
    • ../../_images/install-guest-additions-6.png
    • ../../_images/install-guest-additions-7.png
    • ../../_images/install-guest-additions-8.png
  • Power-off and restart the VirtualBox Windows 10 image at this time.

Install Oracle 21c

  • Download Oracle21c from https://www.oracle.com/database/technologies/oracle21c-windows-downloads.html

  • Create an account and download the zip file. Following snapshots will walk you through the installation process.
    • ../../_images/oracle-installation-1.png
    • ../../_images/oracle-installation-2.png
    • ../../_images/oracle-installation-3.png
    • Create a folder Oracle21c in *C:* as follows
      • ../../_images/oracle-installation-4.png
    • Extract downloaded oracle zip file in “Oracle21c
      • ../../_images/oracle-installation-5.png
    • Run the setup as “administrator
      • ../../_images/oracle-installation-6.png
    • ../../_images/oracle-installation-7.png
    • ../../_images/oracle-installation-8.png
    • ../../_images/oracle-installation-9.png
    • Password you setup here will be used for default Oracle users like “system”. Make note of the “Pluggable database name” in this step, which will be useful while making a connection in SQL developer.
      • ../../_images/oracle-installation-10.png
    • You will encounter the following message, if you use a weak password
      • ../../_images/oracle-installation-11.png
    • ../../_images/oracle-installation-12.png
    • ../../_images/oracle-installation-13.png
    • ../../_images/oracle-installation-14.png
    • ../../_images/oracle-installation-15.png

Install SQL developer

  • To install SQL developer, we simply need to download the installer and extract. We can create a shortcut on the desktop to launch it whenever we need.

  • Download the file from https://www.oracle.com/database/sqldeveloper/technologies/download/
    • I downloaded “Windows 64-bit with JDK 11 included”.

    • Extract and move to appropriate location and create shortcut.

Unlock HR schema

  • Download the zip file from https://github.com/oracle-samples/db-sample-schemas/releases/tag/v21.1

  • Please follow these steps
    • Extract the contents of above downloaded file
      • ../../_images/1-download-extract-dbschema.png
    • Move extracted files to “C:Oracle21cWINDOWS.X64_213000_db_homedemoschema” (<- this is my path, your’s may be different)
      • ../../_images/2-moved-inside-demo-schema.png
    • Edit “hr_main.sql” in “human_resources” folder
      • ../../_images/3-path-to-hr-main.png
    • Make note of the path to the “human_resources” folder
      • ../../_images/4-copy-path-to-human-resources.png
    • Replace “__SUB__CWD__/human_resources/” with the full path copied from previous step. (Make sure to add * at the end of *human_resources during replacing the path)
      • ../../_images/5-replace-sub__cwd.png
    • Example of edited “hr_main.sql” file
      • ../../_images/6-replaced-1-path.png
      • ../../_images/7-replaced-all.png
    • Launch “sqlplus” using “Windows powershell
      • ../../_images/8-login-to-db-as-sysdba.png
    • Switch to “orclpdb” container. (Note that this should be same as the pluggable database (PDB) name used during the Oracle installation process)
      • ../../_images/9-alter-session-to-orclpdb-this-is-my-pdb.png
    • Check if the PDB is “open”” or in “mounted” state
      • ../../_images/10-display-mode-of-pdb.png
    • If in “mounted” state, we need to “open” it using the following command
      • ../../_images/11-open-db.png
    • PDB when its open should have “READ WRITE” as its “OPEN_MODE
      • ../../_images/12-check-mode-again-of-pdb.png
    • Save the state, so that it will always be in this state when we restart the session
      • ../../_images/13-save-state-of-orclpdb-so-that-it-stays-open-across-all-sessions.png
    • Run the following command to execute “hr_main.sql
      • @C:Oracle21cWINDOWS.X64_213000_db_homedemoschemahuman_resoureshr_main.sql <password-of-hr-schema> users<default-table-space> temp<temporary-table-space> oracle<password-of-sysuser> C:Oracle1cWINDOWS.X64_213000_db_homedemoschemalog<pathtologs> localhost:1521/orclpdb<connect-string>

      • ../../_images/14-executing-hr-main-by-passing-6-parameters.png
    • ../../_images/15-hr-main-completed.png
    • Connect to hr database in SQL developer
      • ../../_images/16-sql-developer-click-manual-connection.png
    • ../../_images/17-connect-to-hr-orclpdb.png
    • ../../_images/18-sample-query-from-hr-employees.png