Your cart
  • IMG
    {{cart_item.name}}
    {{cart_item.variation_attribute_name}}: {{cart_item.variation_attribute_label}}
    {{cart_item.item_unit}}: {{ setCurrency(cart_item.price)}}
    {{ setCurrency(cart_item.price*cart_item.quantity)}}
    Invalid quantity more than stock
Total :
{{setCurrency(cart.sub_total)}}

There is no item in the cart. If you want to buy, Please click here.

Step by Step Oracle Database 19c installation in Oracle Linux 8

Created by :
Database, Oracle 19c, Oracle
article
Programming, Software and application
14344
2022-01-05 02:56:23

Oracle Database 19c is the latest stable version for production use and this article describes the all steps to install Oracle Database 19c 64-bit on Oracle Linux 8 (OL8) 64-bit. This article is divided into several sections:


Installation requirements Checklist

Download Software

Installation Prerequisites

Oracle Installation and its steps 

Database Creation

Final Checking database



Installation requirements Checklist

Please check the checklists that your server hardware and configuration meet minimum requirements for this release, and can help you to ensure you carry out a successful installation. There are the basic requirements checklists to install Oracle Database 19c. 


Hardware: 

Physical RAM: At least 1 GB RAM for Oracle Database installations. 2 GB RAM recommended. At least 8 GB RAM for Oracle Grid Infrastructure installations.


Swap Space: 2 times the size of RAM. To check, 


Space requirement for Oracle 19c Software: Enterprise Edition Minimum 10G  


OS: 

Linux x86-64 operating system requirements - Oracle Linux 8.5 or Later / Red Hat Enterprise Linux 7.5 or later / SUSE Linux Enterprise Server 12 or later 


For full requirement checklists, Please see https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/oracle-database-installation-checklist.html#GUID-E847221C-1406-4B6D-8666-479DB6BDB046



Download Software

Download the latest Long Term Release Oracle Database 19c from https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c


Oracle also provides all supported database release software for all platforms on the Oracle Software Delivery Cloud: https://edelivery.oracle.com


Installation Prerequisites Steps

You have a Oracle Database 19c and you need to install it in Linux machine. For Linux machine, you need to work some prerequisites where dose not need when you install oracle 19c in windows machine.

Create Oracle Installation Directory: 

Create the directories in which the Oracle software will be installed.


mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u02/oradata


Give group and access permission to /u01 /u02 directories 

chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02


Check hostname: 

To check hostname, open the /etc/hosts

 # vi /etc/hosts

You will see as follows 

127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4


Add a new hostname with IP as syntax.

<IP> <hostname> <machine-name>

 

Example: 

127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
192.192.192.111 oradb.mydomain.org oradb


After you change press Esc then ‘:wq’ and press enter. 

 

NB!! Make sure you can ping the hostname you added in the host file.


Stop Firewalld:

Stop Firewalld by using the command: systemctl stop firewalld


If you have the Linux firewall enabled, you will need to disable or configure it, as shown here. To disable it, do the following.


# systemctl stop firewalld
# systemctl disable firewalld


Setup oracle database preinstall: 

Before you begin the installation you are required to do so many configurations manually. But Oracle has given a good feature which is called Prebuilt Prerequisites that help you to do the pre-installation configurations easily. That lets you check what are the prerequisites you have and whether your machine is capable to run those prerequisites or not.


If you logged in as the root user, you can directly run the command to install the prerequisites. But if you have logged in as another user, please go to the root user before running the prerequisites installation.


If you plan to use the "oracle-database-preinstall-19c" package to perform all your prerequisite setup, issue the following command.

# yum install -y oracle-database-preinstall-19c


Update for optional: It is probably worth doing a full update as well, but this is optional.

# yum update -y

 

It's worth running all the YUM commands listed in the manual setup section. Depending on the OS package groups you have selected, some additional packages might also be needed.


RPM for RHEL7 or CentOS7: 


 Install PRM which will pick up from the OL7 repository and install it. PRM will pull the dependencies from your normal repositories.


