0% found this document useful (0 votes)
108 views

Oracle ASM Installation

Uploaded by

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

Oracle ASM Installation

Uploaded by

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

Install Oracle and ASM

Prerequisites

Edit host
nano /etc/hosts

Download packages
yum -y install oracle-database-preinstall-19c
yum -y install oracleasm* oracleasm-support

Check oracle user


id oracle

uid=54321(oracle) gid=54321(oinstall)
groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba
),54325(dgdba),54326(kmdba),54330(racdba)

Create required groups


groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin

Create grid user


useradd -u 54322 -g oinstall -G
dba,asmdba,asmoper,asmadmin,racdba grid

Modify oracle user to have access to ASM


usermod -a -G asmdba oracle

Modify oracle and grid user to access to shared folder


usermod -a -G vboxsf oracle
usermod -a -G vboxsf grid

Change password
passwd oracle
passwd grid
Create dirs for grid home, oracle home and ora inventory
mkdir -p /u01/app/grid/19c/grid_home
mkdir -p /u01/app/oracle/19c/db_home
mkdir -p /u01/app/oraInventory
Set ownerships
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/oraInventory

Configure Oracle ASM

oracleasm command

Let’s configure Oracle ASM


oracleasm configure -i

Default user to own the driver interface []: grid


Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n): y
Writing Oracle ASM library driver configuration: done

Load Oracle ASM


oracleasm init

Creating /dev/oracleasm mount point: /dev/oracleasm


Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

Create virtual hard disk which has 30GB. Show disks


fdisk -l

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Create 3 partitions on sdb


fdisk /dev/sdb

n
<enter>
<enter>
<enter>
+10G

n
<enter>
<enter>
<enter>
+10G

n
<enter>
<enter>
<enter>
<enter>

Recheck disks
fdisk -l

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa3fe9c1b

Device Boot Start End Blocks Id


System
/dev/sdb1 2048 20973567 10485760 83 Linux
/dev/sdb2 20973568 41945087 10485760 83 Linux
/dev/sdb3 41945088 62914559 10484736 83 Linux

Create separate ASM disk for each partition


oracleasm createdisk CRS1 /dev/sdb1
oracleasm createdisk DATA1 /dev/sdb2
oracleasm createdisk FRA1 /dev/sdb3

Check ASM disks


oracleasm listdisks

ls -lrt /dev/oracleasm/disks

total 0
brw-rw----. 1 grid oinstall 8, 19 Apr 11 14:30 FRA1
brw-rw----. 1 grid oinstall 8, 18 Apr 11 14:30 DATA1
brw-rw----. 1 grid oinstall 8, 17 Apr 11 14:30 CRS1

Install Grid Software

Edit grid user bash_profile but take .bash_profile backup


before editing it
su – grid
cp .bash_profile .bash_profile.orig
vi .bash_profile

Paste below contents


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/grid/19c/grid_home; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
JAVA_HOME=/usr/bin/java; export JAVA_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
export PATH

umask 022

Execute the bash profile and check the environment variables


. .bash_profile
env | grep ORA

ORACLE_SID=+ASM
ORACLE_BASE=/u01/app/grid
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/grid/19c/grid_home

Unzip 19C grid software into grid home


unzip /media/sf_OL7/LINUX.X64_193000_grid_home.zip -d
$ORACLE_HOME

Login as root. The package cvuqdisk must be installed before


installing the Clusterware software
cd /u01/app/grid/19c/grid_home/cv/rpm
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -iv cvuqdisk-1.0.10-1.rpm

Then, login as grid to install grid software


./gridSetup.sh

Configure diskgroups
asmca

Install Oracle Database Software

Edit oracle user bash_profile but take .bash_profile backup


before editing it
su – oracle
cp .bash_profile .bash_profile.orig
vi .bash_profile

Paste below content


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ORACLE_HOSTNAME=asm.dbagenesis.com; export ORACLE_HOSTNAME
ORACLE_SID=prod; export ORACLE_SID
ORACLE_UNQNAME=prod; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/19c/db_home; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM

JAVA_HOME=/usr/bin/java; export JAVA_HOME


NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export
NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/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:$ORACLE_HOME/jlib:$ORACLE_HOME/
rdbms/jlib:$ORACLE_HOME/network/jlib
export CLASSPATH

TEMP=/tmp ;export TMP


TMPDIR=$tmp ; export TMPDIR

umask 022

Execute the bash profile and check the environment variables


. .bash_profile
env | grep ORA

ORACLE_UNQNAME=prod
ORACLE_SID=prod
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=ol7-19.localdomain
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/oracle/19c/db_home

Unzip 19C oracle database software into oracle database home


unzip /media/sf_OL7/LINUX.X64_193000_db_home.zip -d
$ORACLE_HOME

Install
./runInstaller

Other configuration

# allow the traffic for the port 1521


firewall-cmd --permanent --add-port=1521/tcp
firewall-cmd --list-ports

# OR Stop the firewall and disable it


systemctl stop firewalld
systemctl disable firewalld

You might also like