Steps to Install Oracle Linux 9 and Set Up Oracle Database 19c

  1. Download Oracle Linux ISO
    Get the Oracle Linux ISO file from this link: https://yum.oracle.com/oracle-linux-isos.html.

  2. Install Oracle Linux 9
    Use the downloaded ISO file to install Oracle Linux 9 on either a virtual machine (VM) or a physical server.

  3. Verify Installation
    Once the OS is installed, log in to the machine and run the following commands to verify the system setup:

    • cat /etc/*release – This shows the Oracle Linux version.
    • uname -a – This displays the kernel version.
  4. Install Oracle Preinstallation Package
    Ensure the server has internet access, then install the Oracle preinstallation package:

    • yum install -y oracle-database-preinstall-19c – This command will download necessary Oracle dependencies.
  5. Apply Kernel Parameter Changes
    Run and apply kernel parameter changes:

    • sysctl -p – This ensures kernel parameters are applied without needing a restart.
  6. Set Password for Oracle User
    After the Oracle preinstallation package creates the oracle user, set the password:

    • id oracle – Confirm the oracle user was created.
    • passwd oracle – Set the password for the oracle user.
  7. Create Oracle 19c Directories
    Create the required directories for Oracle Database:

    • mkdir -p /u01/app/oracle/product/19c/dbhome_1 – Oracle binaries, config files, and libraries are stored here.
    • mkdir -p /u02/oracle/oradata – Data files for the Oracle database will reside here.
    • mkdir -p /u02/oracle/FRA – This is for the Fast Recovery Area (FRA), storing backups and logs.
    • mkdir -p /backup/patch – Store Oracle patch files here.
  8. Update Ownership and Permissions
    Change ownership and permissions for the directories:

    • chown -R oracle:oinstall /u02
    • chown -R oracle:oinstall /u01
    • chown -R oracle:oinstall /backup
    • chmod -R 775 /u01/
    • chmod -R 775 /u02/
    • chmod -R 775 /backup/
  9. Set Limits for Oracle User
    Set resource limits for the oracle user by editing the /etc/security/limits.conf file:

    • Limit processes:
      oracle soft nproc 2047
      oracle hard nproc 16384
    • Limit file descriptors:
      oracle soft nofile 1024
      oracle hard nofile 65536
    • Limit stack size:
      oracle soft stack 10240
      oracle hard stack 10240
    • Lock memory in RAM:
      oracle soft memlock 134217728
      oracle hard memlock 134217728
  10. Reboot or Re-login
    These limits will take effect after a system reboot or when the oracle user logs out and back in. You can verify with the command:

  • ulimit -l
  1. Disable Firewall (Optional)
    To disable the firewall or adjust rules, run:
  • systemctl stop firewalld
  • systemctl disable firewalld
  1. Configure Oracle User’s Bash Profile
    Set up environment variables for the Oracle user:
  • Log in as the Oracle user: su - oracle
  • Edit .bash_profile: vi ~/.bash_profile
  • Add these Oracle environment variables:
    bash
    export TMP=/tmp export TMPDIR=$TMP export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 export ORACLE_SID=orcl export ORACLE_TERM=xterm export BASE_PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$BASE_PATH export PATH=$ORACLE_HOME/OPatch:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib/ export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
  1. Apply Changes to Bash Profile
    To apply the environment variables to your current session, run:
  • source ~/.bash_profile
  1. Verify Environment Variables
    Ensure the environment variables are set correctly:
  • echo $ORACLE_HOME
  • echo $ORACLE_SID
  • echo $PATH
  • echo $LD_LIBRARY_PATH Or use:
  • env | grep ORA
  1. Download Oracle Database 19c Installation Files
    Download the Oracle Database 19c files and OPatch utility from the official Oracle website:
    https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#db_ee
    For this example, download LINUX.X64_193000_db_home.zip (requires an Oracle account).

  2. Upload Installation Files
    Upload the Oracle Database zip and OPatch files to the $ORACLE_HOME directory.

  3. Download Oracle Database Patch
    Visit My Oracle Support and follow these steps:

  • Search for “Oracle Database 19c patch”.
  • Choose the patch that matches your system configuration.
  • Download and save it to your system, then upload it to /backup/patch on the server.
  1. Change File Ownership
    Change the ownership of the uploaded files:
  • chown oracle:oinstall LINUX.X64_193000_db_home.zip
  • chown oracle:oinstall p6880880_190000_Linux-x86-x64.zip
  • chown oracle:oinstall patch_file_name.zip
  1. Unzip Oracle Database Software
    Unzip the Oracle Database installation files:
  • unzip LINUX.X64_193000_db_home.zip
  1. Remove Old OPatch Directory
    The unzipped files will include an old OPatch directory. To replace it, run:
  • ls -ld Opatch (to check if the directory exists)
  • rm -rf Opatch (to remove the old directory)
  1. Unzip New OPatch Utility
    Now unzip the OPatch zip file:
  • unzip p6880880_190000_Linux-x86-x64.zip

Confirm the new OPatch directory:

  • ls -ld Opatch
  1. Remove Unnecessary Zip Files
    After extracting the necessary files, remove the Oracle DB and OPatch zip files from $ORACLE_HOME.

  2. Unzip Patch from /backup/patch
    Unzip the patch from the /backup/patch directory:

  • unzip patch_file_name.zip

This creates a directory under /backup/patch, such as /backup/patch/3344556677.

  1. Remove Patch Zip File
    Once unzipped, remove the patch zip file:
  • rm -rf patch_file_name.zip
  1. Set Display Environment Variable
    To set the display variable for graphical applications, run:
  • export DISPLAY=machine_name:0.0
  1. Set CV_ASSUME_DISTID
    Set the distribution ID for Oracle installation:
  • export CV_ASSUME_DISTID=OL8
  1. Apply the Patch
    Run the installer to apply the patch:
  • ./runInstaller -applyRU /backup/patch/3344556677
  1. Wait for Patch Application
    Wait for the patch to apply. You will see a message like:
    “Successfully applied the patch. The log can be found at: /tmp/InstallActionsDATETIME/InstallerPatchActionsDATETIME.log”

  2. Launch Oracle DB Setup Wizard
    The installer will now launch the Oracle DB setup wizard.

  3. Choose Installation Options
    The wizard will offer these choices:

  • Create and configure a single-instance database.
  • Set up software only. For this task, choose Set Up Software Only.
  1. Select Installation Type
    Choose Single Instance Database Installation (not Oracle RAC).

  2. Choose Database Edition
    Choose either Enterprise Edition or Standard Edition.

  3. Specify Oracle Directories
    Confirm that the Oracle base and home directories are correct. These will auto-populate based on previous steps.

  4. Specify Oracle Inventory Directory
    Leave the Oracle inventory directory as the default.

  5. Select Groups
    Choose the oinstall group for all options.

  6. Run Root Scripts
    Allow automatic execution of configuration scripts and provide the root user password.

  7. Prerequisite Checks
    If you encounter warnings, select Ignore All and proceed.

  8. Start Installation
    On the summary page, click Install to begin the installation process.

  9. Wait for Installation Completion
    The database software will install. The final message will say, “The registration of Oracle Database was successful.”

  10. Close the Wizard
    Once the installation is complete, close the wizard.

  11. Verify Installation
    Run the following commands to verify:

  • sqlplus -v – Check the Oracle version.
  • cat /etc/oraInst.loc – Verify the inventory location and group.
  • cd /u01/app/oraInventory/ContentsXML && cat inventory.xml – Ensure the home points to the correct $ORACLE_HOME.
  1. Create a Database with DBCA
    Use the DBCA tool to create a new database:
  • Run dbca to launch the database configuration assistant wizard.
  1. Select Database Operation
    Choose Create a Database and click Next.

  2. Select Creation Mode
    Choose Advanced Configuration and click Next.

  3. Select Deployment Type
    Choose Custom Database and proceed.

  4. Database Configuration
    Set the global database name (e.g., orcl) and deselect the option to create a pluggable database.

  5. Set Database Storage Locations
    Choose /u02/oracle/oradata for the database files location.

  6. Configure Fast Recovery Area
    Check Specify Fast Recovery Area, select /u02/oracle/FRA, and allocate 30 GB for the FRA.

  7. Network Configuration
    Skip this step for now and click Next.

  8. Configure Database Options
    Keep the default options.

  9. Configure Memory
    Set the SGA and PGA sizes to allocate 40% of the VM memory.

  10. User Credentials
    Set an administrative password for all accounts.

  11. Final Steps
    Ensure Create Database is checked and click Finish to create the database.

  12. Wait for Database Creation
    The database creation process will take a few minutes. Once done, you can connect to your new database.

Conclusion

Following these steps, you’ve successfully installed Oracle Linux 9, set up the Oracle Database 19c environment, applied necessary patches, and created your database. By carefully configuring the server, setting appropriate permissions, and establishing environment variables, you’ve laid the foundation for a stable and efficient Oracle Database instance.

From verifying your installation to creating the database, each step ensures that your Oracle environment is properly prepared and optimized for performance. Whether you’re using this setup for development, testing, or production, this guide provides a solid, step-by-step framework for installing and configuring Oracle Database 19c on Oracle Linux 9.

Now that the installation is complete, you’re ready to start working with Oracle DB, managing databases, and running enterprise-level applications. Always remember to regularly check for patches and updates to keep your environment secure and efficient.


Leave a Reply

Your email address will not be published. Required fields are marked *