# yum install -y https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

Set the password for the "oracle" user.


passwd reset for oracl: 

I told you that a user called oracle has created with the help of prerequisites. Yeah, a user has created, and do you know the password for the oracle user. No. Since we have connected as the root user, we can change the password of the oracle user. Type the following command and it will ask you to enter a new password and retype to confirm the new password.


passwd oracle


Enter New password and retype confirm password which will be used for Oracle User. 


Set xhost: 

Unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.


xhost +<machine-name>

 

Update SELINUX: 

Since you need to run Oracle Universal Installer, which is a GUI we need to check the Linux Permissive first. Otherwise, you will get an error and graphics will not come for installation. Type the following command on your terminal.  

#vi /etc/selinux/config


Making sure the SELINUX flag is set as follows.


SELINUX=permissive


After you change press Esc then ‘:wq’ and press enter. 


Once the change is complete, restart the server or run the following command.

# setenforce Permissive


Create script for Oracle Environment Configuration: 

First of all, create a directory for all scripts as follows: 

mkdir /home/oracle/scripts


Create an environment file called "setEnv.sh". Check all path and value of following script and if everything is fine according to your machine, then execute. 

cat > /home/oracle/scripts/setEnv.sh <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_HOSTNAME=oracle.mydomain.org
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
EOF


***The "$" characters are escaped using "\". If you are not creating the file with the cat command, you will need to remove the escape characters.

Add a reference to the "setEnv.sh" file at the end of the "/home/oracle/.bash_profile" file.

echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile


Create a "start_all.sh" and "stop_all.sh" script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbstart \$ORACLE_HOME
EOF


cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbshut \$ORACLE_HOME
EOF

chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh


Once the installation is complete and you've edited the "/etc/oratab", you should be able to start/stop the database with the following scripts run from the "oracle" user.

~/scripts/start_all.sh
~/scripts/stop_all.sh



Unzip the File


# Unzip software.

Switch to the ORACLE_HOME directory, unzip the software directly into this path and start the Oracle Universal Installer (OUI) by issuing one of the following commands in the ORACLE_HOME directory. 


cd $ORACLE_HOME
unzip -oq /home/oracle/Downloads/LINUX.X64_193000_db_home.zip


Update DISPLAY:

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.


DISPLAY=<machine-name>:0.0; export DISPLAY


Oracle Instance and Database installation Steps

The interactive mode will display GUI installer screens to allow user input, while the silent mode will install the software without displaying any screens, as all required options are already specified on the command line.


# Interactive mode.
./runInstaller



Now, proceed according to the OUI instruction and click next.....


Step1 : Click create and configure a single instance database


Step2 : Click Server class


Step3 : Select Enterprise Edition


Step 4:Choose location for ORACLE_BASE


Step 5: Select configuration type as General Purpose / Transaction Processing.


Step 6: Enter Database name


Step 7: Enter database file location


Step 8: Enable Archivelog mode option for database


Step 9: Enter SYS and SYSTEM user password


Step 10: Check OS groups for installation


Step 11: Check Prerequisite checks for 19c database installation


Step 12: Check Summary


Step 13: Run root.sh and Orainventory scripts :


 Run the root scripts when prompted.



As a root user, execute the following script(s):


    1. /u01/app/oraInventory/orainstRoot.sh


    2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh


 


Step 14: Check database status


Type sqlplus and enter,

type sys as sysdba and enter

give password and enter

type show con_name and enter

Commands and outputs are as like:


Create Oracle Database



Uninstall Oracle Database

To uninstall Oracle database:

  1. Run the deinstall script in the $ORACLE_HOME/deinstall folder.
  2. Copy

[oracle@vm ~]$ cd $ORACLE_HOME/deinstall/

  1. [oracle@vm deinstall]$ ./deinstall
  2. Select the default options unless you need to drop or delete schemas and listeners.
  3. Type y to continue.
  4. After the script finishes, remove the oracle folder.
  5. Copy
  6. rm -rf /home/oracle/app/oracle