0% found this document useful (0 votes)
31 views59 pages

Oracle Database 19c RAC Installation on OL7

Uploaded by

rashokkumar82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views59 pages

Oracle Database 19c RAC Installation on OL7

Uploaded by

rashokkumar82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Oracle Database 19c RAC Installation on

Oracle Linux 7.4 (VirtualBox on Windows)


by Biondi Septian S
Part 2 Setup ACFS, Download and Install Oracle DB Software, Create
Database, Verify Database, Setup Environment Variables

Prerequisites
- Notebook or PC with a minimum 16 GB of RAM
- Storage with 200 GB (SSD)
- VirtualBox 7.0 or later (https://www.virtualbox.org/wiki/Downloads)
- Oracle Linux 7.4 x86 64 bit
- Internet Connectivity
- Oracle SSO Account for downloading the softwares
- Oracle Database 19c RAC Installation on Oracle Linux 7.4 (VirtualBox on Windows) Part 1

Architecture
● Host OS: Windows 10
● Guest OS: Oracle Linux 7.4 x86 64 bit
● Nodes: biz01, biz02

● IP Address Lists:
# Public IP
192.168.56.100 biz01
192.168.56.101 biz02

# Private IP
192.168.10.100 biz01-priv
192.168.10.101 biz02-priv

# Virtual IP
192.168.56.110 biz01-vip
192.168.56.111 biz02-vip

# SCAN IP
192.168.56.120 biz-scan
192.168.56.121 biz-scan
192.168.56.122 biz-scan
● Storage:
biz01: 30 GB
biz02: 30 GB
ASM1 (OCR): 40 GB
ASM2 (DATA): 7.5 GB
ASM3 (FRA): 7.5 GB
ASM4 (ACFS): 25 GB

● RAM:
biz01: 4096 MB
biz02: 4096 MB

● CPU:
biz01: 2 core
biz02: 2 core

● Database: bizdb
● Instances: bizdb1, bizdb2
● PDB: itpdbdev

Steps

1. Setting Up ACFS for Oracle Database

Create Directory Structure For ACFS as Root User on Both Nodes


[root@biz01 ~]# cd /
[root@biz01 /]# mkdir acfs
[root@biz01 /]# ssh root@biz02
root@biz02's password:
Last login: Mon Mar 13 17:40:13 2023
[root@biz02 ~]# cd /
[root@biz02 /]# mkdir acfs
[root@biz02 /]# exit
logout
Connection to biz02 closed.

Setup ASM Diskgroup, Volume, and ACFS File System Using ASMCA
Logout from root and login to grid and open Terminal:
[grid@biz01 ~]$ export DISPLAY=:0.0
[grid@biz01 ~]$ . oraenv
ORACLE_SID = [grid] ? +ASM1
ORACLE_HOME = [/home/oracle] ? /u01/app/19.3.0/grid
The Oracle base has been set to /u01/app/grid
[grid@biz01 ~]$ asmca
Click Create.

Click OK.
Click Create.
Click OK.
Click Create.
Click OK.
Open terminal and change to root to execute the acfs_script.sh above. This script is intended to
integrate the ACFS with GI and to mount the ACFS. This script needs to be run only on Node 1(biz01) :

[root@biz01 ~]# /u01/app/grid/cfgtoollogs/asmca/scripts/acfs_script.sh


ACFS file system /acfs is mounted on nodes biz01,biz02
Click Exit.

Check ACFS Already Mounted:


[root@biz01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 845M 1.2G 43% /dev/shm
tmpfs 2.0G 9.2M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mapper/ol_biz01-root 26G 16G 11G 59% /
/dev/sda1 1014M 199M 816M 20% /boot
software 476G 321G 156G 68% /media/sf_software
tmpfs 396M 24K 395M 1% /run/user/54322
/dev/sr0 51M 51M 0 100% /run/media/grid/VBox_GAs_7.0.6
tmpfs 396M 0 396M 0% /run/user/0
/dev/asm/acfs_vol-153 25G 599M 24G 3% /acfs
2. Download Oracle Database 19c Software From eDelivery

Click on V982063-01.zip to download. Save file to the shared_folder C:\software.


Change User to Oracle and Create New Directory for Oracle Home under /acfs/:
[root@biz01 ~]# su - oracle
Last login: Mon Mar 13 21:33:10 WIB 2023 on :4
[oracle@biz01 ~]$ cd /acfs/
[oracle@biz01 acfs]$ mkdir -p product/19.3.0/dbhome_1
[oracle@biz01 acfs]$ ll
total 116
drwx------ 2 root root 65536 Mar 13 19:41 lost+found
drwxr-xr-x 3 oracle oinstall 20480 Mar 13 22:00 product

Unzip the Oracle 19c software into directory /acfs/product/19.3.0/dbhome_1:


[oracle@biz01 acfs]$ cd /media/sf_software
[oracle@biz01 sf_software]$ ll
total 2988032
drwxrwx--- 1 root vboxsf 12288 Mar 13 21:06 Linux_x64_1930_db_installer
drwxrwx--- 1 root vboxsf 0 Mar 13 09:08 Linux_x64_1930_grid_installer
-rwxrwx--- 1 root vboxsf 20684 Mar 4 14:32 oracleasmlib-2.0.15-1.el7.x86_64.rpm
-rwxrwx--- 1 root vboxsf 3059705302 Mar 13 20:24 V982063-01.zip
[oracle@biz01 sf_software]$ unzip V982063-01.zip -d /acfs/product/19.3.0/dbhome_1/
….
….
finishing deferred symbolic links:
/acfs/product/19.3.0/dbhome_1/bin/lbuilder -> ../nls/lbuilder/lbuilder
/acfs/product/19.3.0/dbhome_1/lib/libocci.so -> libocci.so.19.1
/acfs/product/19.3.0/dbhome_1/lib/libagtsh.so -> libagtsh.so.1.0
/acfs/product/19.3.0/dbhome_1/lib/libodm19.so -> libodmd19.so
/acfs/product/19.3.0/dbhome_1/lib/libclntsh.so -> libclntsh.so.19.1
/acfs/product/19.3.0/dbhome_1/lib/libjavavm19.a -> ../javavm/jdk/jdk8/lib/libjavavm19.a
/acfs/product/19.3.0/dbhome_1/javavm/lib/jce.jar -> ../../javavm/jdk/jdk8/lib/jce.jar
/acfs/product/19.3.0/dbhome_1/lib/libocci.so.18.1 -> libocci.so
/acfs/product/19.3.0/dbhome_1/lib/libclntshcore.so -> libclntshcore.so.19.1
/acfs/product/19.3.0/dbhome_1/jdk/bin/ControlPanel -> jcontrol
/acfs/product/19.3.0/dbhome_1/javavm/admin/cbp.jar -> ../../javavm/jdk/jdk8/admin/cbp.jar
/acfs/product/19.3.0/dbhome_1/lib/libclntsh.so.10.1 -> libclntsh.so
/acfs/product/19.3.0/dbhome_1/lib/libclntsh.so.11.1 -> libclntsh.so
/acfs/product/19.3.0/dbhome_1/lib/libclntsh.so.12.1 -> libclntsh.so
/acfs/product/19.3.0/dbhome_1/lib/libclntsh.so.18.1 -> libclntsh.so
/acfs/product/19.3.0/dbhome_1/precomp/public/SQLCA.H -> sqlca.h
/acfs/product/19.3.0/dbhome_1/precomp/public/SQLDA.H -> sqlda.h
/acfs/product/19.3.0/dbhome_1/precomp/public/ORACA.H -> oraca.h
/acfs/product/19.3.0/dbhome_1/precomp/public/SQLCA.COB -> sqlca.cob
/acfs/product/19.3.0/dbhome_1/precomp/public/ORACA.COB -> oraca.cob
/acfs/product/19.3.0/dbhome_1/javavm/admin/classes.bin -> ../../javavm/jdk/jdk8/admin/classes.bin
/acfs/product/19.3.0/dbhome_1/javavm/admin/libjtcjt.so -> ../../javavm/jdk/jdk8/admin/libjtcjt.so
/acfs/product/19.3.0/dbhome_1/jdk/jre/bin/ControlPanel -> jcontrol
/acfs/product/19.3.0/dbhome_1/javavm/admin/lfclasses.bin -> ../../javavm/jdk/jdk8/admin/lfclasses.bin
/acfs/product/19.3.0/dbhome_1/javavm/lib/security/cacerts ->
../../../javavm/jdk/jdk8/lib/security/cacerts
/acfs/product/19.3.0/dbhome_1/javavm/lib/sunjce_provider.jar ->
../../javavm/jdk/jdk8/lib/sunjce_provider.jar
/acfs/product/19.3.0/dbhome_1/javavm/lib/security/README.txt ->
../../../javavm/jdk/jdk8/lib/security/README.txt
/acfs/product/19.3.0/dbhome_1/javavm/lib/security/java.security ->
../../../javavm/jdk/jdk8/lib/security/java.security
/acfs/product/19.3.0/dbhome_1/jdk/jre/lib/amd64/server/libjsig.so -> ../libjsig.so

3. Install Oracle Database 19c


[oracle@biz01 ~]$ cd /acfs/product/19.3.0/dbhome_1
[oracle@biz01 dbhome_1]$ ./runInstaller
Ignore errors above because they are only related to clock and NTP. Tick Ignore All.
Wait until the installer finishes.
4. Create ASM Disk Groups for +DATA and +FRA
Login as grid user:
[grid@biz01 ~]$ . oraenv
ORACLE_SID = [grid] ? +ASM1
ORACLE_HOME = [/home/oracle] ? /u01/app/19.3.0/grid
The Oracle base has been set to /u01/app/grid
[grid@biz01 ~]$ asmca
Click Create.

Click OK.
Click OK.
Click Exit.
5. Create Database Using DBCA
Login as oracle user:
[oracle@biz01 ~]$ cd /acfs/product/19.3.0/dbhome_1/bin
[oracle@biz01 bin]$ ./dbca
Click Browse on Database files location:
Select DATA and click OK.
Ignore the error, it’s because we’re just using 4 GB as our FRA since this is a testing project. Click
Yes.
Ignore and click Yes.
Wait until the process finishes.
This will take 1 to 1.5 hours to finish since we’re using a low CPU and a low amount of RAM.
6. Verify Database Status

Using SRVCTL

[oracle@biz01 ~]$ . oraenv


ORACLE_SID = [oracle] ? bizdb1
ORACLE_HOME = [/home/oracle] ? /acfs/product/19.3.0/dbhome_1
The Oracle base has been set to /acfs/app/oracle
[oracle@biz01 ~]$ srvctl status database -d bizdb
Instance bizdb1 is running on node biz01
Instance bizdb2 is running on node biz02
[oracle@biz01 ~]$ srvctl config database -d bizdb
Database unique name: bizdb
Database name: bizdb
Oracle home: /acfs/product/19.3.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/BIZDB/PARAMETERFILE/spfile.272.1131458129
Password file: +DATA/BIZDB/PASSWORD/pwdbizdb.256.1131455683
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: FRA,DATA
Mount point paths: /acfs
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dba
Database instances: bizdb1,bizdb2
Configured nodes: biz01,biz02
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed

USING SQLPLUS

[oracle@biz01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 14 14:41:06 2023


Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> set time on;

14:48:37 SQL> select dbid, name, cdb, db_unique_name, open_mode, force_logging, created
from v$database;

DBID NAME CDB DB_UNIQUE_NAME OPEN_MODE


---------- --------- --- ------------------------------ --------------------
FORCE_LOGGING CREATED
--------------------------------------- ---------
3873262943 BIZDB YES bizdb READ WRITE
NO 14-MAR-23

VIEWING PDB STATUS


[oracle@biz01 ~]$ sqlplus / as sysdba
SQL> COLUMN PDB_NAME FORMAT A15
SQL> SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;

PDB_ID PDB_NAME STATUS


---------- --------------- ----------
2 PDB$SEED NORMAL
3 ITPDBDEV NORMAL

VIEWING PDB DATA FILES IN CDB


SQL> COLUMN PDB_ID FORMAT 999
SQL> COLUMN PDB_NAME FORMAT A8
SQL> COLUMN FILE_ID FORMAT 9999
SQL> COLUMN TABLESPACE_NAME FORMAT A10
SQL> COLUMN FILE_NAME FORMAT A45
SQL> SELECT p.PDB_ID, p.PDB_NAME, d.FILE_ID, d.TABLESPACE_NAME, d.FILE_NAME
2 FROM DBA_PDBS p, CDB_DATA_FILES d
3 WHERE p.PDB_ID = d.CON_ID
4 ORDER BY p.PDB_ID;

PDB_ID PDB_NAME FILE_ID TABLESPACE FILE_NAME


------ -------- ------- ---------- ---------------------------------------------
3 ITPDBDEV 10 SYSTEM +DATA/BIZDB/F6D7E8209D587F75E0536538A8C0A5F4/
DATAFILE/system.274.1131458965

3 ITPDBDEV 11 SYSAUX +DATA/BIZDB/F6D7E8209D587F75E0536538A8C0A5F4/


DATAFILE/sysaux.275.1131458965

3 ITPDBDEV 14 USERS +DATA/BIZDB/F6D7E8209D587F75E0536538A8C0A5F4/


DATAFILE/users.278.1131459017

3 ITPDBDEV 13 UNDO_2 +DATA/BIZDB/F6D7E8209D587F75E0536538A8C0A5F4/


DATAFILE/undo_2.277.1131459009

PDB_ID PDB_NAME FILE_ID TABLESPACE FILE_NAME


------ -------- ------- ---------- ---------------------------------------------

3 ITPDBDEV 12 UNDOTBS1 +DATA/BIZDB/F6D7E8209D587F75E0536538A8C0A5F4/


DATAFILE/undotbs1.273.1131458965
7. Setup Environment Variables On Both Nodes

Setup Oracle User .bash_profile On Node 1

[oracle@biz01 ~]$ nano .bash_profile


# .bash_profile

# Get the aliases and functions


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

# ORACLE NODE 1 ENVIRONMENT VARIABLES


export ORACLE_BASE=/acfs/app/oracle
export ORACLE_HOME=/acfs/product/19.3.0/dbhome_1
export ORACLE_SID=bizdb1
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

[oracle@biz01 ~]$ source .bash_profile

Setup Oracle User .bash_profile On Node 2

[oracle@biz02 ~]$ nano .bash_profile


# .bash_profile

# Get the aliases and functions


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs


PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

# ORACLE NODE 2 ENVIRONMENT VARIABLES


export ORACLE_BASE=/acfs/app/oracle
export ORACLE_HOME=/acfs/product/19.3.0/dbhome_1
export ORACLE_SID=bizdb2
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

[oracle@biz02 ~]$ source .bash_profile

Setup Grid User .bash_profile On Node 1


[grid@biz01 ~]$ nano .bash_profile
# .bash_profile

# Get the aliases and functions


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

# GRID NODE 1 ENVIRONMENT VARIABLES


export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3.0/grid
export GRID_BASE=/u01/app/grid
export GRID_HOME=/u01/app/19.3.0/grid
export ORACLE_SID=+ASM1
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

[grid@biz01 ~]$ source .bash_profile


Setup Grid User .bash_profile On Node 2
[grid@biz02 ~]$ nano .bash_profile
# .bash_profile

# Get the aliases and functions


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

# GRID NODE 2 ENVIRONMENT VARIABLES


export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3.0/grid
export GRID_BASE=/u01/app/grid
export GRID_HOME=/u01/app/19.3.0/grid
export ORACLE_SID=+ASM2
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

[grid@biz02 ~]$ source .bash_profile

Command To Start and Stop Database Using SRVCTL

Start Database
[oracle@biz01 ~]$ srvctl start database -d bizdb

Start Instance Node 1


[oracle@biz01 ~]$ srvctl start instance -d bizdb -i bizdb1

Start Instance Node 2


[oracle@biz01 ~]$ srvctl start instance -d bizdb -i bizdb2
Stop Database
[oracle@biz01 ~]$ srvctl stop database -d bizdb

Stop Instance Node 1


[oracle@biz01 ~]$ srvctl stop instance -d bizdb -i bizdb1

Stop Instance Node 2


[oracle@biz01 ~]$ srvctl stop instance -d bizdb -i bizdb2

You might also like