Note:

Get Started with Oracle Database Free on Oracle Linux

Introduction

Oracle Database Free—Developer Release is the same powerful Oracle Database businesses worldwide rely on. It offers a full-featured experience and is packaged for ease of use and simple download—for free.

Whether you are a developer, a data scientist, a DBA, an educator, or just interested in databases, Oracle Database 23c Free—Developer Release is the ideal way to get started. It provides native support for all modern data types, analytics, and the latest development paradigms—all built into one product.

This tutorial uses the container and RPM installation methods to install Oracle Database Free on Oracle Linux.

For help outside of this tutorial, see the Getting help section of the Oracle Database Free FAQ.

Objectives

In this tutorial, you’ll learn how to:

Prerequisites

Deploy Oracle Linux

Note: If running in your own tenancy, read the linux-virt-labs GitHub project README.md and complete the prerequisites before deploying the lab environment.

  1. Open a terminal on the Luna Desktop.

  2. Clone the linux-virt-labs GitHub project.

    git clone https://github.com/oracle-devrel/linux-virt-labs.git
    
  3. Change into the working directory.

    cd linux-virt-labs/ol
    
  4. Install the required collections.

    ansible-galaxy collection install -r requirements.yml
    
  5. Deploy the lab environment.

    ansible-playbook create_instance.yml -e localhost_python_interpreter="/usr/bin/python3.6"
    

    The free lab environment requires the extra variable local_python_interpreter, which sets ansible_python_interpreter for plays running on localhost. This variable is needed because the environment installs the RPM package for the Oracle Cloud Infrastructure SDK for Python, located under the python3.6 modules.

    The default deployment shape uses the AMD CPU and Oracle Linux 8. To use an Intel CPU or Oracle Linux 9, add -e instance_shape="VM.Standard3.Flex" or -e os_version="9" to the deployment command.

    Important: Wait for the playbook to run successfully and reach the pause task. At this stage of the playbook, the installation of Oracle Cloud Native Environment is complete, and the instances are ready. Take note of the previous play, which prints the public and private IP addresses of the nodes it deploys and any other deployment information needed while running the lab.

Install Podman

  1. Open a terminal and connect via SSH to the ol-node-01 instance.

    ssh oracle@<ip_address_of_instance>
    
  2. Confirm the version of Oracle Linux.

    cat /etc/oracle-release
    
  3. Install the Podman packages or modules.

    Oracle Linux 8:

    sudo dnf module install -y container-tools:ol8
    

    Oracle Linux 9:

    sudo dnf install -y container-tools
    

    The container-tools module or package installs podman and other container tools, including skopeo and buildah. One essential package is container-selinux, which allows running podman as a non-root user on a SELinux-enabled system, which Oracle Linux enables by default.

Install Oracle Database Free Server Using Podman

  1. Create a data volume.

    The data volume allows the database to persist during container recreation.

    podman volume create oradata
    
  2. Create a secret.

    The secret is a utility to pass secure text strings to the container, such as ssh-keys or passwords.

    echo "Welcome1" | podman secret create oracle_pwd -
    

    The SYS,SYSTEM, and PDBADMIN administrative user accounts all use the same password. Oracle recommends that your password be at least 8 characters long and contain at least 1 upper-case character, 1 lower-case character, and 1 digit [0-9].

  3. Start the Oracle Database.

    podman run -d --name oracle-db --secret=oracle_pwd -p 1521:1521 -v oradata:/opt/oracle/oradata container-registry.oracle.com/database/free:latest
    

Connect to the Oracle Database Free Server Container

  1. Get the mapped database port.

    podman port oracle-db
    
  2. Install SQL*Plus.

    Oracle Linux 8:

    sudo dnf install -y oracle-instantclient-release-el8
    sudo dnf install -y oracle-instantclient-sqlplus
    

    Oracle Linux 9:

    sudo dnf install -y oracle-instantclient-release-el9
    sudo dnf install -y oracle-instantclient19.19-sqlplus
    
  3. Connect using SQL*Plus.

    sqlplus sys/Welcome1@//localhost:1521/FREE as sysdba
    

    Tip: If SQL*Plus fails to connect to the database container, try again. Depending on resources and timing, the database initialization could still be running during the first attempt.

  4. Select from the DUAL table.

    select * from dual;
    

    Example Output:

    SQL> select * from dual;
    
    D
    -
    X
    
  5. Select the system date.

    select sysdate;
    

    Example Output:

    SQL> select sysdate;
    
    SYSDATE
    ---------
    14-APR-23
    
  6. Exit SQL*Plus.

    quit
    

Stop and Remove the Oracle Database Free Server Container

  1. Stop the container.

    podman stop oracle-db
    
  2. Remove the container and image.

    podman rm oracle-db
    podman rmi container-registry.oracle.com/database/free
    

    The oradata volume remains after removing the container, thus preserving any data added or configuration changes made to the database.

Install Oracle Database Free RPM

  1. Install the Preinstallation RPM.

    sudo dnf install -y oracle-database-preinstall-23ai
    

    The Oracle Database Preinstallation RPM automatically creates the Oracle installation owner and groups, and it also sets up other kernel configuration settings as required for Oracle Database installations. If you plan to use job-role separation, create an extended set of database users and groups depending on your requirements.

  2. Download the Oracle Database Free.

    Oracle Linux 8:

    curl -JLO https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23ai-1.0-1.el8.x86_64.rpm
    

    Oracle Linux 9:

    curl -JLO https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23ai-1.0-1.el9.x86_64.rpm
    

    Access the Oracle Database Free software download details at https://www.oracle.com/database/technologies/free-downloads.html

  3. Install the database software.

    Oracle Linux 8:

    sudo dnf localinstall -y  oracle-database-free-23ai-1.0-1.el8.x86_64.rpm
    

    Oracle Linux 9:

    sudo dnf localinstall -y  oracle-database-free-23ai-1.0-1.el9.x86_64.rpm
    

    Note: Review the RPM log files to determine the system configuration changes. For example, review /var/log/oracle-database-preinstall-23c/results/orakernel.log.

Create and Configure an Oracle Database

The configuration script creates a container database (FREE) with one pluggable database (FREEPDB1) and configures the listener at the default port (1521).

  1. Review the configuration parameters.

    cat /etc/sysconfig/oracle-free-23ai.conf
    

    The parameters in this file are explained in detail in the silent mode installation procedure: Performing a Silent Installation.

  2. Create the database with the default settings.

    sudo /etc/init.d/oracle-free-23ai configure
    

    At the command prompt, specify a password for the SYS, SYSTEM, and PDBADMIN administrative user accounts. Oracle recommends that your password be at least 8 characters long and contain at least 1 upper-case character, 1 lower-case character, and 1 digit [0-9].

Connecting to Oracle Database Free

  1. Set the environment for the database.

    export ORACLE_SID=FREE
    export ORAENV_ASK=NO
    . /opt/oracle/product/23ai/dbhomeFree/bin/oraenv
    
  2. Connect to the database.

    sqlplus / as sysdba
    

    Example Output:

    SQL*Plus: Release 23.0.0.0.0 - Production on Thu May 23 13:22:23 2024
    Version 23.4.0.24.05
    
    Copyright (c) 1982, 2024, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
    Version 23.4.0.24.05
    

    An output similar to the following confirms that you can successfully connect to the database.

For More Information

See other related resources:

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.