Installing and Creating An Oracle Database 19c On Linux 7 With ASM
Installing and Creating An Oracle Database 19c On Linux 7 With ASM
Tutorial:
By Ahmed Baraka
Tutorial Overview
In this tutorial, we will demonstrated the procedure to create an Oracle database 19c on Linux 7 with
ASM.
• Set up the environment variables for the OS Accounts: grid and oracle
Required Resources
• A PC with a free 8GB in its memory. This means the RAM memory in your PC should be at least
12GB.
Installation Architecture
The tutorial builds a system the same as the following architecture diagram:
• Oracle VirtualBox, version 6. This tutorial was implemented on VirtualBox 6.0.22 for Windows. It
can be obtained from the following link.
• Oracle Virtualbox appliance with a fresh installation of Oracle Linux 7.x. You can download a
pre-built one with Oracle Linux 7.8 from here.
Alternatively, you can create one from scratch. The procedure to create an VM machine with Linux
7.x is explained in many articles in the Internet. Just Google it!
• Oracle Grid Infrastructure 19c installation files for Linux x86-64. This can be downloaded from
Oracle site. Search the Internet for “oracle grid infrastructure 19c download”. At the time of this
writing, its link is here. This tutorial was implemented using Oracle Grid Infrastructure 19c (version
19.3).
• Oracle Database 19c installation files for Linux x86-64. This can be downloaded from Oracle site.
Search the Internet for “Oracle Database 19c installation files for Linux x86-64”. At the time of this
writing, its link is here. This tutorial was implemented using Oracle Database 19c ( version 19.3)
for Linux x86-64.
• Putty: which is a utility that provides a command line prompt to connect to a Linux server from
Windows.
Tutorial Steps
1. In VirtualBox Manager, open the "Settings" of srv1, click on "Shared Folders" link in the right-
hand pane. Add shared folder by pressing "plus" icon. Then select path to the location of the
oracle software installation folder, and mark the checkbox "Auto-mount". You can change the
"Folder Name", if you want to.
This folder will be used to easily exchange files between the hosting PC and Linux in the VM
machine. In the rest of this tutorial document, this folder will be referred to as the staging
folder.
2. Make sure the Network adapter type Bridged Adapter and its name is the same as the network
card of your PC. This makes your VM appliance appears in your network as a separate host and
will be assigned an IP address based on your network configuration.
f. Perform the same steps again to create the DATA disk, of size 40 GB. You should end up with
having two disks as follows:
g. Optionally, set a description for the appliance and change its name to “Oracle 19c DB+ASM”
4. Start srv1
6. Open a terminal window, issue ifconfig command, and obtain the current IP address assigned to
the machine. It is the IP address assigned to the NIC enp0s3
9. Click on IPv4 tab, select the Manual option, then enter the IP address and DNS information.
Then click on Apply button.
10. In the Terminal window, ping the IP address to make sure that the changes are successful.
11. Edit the /etc/hosts file and add the hostname and the IP address to it.
vi /etc/hosts
192.168.1.127 srv1.localdomain srv1
12. Verify that the changes are registered in the NIC configuration file.
cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
14. In the hosting PC, open a command line window and make sure you can ping the IP address of
srv1.
Note: Make sure the firewall in your PC allows communication with Oracle VirtualBox.
C:\> ping 192.168.1.127
D. Configuring Putty
In the following steps, you will configure Putty to connect to srv1
15. Open Putty then enter the IP address of srv1 in the Host Name field.
19. In the Putty session, switch current user to oracle and make a backup copy of the current bash
profile file:
su - oracle
mv ~/.bash_profile ~/.bash_profile_bkp
# OS User: oracle
# Application: Oracle Database Software Owner
# Version: Oracle 19c
# ---------------------------------------------------
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/.local/bin:$HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
PATH=.:${PATH}:$ORACLE_HOME/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
22. Switch current user back to root then run the following code to create required groups, grid
user and modify the accounts.
su -
groupadd asmadmin
groupadd oinstall
groupadd asmdba
usermod -g oinstall oracle
usermod -a -G asmdba oracle
useradd -u 54323 -g oinstall -G asmadmin,asmdba grid
passwd grid
25. Switch to grid user and modify its bash profile as follows:
su - grid
mv ~/.bash_profile ~/.bash_profile_bkp
vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/19.0.0/grid; export ORACLE_HOME
In the following steps, you will install ASM packages then create ASM disk volumes.
28. Configure and load the ASM kernel module. Respond to the command as illustrated by the code
in red color.
oracleasm configure -i
30. List the disks as seen by the OS. You should see the disks created in the VirtualBox and attached
to the appliance.
fdisk -l | grep "Disk /dev/sd"
In the following step, you will change the kernel parameter values to the values recommended by
Oracle.
34. Create the following file then add the code that follows to it.
vi /etc/sysctl.d/97-oracle-database-sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
In the following step, you will install further packages in srv1 that are required by Oracle Grid
Infrastructure and database software.
38. Run the following code to install further packages required by Oracle software.
yum install ksh
yum install libaio-devel.x86_64
In the following steps, you will install Oracle Grid Infrastructure software in srv1. The installation
procedure automatically creates and start the Clusterware services.
39. Copy the Oracle Grid Infrastructure software installation file to the staging folder.
At the time of this writing, the installation file name downloaded from Oracle site is
LINUX.X64_193000_grid_home.zip
40. Extract the installation file into the Oracle Grid Infrastructure software home directory
su - grid
unzip /media/sf_staging/LINUX.X64_193000_grid_home.zip -d $ORACLE_HOME
cd /u01/app/19.0.0/grid/cv/rpm/
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -iv cvuqdisk-1.0.10-1.rpm
43. Open a terminal window, change the current directory to the Grid Infrastructure software home
directory and run the gridSetup.sh script.
cd $ORACLE_HOME
./gridSetup.sh
Window Action
Configuration Option
Select the following option:
Redundancy: External
Select Disks: OCRDISK1
Operating System Make sure the following are the selected values:
Groups
OSASM: asmadmin
OSDBA: asmdba
Installation Location Oracle Base and Oracle Grid Home should automatically point to
the values of their corresponding variables.
Note: Observe the grid home is not under the Oracle grid base
home.
Root Script Execution Mark the checkbox “Automatically run configuration scripts”
and enter the root password
Prerequisite Checks All the Prerequisite Checks should pass except the memory. It
complains the available memory is 7.5. We can ignore this
warning.
Select Ignore All checkbox then click on Next button.
Click Yes on the confirmation dialog box.
Note: If you see other warnings, you have to resolve them
before you proceed.
Install Product When the installation reaches to nearly 11%, it will display a
confirmation message. Click on Yes button.
In the following steps, you will create the Diskgroup that will be used by Oracle database to store its
datafiles.
Note: In real life scenario, we might create more than one disk group. For example, one for the data
files and one for the FRA.
47. Create the disk group DATADISK by responding to the Assistant as follows:
In the following steps, you will install Oracle database software in srv1 and create the database.
48. Copy the Oracle database software installation file to the staging folder.
At the time of this writing, the installation file name downloaded from Oracle site is
LINUX.X64_193000_db_home.zip
49. In the Putty session, change the current user to oracle then extract the installation file into the
Oracle database software home directory
su - oracle
unzip /media/sf_staging/LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
50. Logout from the VirtualBox window and login to it again as oracle
51. Open a terminal window, change the current directory to the Oracle database home directory and
run the runInstaller script.
cd $ORACLE_HOME
./runInstaller
Window Action
“Server Class”
“Enterprise Edition”
Operating System Select the “oinstall” group for all the options, except the
Groups OSOPER keep it blank.
Root Script Execution Mark the checkbox “Automatically run configuration scripts”
and enter the root password
Install Product When the installation reaches to nearly 12%, if will display a
confirmation message. Click on Yes button.
53. After the installation and database creation are finished, verify the database is up and running by
logging to it as sysdba
sqlplus / as sysdba
54. Check the status of the database (can be run as oracle or as grid)
srvctl status database -d oradb
56. In the VirtualBox window of srv1, start the Firefox browser and open the EM Express using the
following URL
The browser returns the error “Secure Connection Failed”. This error is generated because the
listener runs as grid user and this user does not have write access to XDB wallet. You will fix this
issue in the next tutorial section.
https://srv1:5500/em
Note: Following is a reference for EM Express known issues and how to resolve them:
Doc ID 1604062.1 : Troubleshooting Why EM Express is not Working
57. In the Putty session, run the following command to grant permission on the XDB wallet to the
gird user:
XDB wallet folder can be obtained from the output of the lsnrctl status
setfacl -R -m u:grid:rwx /u01/app/oracle/product/19.0.0/db_1/admin/oradb/xdb_wallet
58. Try opening the EM Express on the browser. Accept the warning displayed by the browser. Enter
the sys username, its password, leave the container name blank then click on Login button.
59. Explore the EM Express. When you are done, close the browser.
60. Restart the machine. Then make sure the database is automatically started up after the VM is
rebooted.
Summary
Note: The appliance created by me in this tutorial can be downloaded from the following link:
http://www.ahmedbaraka.com/public/download/