Installation
Notes for installing Oracle Database...
Determine Linux Version
First determine which version of Linux you're using...
cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.9 (Ootpa)"
...
Database Preinstall
Add Database Preinstall for Your Version of Linux
curl -o oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
yum -y localinstall oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
Update User Privileges
The Oracle Database Preinstall will create an 'oracle' user. Set the password and add 'oracle' to the 'wheel' group, so it can use 'sudo'.
usermod -aG wheel username
passwd oracle
Configure SELinux
Set SELinux to "permissive".
sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
sudo setenforce Permissive
Configure Firewall
Let's open necessary ports in the firewall.
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-service=snmp
sudo firewall-cmd --permanent --add-port=1521/tcp
sudo firewall-cmd --permanent --add-port=5500/tcp
sudo systemctl restart firewalld
Download Oracle Database
Oracle Database can be found at https://edelivery.oracle.com.
On the checkout page, Oracle provides a handy script for downloading the binaries with 'wget'.
Starting with 18c, Oracle has created and RPM to simplify installation in single-node systems.
The RPM can be found at: https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
Install Oracle Database
Easy Installation Method
To install and configure the RPM version:
sudo yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
To configure a general purpose database and TNS Listener, execute the command:
sudo /etc/init.d/oracledb_ORCLCDB-19c configure
Modify this script if you would like to change some of the default values.
Make sure the database and TNS listener will start on system reboot:
sudo chkconfig /etc/init.d/oracledb_ORCLCDB-19c on
Enable the database(s) in 'oratab'.
sudo sed -i 's/\:N/\:Y/g' /etc/oratab
I like to create a file called oracle.sh in the /etc/profile.d/ directory with these environment variables:
export ORACLE_SID=ORCLCDB
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
The 'sys' and 'system' passwords have been automatically generated. As the 'oracle' user, connect like this:
sqlplus / as sysdba
Change the 'sys' and 'system' passwords (if you want to) using this command:
ALTER USER user_name IDENTIFIED BY new_password;
Congratulations! You have successfully installed and configured an Oracle database.
Below are some alternate methods for installing the database.
Graphical Installer Method
Create software installation directory:
mkdir -p /u01/app/oracle/product/21c
Unzip the downloaded file to that directory:
unzip V1011496-01.zip -d /u01/app/oracle/product/21c
Run the installer:
./runInstaller
Choose, install software only and follow the prompts.
If you're having problems running the graphical installer, check that X11 forwarding is turned on:
sudo cat /etc/ssh/sshd_config | grep -i X11Forwarding
If no, set it to yes and restart sshd:
sudo service sshd restart
If using Windows 'putty', install 'xming' and configure it.
Additionally...
Use './runInstaller.sh' to install the software.
Use 'dbca' to create a new database.
Use 'netca' to configure the TNS Listener.
Configure startup scripts.
Silent Install Method
run 'dbca' to create database.
export PASSWD="p@ssw0rd"
export SID=orcl
dbca -silent \
-createDatabase \
-templateName General_Purpose.dbc \
-sid $SID \
-gdbname $SID.$HOSTNAME \
-responseFile NO_VALUE \
-characterSet AL32UTF8 \
-memoryPercentage 70 \
-emConfiguration NONE \
-sysPassword $PASSWD \
-systemPassword $PASSWD
The 'netca' application should have a 'silent' option too...
Let's figure out how that works!