Get Started with Oracle Database Free on Oracle Linux

7
0
Send lab feedback

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 lab environment, see the Getting help section of the Oracle Database Free FAQ .

Objectives

In this lab, you'll learn how to:

  • Install Oracle Database Free using Podman
  • Install Oracle Database Free RPM
  • Configure Oracle Database Free

Prerequisites

  • A system running Oracle Linux
  • Minimum of 7680 MB free on the partition containing /opt for the RPM installation

Setup Lab Environment

Note: When using the free lab environment, see Oracle Linux Lab Basics for connection and other usage instructions.

  1. If not already connected, open a terminal and connect via ssh to the ol-node01 instance.

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

    cat /etc/oracle-release
  3. Install the container-tools module.

    sudo dnf module install -y container-tools:ol8

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 in length, containing 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.

    sudo dnf install -y oracle-instantclient-release-el8
    sudo dnf install -y oracle-instantclient-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:

    [oracle@ol-node01 ~]$ sqlplus sys/Welcome1@//localhost:1521/FREE as sysdba
    
    SQL*Plus: Release 21.0.0.0.0 - Production on Fri Apr 14 14:15:52 2023
    Version 21.9.0.0.0
    
    Copyright (c) 1982, 2022, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
    Version 23.2.0.0.0
    
    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

    Note: When stopping the container, ignore the expected warning regarding StopSignal SIGTERM.

  2. Remove the container.

    podman rm oracle-db

    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. Enable the Oracle Linux Developer channel.

    sudo dnf config-manager --set-enabled ol8_developer
  2. Run the Preinstallation RPM.

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

    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.

  3. Download the Oracle Database Free.

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

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

  4. Install the database software.

    sudo dnf localinstall -y  oracle-database-free-23c-1.0-1.el8.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–23c.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-23c 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 in length, containing 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/23c/dbhomeFree/bin/oraenv
  2. Connect to the database.

    sqlplus / as sysdba

    Example Output:

    SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Wed Mar 15 22:37:14 2023
    Version 23.2.0.0.0
    
    Copyright (c) 1982, 2023, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
    Version 23.2.0.0.0

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

For More Information

See other related resources:

SSR