Creating An Oracle 19c RAC Database: Practice 19-b
Creating An Oracle 19c RAC Database: Practice 19-b
Creating An Oracle 19c RAC Database: Practice 19-b
Practice 19-b
Practice Overview
In this practice you will create an Oracle 19c two-node RAC database on the virtual machines that you
created in the previous practice. To accomplish this target, you will perform the following:
Note:
The virtual appliances created by this practice are available to download from my web site at the
following link: https://www.ahmedbaraka.com/a027-oracle-rac-database-19c-on-linux-7
1. In a Putty session, login to srv1 and srv2 as oracle user. Set the OS environment variables in
the oracle user profile:
su - oracle
mv ~/.bash_profile ~/.bash_profile_bk
vi ~/.bash_profile
# .bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
2. In the .bash_profile file of the oracle account in srv2, change the value assigned to
ORACLE_SID from rac1 to rac2
3. In the terminal sessions connected to srv1 and srv2, switch to grid user.
su - grid
4. In srv1 and srv2, set the OS environment variables in the grid user profile:
mv ~/.bash_profile ~/.bash_profile_bk
vi ~/.bash_profile
# .bash_profile
# OS User: grid
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# it must not be under the ORACLE_BASE
ORACLE_HOME=/u01/app/19.0.0/grid; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.:${PATH}:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
export PATH
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
5. In .bash_profile file of the grid account in srv2, change the value assigned to ORACLE_SID from
+ASM1 to +ASM2.
B. Set the resource limits for the Oracle software installation owners
6. In srv1 and srv2, switch user to root and set the resource limits for the software installation
owner users.
# take backup of existing file:
mv /etc/security/limits.conf /etc/security/limits.conf.bak
In the following steps, you will perform some actions that should be performed before installing Oracle
software.
7. In srv1 and srv2, disable avahi-daemon. This daemon should not be running with Oracle
clusterware services.
systemctl disable avahi-daemon.socket avahi-daemon.service
systemctl mask avahi-daemon.socket avahi-daemon.service
systemctl stop avahi-daemon.socket avahi-daemon.service
8. In srv1 and srv2 as root, disable the chronyd service and rename its configuration file.
9. 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
10. In srv1, change the current user to grid then 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
>/dev/null
cd /u01/app/19.0.0/grid/cv/rpm/
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -iv cvuqdisk-1.0.10-1.rpm
14. 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
Failure Isolation select "Do not use Intelligent Platform Management Interface
(IPMI)"
The log file has details of the error causes. The following causes
can be safely ignored:
- Sufficient physical memory is not available on node ...
- Sufficient swap size is not available on node ...
- Group of device "/dev/oracleasm/disks/DISK1" did not
match the expected group
- Attempt to get udev information from node ...
16. In srv1, as grid, check the status of the running clusterware resources. The state of all the
resources should be ONLINE.
crsctl status resource -t
17. Ensure that all the cluster services are up and running in all the cluster nodes.
crsctl check cluster -all
Note: in real life scenario, you are always advised to apply the latest patch set on the grid software
home straight away after installing it. You will learn how to apply a PSU on Oracle Grid Infrastructure
later in the course.
In this section of the practice, you will mount the DATA and FRA diskgroups in ASM.
18. In the Oracle VirtualBox window, make sure you are logged on as grid to srv1.
asmca
22. In the Disk Group Name field enter DATA, for Redundancy select "External", and mark DISK2,
then click on OK button. You should see after a few seconds a diskgroup creation success
message.
24. Eventually, the asmca window should look like the following screenshot. All the diskgroups must
be mounted and see by the two nodes.
26. In the Oracle VirtualBox window, logout from srv1 and login as oracle.
27. Open a terminal window then create the sqlnet.ora file and add the following code in it.
mkdir -p $ORACLE_HOME/network/admin
vi $ORACLE_HOME/network/admin/sqlnet.ora
DIAG_ADR_ENABLED=ON
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
29. In the Putty session of srv1, 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 >>
/dev/null
30. In the VirtualBox window of srv1, change the current directory to the Oracle database home
directory and run the runInstaller script.
cd $ORACLE_HOME
./runInstaller
Operating System select oinstall group for all the options except OSOPER keep it blank
Groups
Root Script Execution Mark the checkbox “Automatically run configuration scripts”
and enter the root password
Note: If you receive other warnings, check their details. Resolve the
issue and click on "Check Again" button.
Finish Just before finishing the installation, the Installer will prompt for a
message to run the configuration scripts. Just click on Yes button
click on Close button
Note: as is the case with Oracle grid software, it is recommended to apply the latest patch sets on the
Oracle software straight away after installing it. This is much faster than applying them after creating
the database.
32. In the Oracle VirtualBox window, make sure you are logged on as oracle.
Note: observe that you do not create a listener in oracle home. The listener starts up from the grid
home and controlled by the clusterware.
Database Template Make sure the Database Type is Oracle Real Application Clusters
(RAC) database
Change the Configuration Type to Admin Managed
Make sure that the General Purpose or Transaction Processing
option is selected.
Fast Recovery Option Mark the checkbox “Specify Fast Recovery Option”
Change the following field:
Fast Recovery Area: FRA+
Fast Recovery Area Size: 12 GB
Keep “Enable Archiving” checkbox unmarked
Management Options Unmark the "Run Cluster Verification Utility (CVU) Checks
Periodically" checkbox
Mark the "Configure Enterprise Manager (EM) Database
Express" checkbox
In the end of the installation, you should see a message like the following:
In this section of the practice, you will perform some initial checking on the created RAC database.
36. Make sure that the SCAN hostname replies to ping command.
ping -c 3 srv-scan
38. Login as sysdba to the database and examine the contents of v$active_instances
sqlplus / as sysdba
col inst_name format a50
SELECT INST_NUMBER , INST_NAME FROM V$ACTIVE_INSTANCES;
39. Make sure the tnsnames.ora file has been configured for connecting to rac database. This has
automatically been done by the dbca utility.
cat $TNS_ADMIN/tnsnames.ora
40. 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 the write access on the XDB wallet. You
will fix this issue in the next step.
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
41. In srv1 and srv2, as root, 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/rac/xdb_wallet
42. 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.
43. Explore the EM Express. When you are done, close the browser.
44. Restart the machines and make sure the database is automatically started after the reboot.
Summary
Note:
The virtual appliances created by this practice is available to download from my web site at the
following link:
http://ahmedbaraka.com/public/download/