Installation of Oracle database 19c on Virtual Box
Table of Contents:
Phase 1: Download Oracle Virtual Box ........................................................................................... 2
Phase 2: Prepare the Server for secure ssh connection for MobaXterm ..................................... 12
Phase 3: Oracle Database 19c Installation .................................................................................... 15
Phase 4: Download Oracle Linux 7.9 version (V1009690-01)....................................................... 18
Phase 5: Run Installer (GUI) .......................................................................................................... 21
Phase 6: Creating a Database ....................................................................................................... 31
Phase 7: Practice Session: ............................................................................................................. 50
Installation of Oracle Database 19c on Virtual Box.
Phase 1: Download Oracle Virtual Box
Continuation:
• Go back to Oracle virtual box: Click on machine Click on New
• Name: Oracledb19c
• Folder: Set a new folder name as (OracleVM)
• ISO image: attach the iso image
• Set Pw and username
Note:
Ram allocation: 4 GB
Storage: 60 GB
No of CPU: 2
Specify virtual Hardware:
Specify Virtual Hard disk:
Click Finish.
Click on settings: Change to Bidirectional (for copy & paste)
Click on system: click on Optical on the 1st location
Click on Network: Need to provide identity
Note: Set one Adapter to Host only & other to Bridge.
Click on ok & start
Login as root: root
(Enable GUI)
Command: yum groupinstall "Server with GUI" -y
Check: systemctl set-default [Link]
Then Reboot it.
OS fully Installed
Verify installation: Go to Application & then to Terminal
Command: lsblk
Phase 2: Prepare the Server for secure ssh connection for MobaXterm
Step 1- Ensure SSH is installed
Command: yum install -y openssh-server
Step 2- Start SSH service
Command: systemctl start sshd
systemctl enable sshd
systemctl status sshd
Step 3: Check firewall (IMP- Oracle linux may block SSH)
Command: systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
IP Check: ip a
Note: Insert the same IP in mobaXTERM
Step4: Open MobaXTERM
Go to Session – SSH – Advanced SSH settings – re-write your IP address
Phase 3: Oracle Database 19c Installation
Step 1: Preinstall validation
Switch to root:
Command: su -
yum install -y oracle-database-preinstall-19c
Note: In pre-installation oracle user and necessary groups will be auto created that’s the major features
of preinstallation.
Verify: id oracle
Set Password:
Command: passwd oracle
*********
Now login as an oracle user.
Command: su - oracle
Step 2: Environment setup (.bash_profile) (This tells linux – Where Oracle is installed/Which database
instance to use/How to run Oracle commands)
Command: vi .bash_profile
# .bash_profile
# Load bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User PATH
PATH=$PATH:$HOME/.local/bin:$HOME/bin
# ===== Oracle Environment =====
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
export ORACLE_SID=ORCLCDB
export PATH=$PATH:$ORACLE_HOME/bin
# =============================
export PATH
:wq!
Explanation:
export ORACLE_BASE=/u01/app/oracle
-This is the root directory for oracle
-Oracle follows a standard structure(OFA):
/u01/app/oracle/
I----product/ -software
I----oradata/ -database files
I----diag/ -logs
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
-This is the exact location where Oracle software is installed. It contains binaries (sqlplus/dbca/lsnrctl).
It also contains libraries & config files
export ORACLE_SID=ORCL
-This is database instance name. Oracle can have multiple database instance & this tells system which
database instance are we working with.
export PATH=$PATH:$ORACLE_HOME/bin
-Adds oracle commands to system path. Without this sqlplus/dbca/lsnrctl won’t work. Afterwards we
can run commands from anywhere.
Save the changes
Command: source .bash_profile
Verify:
echo $ORACLE_HOME
echo $ORACLE_SID
echo $ORACLE_BASE
Result:
Step 3: Create the required directory
Command: su -
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01
chmod -R 775 /u01
chmod 775 /u01/app/oraInventory
Verify structure: ls -ld /u01/app/oracle
ls -ld /u01/app/oracle/product/19.0.0/dbhome_1
ls -ld /u01/app/oraInventory
Phase 4: Download Oracle Linux 7.9 version (V1009690-01)
Step 1: Download Oracle Database 19c from edeliveries and upload it accordingly via MobaXTERM.
Upload the same in the correct directory: /u01/app/oracle/product/19.0.0/dbhome_1
Command: unzip LINUX.X64_193000_db_home.zip
Note: We run those commands to move Oracle installer files directly into ORACLE_HOME and
remove the extra folder, because the installer must be located at $ORACLE_HOME/runInstaller to
work properly.
Command: mv LINUX.X64_193000_db_home/* .
rm -rf LINUX.X64_193000_db_home
Step 2: Configure Hostname Resolution
Note 1: Purpose: To ensure that the server hostname correctly resolves to its assigned IP address, which
is required for successful Oracle Database 19c installation.
Note 2: Check current hostname
Command: Hostname
Edit :
vi /etc/hosts
Note 3: Add the following entry.
[Link] [Link] Oracledb19c
Note 4: Check if it’s working or not.
Phase 5: Run Installer (GUI)
Command: ./runInstaller
Note: Software installation is completed now for database installation we do DBCA.
Phase 6: Creating a Database
Command: dbca
Note: Open a duplicate Terminal & Add a DB_UNIQUE_NAME = orcl (It’s on the next step)
Vi .bash_profile
Source .bash_profile
This creates:
• [Link] config file
• background listener service
• network entry point
The click Next.
Click Finish
Done!!
Phase 7: Practice Session:
1. Connect to database: sqlplus / as sysdba
Note: If you see connected to idle instance, then it means the database is not running. So, we need to
start the database.
2. To start the database
Command: startup
3. To se weather the database is up & running, we can simply fire a command like:
Command: select name,open_mode from V$database;
Note: The name of the database is ORCL and the current status is read write which means the database
is running.
The V$database is the metadata table which is available in the oracle database.
4. If we need to shutdown the database.
Command: shutdown immediate;
5. To check if your instance is running or not.
Command: ps -ef | grep pmon
Thank you!!