Friday, November 5, 2021

Installing Oracle 21c Express Edition on CentOS 7

Features of Oracle 21c:-
  1. Multi-tenant: Get isolation, agility, and economies of scale by managing multiple Pluggable Databases inside your Oracle Multi-tenant Container Database
  2. In-Memory: Support real-time analytics, business intelligence, and reports by keeping your important data in the Oracle Database In-Memory column store
  3. Partitioning: Enhance performance, availability, and manageability of your database with data partitioning that meets diverse business requirements
  4. Advanced Analytics: Get valuable insights and deliver predictions from your data using Data Mining SQL, R programming, and the Oracle Data Miner UI
  5. Advanced Security: Protect your sensitive data at the source and build end-to-end encrypted apps with layers of security including Oracle Transparent Data Encryption and Data Redaction

Limitations of Oracle 21c XE:-
  1. The Installer released by Oracle is only meant for 64-bit (x86_64) systems.
  2. It will consume, at most, processing resources equivalent to two CPUs.
  3. Only one installation of Oracle Database XE can be performed on a single computer.
  4. The maximum amount of user data in an Oracle Database XE database cannot exceed 12 GB.
  5. The maximum amount of RAM that Oracle XE uses cannot exceed 2 GB, even if more is available.

Now the steps for Installation for Oracle 21c XE:

1) Download the installer file named as "Oracle Database 21c Express Edition for Linux x64 (OL7)" (Size : approximate 2.2 GB) from the Oracle Website link given below:
https://www.oracle.com/database/technologies/xe-downloads.html

2) Switch to root user

sudo -s

3) Install the Database Preinstallation RPM . The Database Preinstallation RPM automatically creates Oracle installation owner and groups and sets up other kernel configuration settings as required for Oracle installations.

curl -o oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm
yum -y localinstall oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm
4) Install the Database software
yum -y localinstall oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm

5) Check your machine name
hostname
6) Edit the /etc/hosts file to include entry for your machine using the output of previous command

Sample File (before editing) :-
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1            localhost localhost.localdomain localhost6 localhost6.localdomain6

Sample File (after editing):- here "mymachine" is your machine name
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 mymachine
::1            localhost localhost.localdomain localhost6 localhost6.localdomain6
7) Configure the Oracle 21c XE installation
/etc/init.d/oracle-xe-21c configure

At the prompt, specify a single password for the SYS, SYSTEM, and PDBADMIN administrative user accounts. The same password will be used for these accounts.  Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

After the configuration completes, the database and listener are started. 

8) add your user to oinstall group (here username is your user ID)

usermod -aG oinstall username

9) Exit from root shell 
exit

and then run below commands one by one to set environment variables for your username

echo 'export ORACLE_HOME=/opt/oracle/product/21c/dbhomeXE' >> .bashrc

echo 'export PATH=$PATH:$ORACLE_HOME/bin' >> .bashrc

echo 'export ORACLE_SID=XE' >> .bashrc

echo 'export ORACLE_BASE=/opt/oracle' >> .bashrc

echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH' >> .bashrc

10) Logout and login again to make environment variables active. That's all and you are ready to begin your journey with Oracle 21c XE database.