Detailed steps for deploying oracle19c cluster on virtual machine centos7

Virtual machine configuration

Plan to install ASM instance and Oracle database instance, both 19c

One hard disk 80G, one shared disk 30G, two network cards, all in nat mode
Memory 16G, swap16G

The vxm files of nodes 1 and 2 are added

Requires the virtual machine to be powered off

disk.EnableUUID="TRUE" 
disk.locking = "FALSE" 
scsi1.shared = "TRUE" 
diskLib.dataCacheMaxSize = "0" 
diskLib.dataCacheMaxReadAheadSize = "0" 
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize= "4096"
diskLib.maxUnsyncedWrites = "0" 
scsi1.present = "TRUE" 
scsi1.virtualDev = "lsilogic" 
scsi1.sharedBus = "VIRTUAL"

change configuration file

ifconfig

Two network cards ens33/ens34, the names of the network cards of the two nodes need to be the same

vi /etc/sysconfig/network-scripts/ifcfg-ens33
service network restart

BOOTPROTO=static, configure static IP

Important IP planning, please refer to the document for details

vi /etc/hosts

I have commented out the original one, and both nodes need to be changed

turn off firewall

systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service

–vi /etc/selinux/config changed to SELINUX=disabled

Configure yum source

In the root operation, ensure that the GUI interface of the virtual machine can see the icon of a small CD-ROM

mkdir /yums
cd /run/media/root/CentOS\ 7\ x86_64/Packages/
cp * /yums
rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm 
rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm 
rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm
cd  /yums
createrepo .
cd /etc/yum.repos.d/
ls
rm -rf *
vi /etc/yum.repos.d/yum.local.repo

[local]
name=yum local repo
baseurl=file:///yums
gpgcheck=0
enable=1

yum clean all

Download various packages

yum install -y bc
yum install -y compat-libcap1*
yum install -y compat-libcap*
yum install -y binutils 
yum install -y compat-libstdc++-33 
yum install -y elfutils-libelf 
yum install -y elfutils-libelf-devel 
yum install -y gcc 
yum install -y gcc-c++ 
yum install -y glibc-2.5 
yum install -y glibc-common 
yum install -y glibc-devel 
yum install -y glibc-headers 
yum install -y ksh libaio 
yum install -y libaio-devel 
yum install -y libgcc 
yum install -y libstdc++ 
yum install -y libstdc++-devel 
yum install -y make 
yum install -y sysstat 
yum install -y unixODBC 
yum install -y unixODBC-devel
yum install -y binutils*
yum install -y compat-libstdc*
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y make*
yum install -y sysstat*
yum install -y libXp*
yum install -y glibc-kernheaders
yum install -y net-tools-*
yum install -y iscsi-initiator-utils
yum install -y udev
yum install -y xclock*

Turn off transparent huge pages

cp /etc/default/grub /etc/default/grub.bak
vi /etc/default/grub
----add a line
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"

change parameter file

vi /etc/sysctl.conf

kernel.shmmax = 277495689510912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
#net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2

sysctl -p
----------Generate parameter command

vi /etc/security/limits.conf

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

grid   soft   nofile    1024
grid   hard   nofile    65536
grid   soft   nproc    16384
grid   hard   nproc    16384
grid   soft   stack    10240
grid   hard   stack    32768
grid   hard   memlock    134217728
grid   soft   memlock    134217728
vim /etc/pam.d/login

session	required	/lib64/security/pam_limits.so
session	required	pam_limits.so
----root user
vim /etc/profile

if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
   if [ $SHELL = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
      else
      ulimit -u 16384 -n 65536
   fi
fi

-------effective command
source /etc/profile

Create user, change password

groupadd -g 601 oinstall
groupadd -g 602 dba
groupadd -g 603 oper
groupadd -g 604 backupdba
groupadd -g 605 dgdba
groupadd -g 606 kmdba
groupadd -g 607 asmdba
groupadd -g 608 asmoper
groupadd -g 609 asmadmin
useradd -u 601 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
useradd -u 602 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle


passwd grid
passwd oracle

Create a directory

mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory

mkdir -p /u01/app/grid
mkdir -p /u01/app/19c/grid
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01/app/grid
chown -R grid:oinstall /u01/app/19c
chmod -R 775 /u01/app/19c/

mkdir -p /u01/app/oracle
mkdir /u01/app/oracle/cfgtoollogs 
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle

mkdir -p /u01/app/oracle/product/19c/db_1
chown -R oracle:oinstall /u01/app/oracle/product/19c/db_1
chmod -R 775 /u01/app/oracle/product/19c/db_1

Configure grid user parameter file

export ORACLE_SID=+ASM2, remember to change it yourself

su - grid
vim ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19c/grid
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib  
export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ];then
            ulimit -p 16384
            ulimit -n 65536
        else
            ulimit -u 16384 -n 65536
        fi
    umask 022
fi

-----effective command
source ~/.bash_profile

Configure Oracle User Parameter File

export ORACLE_HOSTNAME=rac2
export ORACLE_SID=orcl2
These two have to be changed

su - oracle
vim ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export ORACLE_SID=orcl2
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib  
export PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19c/db_1/bin:$ORACLE_HOME/bin
export THREADS_FLAG=native;export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ];then
            ulimit -p 16384
            ulimit -n 65536
        else
            ulimit -u 16384 -n 65536
        fi
    umask 022
fi

----effective command
source ~/.bash_profile

upload package

Upload LINUX.X64_193000_grid_home.zip to /u01/app/19c/grid
------ Just transfer files in one node! ! ! ! !
Upload LINUX.X64_193000_db_home.zip to /u01/app/oracle/product/19c/db_1------ just upload the file on one node! ! ! ! !

su - root
--------ASM
cd /u01/app/19c/grid
chown -R grid:oinstall LINUX.X64_193000_grid_home.zip
chmod 775 LINUX.X64_193000_grid_home.zip
----------ORACLE
cd /u01/app/oracle/product/19c/db_1
chown -R oracle:oinstall LINUX.X64_193000_db_home.zip
chmod 775 LINUX.X64_193000_db_home.zip

udev mounts shared disk

View disk-id

ll /dev/disk/by-id/
lrwxrwxrwx. 1 root root  9 Oct 10 14:38 scsi-36000c2907639ca4eb41afaf12ee61542 -> ../../sdb

Just partition on one node! ! ! ! ! !

fdisk /dev/sdb-----Partition commands are entered in sequence n,p,1,two enter,p,w

Modify the rules, 30 is the last three digits of the host's IP, and the specific commands vary according to the Linux version! !
This article applies to Linux-centos7

vim /etc/udev/rules.d/30-oracle-asmdevices.rules
----These three places need to be changed! ! ! !
----KERNEL=="sdb1",
------RESULT=="36000c2907639ca4eb41afaf12ee61542"---disk-id
-------SYMLINK+="asm-diskb1"

KERNEL=="sdb1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c2907639ca4eb41afaf12ee61542", SYMLINK+="asm-diskb1", OWNER="grid", GROUP="asmadmin", MODE="0660"
-----configure udev take effect
/sbin/udevadm trigger --type=devices --action=change

Check the mount takes effect

ll /dev/asm-disk*
lrwxrwxrwx. 1 root:root 4 Oct 10 15:18 /dev/asm-diskb -> sdb1

All commands on this, no special remarks, all nodes must be typed

Install ASM

su - grid
cd /u01/app/19c/grid
unzip LINUX.X64_193000_grid_home.zip--------Just decompress it in one node! ! ! ! ! !

export DISPLAY=192.168.142.1:0.0------host ip: 0.0
./gridSetup.sh

The screenshot of 12c is used here, but the steps are the same, just replace 12.0.0 in the path with 19c

scan-name is consistent with scan-ip in /etc/hosts






Write the name yourself, the disk is the path of the shared disk







The error shown in the figure below can be ignored, check ignore all
Click fix & check again for other errors, and the script can be automatically fixed by running the prompt
If there are other mistakes, Baidu

Then install it all the way to the next step, there will be some warnings because ignoring the errors, but you can continue
The installation will prompt to use the root user to run two scripts, first run two scripts on the first node, and then run two scripts on the second node after success, the screenshot is as follows




It will prompt some failures, it doesn't matter, because the actual installation is successful because of skipping errors

Install oracle database instance

su - oracle
cd /u01/app/oracle/product/19c/db_1
unzip LINUX.X64_193000_db_home.zip--------Just decompress it in one node! ! ! ! ! !
export DISPLAY=192.168.142.1:0.0
./runInstaller

Screenshot below






Click fix&check, install with ASM grid, these errors can be ignored in the following figure

Keep doing the next step until it's done, can be a bit slow

Install packages that can flip commands up and down the database

rlwrap-0.37-1.el6.x86_64.rpm must be installed under the ROOT user, both nodes must be installed

su - oracle
vi /home/oracle/.bash_profile

---Paste the following three lines of text into the file
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'

-----After adding the content, save and exit and execute the following commands to generate environment variables
. /home/oracle/.bash_profile
su - grid
vi /home/grid/.bash_profile

alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'

----After adding the content, save and exit and execute the following commands to generate environment variables
. /home/grid/.bash_profile

dbca create database

Some management such as arcive,CDB, etc. can be selectively installed. The more complex the selection, the slower the installation.

su - oracle
export DISPLAY=192.168.142.1:0.0
dbca


















Continue to the next step until the installation is complete

Tags: Database Linux Operation & Maintenance Oracle CentOS

Posted by phpQuestioner_v5.0 on Thu, 13 Oct 2022 08:17:18 +0530