[toc]

Reference: www.xmmup.com/zaicentos7-…

1. Rac Installation planning

Website installation process: docs.oracle.com/en/database…

1.1. Introduction to required software

Oracle RAC does not support heterogeneous platforms. Machines of different speeds and sizes can be supported in the same cluster, but all nodes must be running on the same operating system. Oracle RAC does not support machines with different chip architectures.

The serial number type content MD5
1 The database LINUX.X64_213000_db_home.zip 8ac915a800800ddf16a382506d3953db
2 The clustering software LINUX.X64_213000_grid_home.zip b3fbdb7621ad82cbd4f40943effdd1be
3 The operating system CentOS – 7.8 – x86_64 – DVD – 2003. Iso 16673979023254EA09CC0B57853A7BBD
4 Vm Software VMware Workstation Pro 16.0.0 build-16894299
5 Xmanager Enterprise 4 Xmanager Enterprise 4, for opening the graphical interface
6 SecureCRTPortable.exe Version 6.6.1 (Build 289) with SecureCRT and SecureFX for SSH connections and FTP uploads

Remark:

1, OS memory at least 8G

2. Before installing the OS and database, verify the MD5 value of the downloaded installation package to check its integrity

  • 21 c database software download can refer to: www.xmmup.com/dbbao76zaid…

1.2. IP Address Planning

Starting from Oracle 11G, there are at least seven IP addresses and two nics. Public, VIP, and SCAN are on the same network segment, and private is on another network segment. The host name does not contain a dash, for example, RAC_01 is not allowed. Run the ifconfig -a command to check whether the nic names of the two nodes are the same. In addition, before the installation, four IP addresses of the public network and private network can be pinged, and the other three IP addresses cannot be pinged.

Starting from 18C, scan recommends at least three.

Node/host name IP Address Interface Name Address type Registered location Virtual nic adapter Operating system nic
raclhr-21c-n1 192.168.59.62 raclhr-21c-n1 Public /etc/hosts VMnet8 (NAT Mode) ens33
raclhr-21c-n1 192.168.59.64 raclhr-21c-n1-vip Virtual /etc/hosts VMnet8 (NAT Mode) ens33
raclhr-21c-n1 192.168.2.62 raclhr-21c-n1-priv Private /etc/hosts VMnet2 (host only) ens34
raclhr-21c-n2 192.168.59.63 raclhr-21c-n2 Public /etc/hosts VMnet8 (NAT Mode) ens33
raclhr-21c-n2 192.168.59.65 raclhr-21c-n2-vip Virtual /etc/hosts VMnet8 (NAT Mode) ens33
raclhr-21c-n2 192.168.2.63 raclhr-21c-n2-priv Private /etc/hosts VMnet2 (host only) ens34
192.168.59.66

192.168.59.67

192.168.59.68
raclhr-21c-scan SCAN /etc/hosts VMnet8 (NAT Mode) ens33

1.3 Planning local Disk Partitions of the OPERATING system

Except the /boot partition, all partitions use logical volumes to facilitate file system expansion.

The serial number The name of the partition The size of the The logical volume Use instructions
1 /u01 50G /dev/mapper/vg_orasoft-lv_orasoft_u01 Oracle and Grid installation directories
2 /soft 20G /dev/mapper/VG_OS-lv_VG_OS_soft Storage software, at least 10 GB

1.4. Plan shared Storage and ASM Disk Groups

The serial number ASM Disk Name Disk Group Name Redundancy mode The size of the use note
1 /dev/asm-diskd

/dev/asm-diske

/dev/asm-diskf
OCR Normal 3G OCR+VOTINGDISK At least 1 g
2 /dev/asm-diskg

/dev/asm-diskh

/dev/asm-diski
MGMT External 30G MGMT At least 30 GB, you can choose not to install the GIMR component
3 /dev/asm-diskj

/dev/asm-diskk

/dev/asm-disl
DATA External 45G Store database data files
4 /dev/asm-diskm

/dev/asm-diskn

/dev/asm-disko
FRA External 30G Quick recovery zone

2. Operating system configuration

Unless otherwise specified, the following operations must be performed on both nodes.

2.1. Prepare the OS

Installation steps slightly, also can download the wheat seedling has installed a virtual machine environment: www.xmmup.com/ziliaofenxi…

Install a virtual machine and rename it as follows:

Open with vm software:

2.2. Adding a NIC

First, you need to add the nic adapter:

VMnet2 is as follows:

VMnet8 is as follows:

The gateway is 192.168.59.2, as shown below:

Delete and then add two nics. VMnet8 is a public NIC and VMnet2 is a private NIC, as shown in the following figure:

Open it and select I have copied the VM.

2.3. Change the host name

Change the host names of the two nodes to raclhr-21C-N1 and raclHR-21C-n2.

hostnamectl set-hostname raclhr- 21c-n1
hostnamectl set-hostname raclhr- 21c-n2
Copy the code

2.4. Configure static IP addresses

Configure static IP addresses on the two nodes.

Change the IP address (IPADDR) when configuring the IP address on node 2. Ensure that the MAC addresses of the nics on the two nodes are different; otherwise, the nodes cannot communicate with each other.

2.4.1. Modify the MAC Address

Run ifconfig or IP link show to check the MAC address and modify the /etc/udev/rules.d/70-persistent-ipoib.rules file

cat > /etc/udev/rules.d/70-persistent-ipoib.rules <<"EOF"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="? *", ATTR{address}=="00:0c:29:25:83:db", ATTR{type}=="1", KERNEL=="eth*", NAME="ens33"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="? *", ATTR{address}=="00:0c:29:25:83:e5", ATTR{type}=="1", KERNEL=="eth*", NAME="ens34"
EOF
Copy the code

2.4.2. Configure static IP addresses

Notice Change the IPADDR and HWADDR addresses.

1. Run /etc/sysconfig/network-scripts/ifcfg-ens33 to configure the public network

cat > /etc/sysconfig/network-scripts/ifcfg-ens33 <<"EOF"
DEVICE=ens33
NAME=ens33
IPADDR=192.16859.62.
NETMASK=255.255255.. 0
GATEWAY=192.16859.2.
ONBOOT=yes
USERCTL=no
BOOTPROTO=static
HWADDR=00:0c:29:25:83:db
TYPE=Ethernet
IPV6INIT=no
DNS1=114.114114.114.
DNS2=8.88.8.
NM_CONTROLLED=no
EOF
Copy the code

2. Run /etc/sysconfig/network-scripts/ifcfg-ens34 to configure the private network. Notice The gateway cannot be configured for nic 2; otherwise, the default gateway becomes the gateway of NIC 2, and the system cannot access the Internet.

cat > /etc/sysconfig/network-scripts/ifcfg-ens34 <<"EOF"
DEVICE=ens34
NAME=ens34
IPADDR=192.1682.62.
NETMASK=255.255255.. 0
ONBOOT=yes
USERCTL=no
BOOTPROTO=static
HWADDR=00:0c:29:25:83:e5
TYPE=Ethernet
IPV6INIT=no
DNS1=114.114114.114.
DNS2=8.88.8.
NM_CONTROLLED=no
EOF
Copy the code

After this part is complete, restart the OS.

2.5. Disable the firewall

systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld

systemctl list-unit-files | grep fire
Copy the code

2.6. Disable selinux

Change selinux =disabled in /etc/selinux/config manually, or use the following command:

sed -i '/^SELINUX=.*/ s//SELINUX=disabled/' /etc/selinux/config
Copy the code

It takes effect only after restart.

[root@raclhr- 21c-n1 ~]# getenforce 
Disabled
Copy the code

2.7. Modify the /etc/hosts file

Add the following:

#Public IP
192.16859.62.            raclhr- 21c-n1
192.16859.63.            raclhr- 21c-n2

#Private IP
192.1682.62.             raclhr- 21c-n1-priv
192.1682.63.             raclhr- 21c-n2-priv

#Virtual IP
192.16859.64.            raclhr- 21c-n1-vip
192.16859.65.            raclhr- 21c-n2-vip

#Scan IP
192.16859.66.            raclhr- 21c-scan
192.16859.67.            raclhr- 21c-scan
192.16859.68.            raclhr- 21c-scan
Copy the code

Note: you need to keep the 127.0.0.1 localhost line.

2.8. Add groups and users

groupadd -g 54321 oinstall  
groupadd -g 54322 dba  
groupadd -g 54323 oper  
groupadd -g 54324 backupdba  
groupadd -g 54325 dgdba  
groupadd -g 54326 kmdba  
groupadd -g 54327 asmdba  
groupadd -g 54328 asmoper  
groupadd -g 54329 asmadmin  
groupadd -g 54330 racdba
  
useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle  
useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,dba,racdba grid  

echo lhr | passwd --stdin oracle
echo lhr | passwd --stdin grid
Copy the code

2.9. Create an installation directory

2.9.1 Mounting the /u01 directory

First, add a 200GB disk to each node:

Then create a volume group. The 200 GB disk is divided into 10 PES, and each PE is about 20 GB:

Content too much, can not put down, part of the content has been deleted, the full text can refer to: www.xmmup.com/zaicentos7-…

After the partition is complete, create logical volumes and mount partitions.

pvcreate /dev/sdc1 /dev/sdc2 /dev/sdc3 /dev/sdc5 /dev/sdc6 /dev/sdc7 /dev/sdc8 /dev/sdc9 /dev/sdc10 /dev/sdc11
vgcreate vg_oracle /dev/sdc1 /dev/sdc2 /dev/sdc3 /dev/sdc5 /dev/sdc6 /dev/sdc7 /dev/sdc8 /dev/sdc9 /dev/sdc10 /dev/sdc11
lvcreate -n lv_orasoft_u01 -L 60G vg_oracle
mkfs.ext4 /dev/vg_oracle/lv_orasoft_u01
mkdir /u01
mount /dev/vg_oracle/lv_orasoft_u01 /u01

echo "/dev/vg_oracle/lv_orasoft_u01 /u01  ext4 defaults 0 0" >> /etc/fstab

Copy the code

Query:

[root@raclhr- 21c-n1 ~]# df -h
Filesystem                            Size  Used Avail Use% Mounted on
devtmpfs                              3.9G     0  3.9G   0% /dev
tmpfs                                 3.9G     0  3.9G   0% /dev/shm
tmpfs                                 3.9G   13M  3.9G   1% /run
tmpfs                                 3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/centos_lhrdocker-root      50G  5.0G   42G  11% /
/dev/sda1                             976M  143M  767M  16% /boot
/dev/mapper/centos_lhrdocker-home     9.8G   41M  9.2G   1% /home
/dev/mapper/vg_docker-lv_docker       788G   73M  748G   1% /var/lib/docker
tmpfs                                 797M   12K  797M   1% /run/user/42
tmpfs                                 797M     0  797M   0% /run/user/0
/dev/mapper/vg_oracle-lv_orasoft_u01   59G   53M   56G   1% /u01
Copy the code

2.9.2 Creating a Directory

mkdir -p /u01/app/21.3. 0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/21.3. 0/dbhome_1
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

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

2.10. Configure environment variable files for grid and Oracle users

The oracle user:

cat >> /home/oracle/.bash_profile <<"EOF"

umask 022
export ORACLE_SID=rac21c1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/21.3. 0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export TMP=/tmp
export TMPDIR=$TMP
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH


export EDITOR=vi
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_PATH=.:$ORACLE_BASE/dba_scripts/sql:$ORACLE_HOME/rdbms/admin
export SQLPATH=$ORACLE_HOME/sqlplus/admin


#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK" --AL32UTF8 SELECT userenv('LANGUAGE') db_NLS_LANG FROM DUAL;
export NLS_LANG="AMERICAN_CHINA.ZHS16GBK"

alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'
alias dgmgrl='rlwrap dgmgrl'
alias sas='sqlplus / as sysdba'

EOF



cat >> /home/grid/.bash_profile <<"EOF"

umask 022
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/21.3. 0/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$PATH
alias sqlplus='rlwrap sqlplus' 
alias asmcmd='rlwrap asmcmd'
alias dgmgrl='rlwrap dgmgrl'
alias sas='sqlplus / as sysdba'

EOF
Copy the code

Note: The other database instance name must be changed accordingly:

Oracle: export ORACLE_SID= RAC21C2 Grid: export ORACLE_SID=+ASM2

2.11. Configure environment variables for the root user

cat >> /etc/profile <<"EOF"

export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/21.3. 0/grid
export GRID_BASE=$ORACLE_BASE
export GRID_HOME=$ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin

EOF
Copy the code

2.12. Install software dependency packages

Install some common packages:

yum install -y openssh-clients openssh-server initscripts  net-tools telnet which wget \
    passwd e4fsprogs lrzsz sudo unzip lvm2 tree traceroute lsof file tar systemd \
    bridge-utils mlocate mailx strace less mmv stress
yum install -y dos2unix rlwrap xdpyinfo xorg-x11-apps nmap numactl numactl-devel \
    iproute rsyslog bash-completion tmux sysbench vim redhat-lsb smartmontools xinetd \
    gcc  make  sysstat ksh binutils socat cmake automake autoconf bzr bison libtool deltarpm \
    rsync libev pv subversion nload gnuplot jq oniguruma yum-fastestmirror net-snmp net-snmp-utils \
    nfs-utils rpcbind  postfix dovecot bind-utils bind bind-chroot dnsmasq haproxy keepalived bzr \
    fio bzip2 ntp flex lftp
yum install -y ncurses-devel libgcrypt-devel libaio libaio-devel \
    perl perl-Env perl-devel  perl-Time-HiRes perl-DBD-MySQL perl-ExtUtils-MakeMaker perl-TermReadKey \
    perl-Config-Tiny perl-Email-Date-Format perl-Log-Dispatch perl-Mail-Sender perl-Mail-Sendmail \
    perl-MIME-Lite perl-Parallel-ForkManager perl-Digest-MD5 perl-ExtUtils-CBuilder perl-IO-Socket-SSL \
    perl-JSON openssl-devel libverto-devel libsepol-devel libselinux-devel libkadm5 keyutils-libs-devel \
    krb5-devel libcom_err-devel cyrus-sasl* perl-DBD-Pg perf slang perl-DBI  perl-CPAN \
    perl-ExtUtils-eBuilder cpan perl-tests
yum install -y  compat-libstdc++- 33 gcc-c++  glibc glibc-common glibc.i686  glibc-devel glibc-devel.i686 \
    libgcc libgcc.i686 libstdc++   libstdc++-devel  libaio.i686   libaio-devel.i686 \
    libXext  libXext.i686  libXtst  libXtst.i686  libX11  libX11.i686  libXau  libXau.i686  \
    libxcb  libxcb.i686  libXi  libXi.i686   unixODBC  unixODBC-devel  zlib-devel  zlib-devel.i686 \
    compat-libcap1 libXp libXp-devel libXp.i686 elfutils-libelf elfutils-libelf-devel compat-db \
    gnome-libs pdksh xscreensaver fontconfig-devel libXrender-devel

 yum remove PackageKit -y
Copy the code

Check:

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
compat-libcap1 \
compat-libstdc++- 33 \
gcc \
gcc-c++ \
glibc \
glibc-devel \
ksh \
libgcc \
libstdc++ \
libstdc++-devel \
libaio \
libaio-devel \
libXext \
libXtst \
libX11 \
libXau \
libxcb \
libXi \
make \
elfutils-libelf-devel \
sysstat  | grep "not installed"
Copy the code

2.13. Configure kernel parameters

2.13.1 modify the /etc/sysctl.conf file

cat >> /etc/sysctl.conf <<"EOF"
vm.swappiness = 1
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
kernel.shmmni = 4096  
kernel.shmall = 1073741824  
kernel.shmmax = 4398046511104
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 
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.panic_on_oops = 1
kernel.watchdog_thresh=30
EOF
Copy the code

Effect:

/sbin/sysctl -p
Copy the code

2.13.2, modify the/etc/security/limits file

echo "grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft nproc 2047
grid hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle hard memlock  8145728
oracle soft memlock  8145728
root soft nproc 2047 " >> /etc/security/limits.conf
Copy the code

2.13.3. Modify the /etc/pam.d/login file

echo "session    required     pam_limits.so" >> /etc/pam.d/login
Copy the code

2.13.4 modify the /etc/profile file

cat >> /etc/profile << "EOF"
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
EOF
Copy the code

2.14. Stop the NTP and Chrony services

You can use the NTP service of the operating system or the CTSS service provided by Oracle. If NTP is not enabled, Oracle automatically enables its OWN CTSSD process. The Cluster Time Synchronization Service(CTSS) is used to synchronize Time between nodes starting from Oracle 11gR2 RAC. If the INSTALLATION program detects that the NTP protocol is inactive, Installing the cluster time synchronization service Automatically installs and synchronizes the time of all nodes in active mode. If NTP is configured, start the cluster time synchronization service in Observer mode. Oracle Clusterware does not synchronize active time in the cluster.

systemctl stop ntpd 
systemctl disable ntpd.service
mv /etc/ntp.conf /etc/ntp.conf.bak
Copy the code

Chrony is open source free software that helps you keep your system clock in sync with the clock server (NTP), thus keeping your time accurate. It consists of two programs, chronyd and ChronyC. Chronyd is a daemon running in the background that adjusts the system clock and clock server synchronization running in the kernel. It determines the rate at which the computer increases or decreases time and compensates for this. Chronyc provides a user interface for monitoring performance and diversifying configurations. It can work on a chronyd instance-controlled computer or on a different remote computer.

systemctl disable chronyd
systemctl stop chronyd
mv /etc/chrony.conf /etc/chrony.conf_bak
Copy the code

2.15. Disable Avahi -daemon

systemctl stop avahi-daemon 
systemctl disable avahi-daemon 
Copy the code

Avahi allows applications to publish and learn about various services and hosts in a local network without the need for manual network configuration. For example, when a user connects his computer to a local area network and his machine is running Avahi, the Avahi program broadcasts automatically to find available printers, shared files, and other users to chat with. It’s kind of like he’s receiving all kinds of Internet ads on his LAN.

The name of the process actually started on Linux is Avahi -daemon.

Add NOZEROCONF=yes to /etc/sysconfig/network

echo 'NOZEROCONF=yes' >> /etc/sysconfig/network
Copy the code

2.17. Disable large transparent pages

Reference: www.xmmup.com/linux-biaoz…

cat >> /etc/rc.local <<"EOF"
 
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
 
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
   echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
 
EOF

chmod +x /etc/rc.d/rc.local
sh /etc/rc.local

cat /sys/kernel/mm/transparent_hugepage/defrag
cat /sys/kernel/mm/transparent_hugepage/enabled
Copy the code

Recommended configuration page features, reference: www.xmmup.com/oracleshuju…

2.18. Stop unused services

systemctl list-unit-files |grep enable systemctl stop autofs systemctl stop nfslock systemctl stop rpcidmapd systemctl stop rpcgssd systemctl stop ntpd systemctl stop bluetooth.service systemctl stop cups.path systemctl stop cups.socket systemctl stop postfix.service  systemctl stop rpcbind.service systemctl stop rpcbind.socket systemctl stop NetworkManager-dispatcher.service
systemctl stop dbus-org.freedesktop.NetworkManager.service
systemctl stop abrt-ccpp.service
systemctl stop cups.service
systemctl stop libvirtd

systemctl disable autofs
systemctl disable nfslock
systemctl disable rpcidmapd
systemctl disable rpcgssd
systemctl disable ntpd
systemctl disable bluetooth.service
systemctl disable cups.path 
systemctl disable cups.socket
systemctl disable postfix.service
systemctl disable rpcbind.service
systemctl disable rpcbind.socket
systemctl disable NetworkManager-dispatcher.service
systemctl disable dbus-org.freedesktop.NetworkManager.service
systemctl disable abrt-ccpp.service
systemctl disable cups.service
systemctl disable  libvirtd
Copy the code

2.19. Increase the switching speed

A stop job is running for A stop job is running for A stop job

Solution:

cat >> /etc/systemd/system.conf << "EOF"
DefaultTimeoutStartSec=5s
DefaultTimeoutStopSec=5s
EOF

systemctl daemon-reload
Copy the code

3. Configure shared storage

Reference: www.xmmup.com/zaicentos7-…

3.1 Server Configuration

3.1.1. Create an LVM

3.1.2. Install targetd and targetcli using yum

3.1.3. Create a device using targetcli

3.1.4. Create iqNs and luns using targetcli

3.1.5. Create ACLS using targetCLI

3.1.6. Configure the listening IP address and port for target

3.1.7. Save the configuration

3.2 Client configuration

3.2.1. Install and start the service

3.2.2. Use iscsiadm to discover available storage devices and log in to them

3.2.3 Create and configure the udev rules file

4. Prepare database software packages

4.1. Upload the installation software

Open SecureFX software:

Copy and paste the database file into the /soft directory and wait for the upload to complete.

Note that MD5 verification is required for the installation package:

[root@raclhr- 21c-n1 ~]# cd /soft
[root@raclhr- 21c-n1 soft]# ll
total 5401812
-rw-r--r-- 1 root root 3109225519 Aug 16 09:58 LINUX.X64_213000_db_home.zip
-rw-r--r-- 1 root root 2422217613 Aug 16 09:57 LINUX.X64_213000_grid_home.zip
[root@raclhr- 21c-n1 soft]# md5sum LINUX.X64_213000_grid_home.zip 
b3fbdb7621ad82cbd4f40943effdd1be  LINUX.X64_213000_grid_home.zip
[root@raclhr- 21c-n1 soft]# md5sum LINUX.X64_213000_db_home.zip 
8ac915a800800ddf16a382506d3953db  LINUX.X64_213000_db_home.zip
Copy the code

4.2 Decompression software

The grid users:

unzip LINUX.X64_213000_grid_home.zip  -d /u01/app/21.3. 0/grid
Copy the code

The oracle user:

unzip LINUX.X64_213000_db_home.zip -d /u01/app/oracle/product/21.3. 0/dbhome_1
Copy the code

Decompress only on node 1.

👉 note:

1. Do not unpack two files at the same time, otherwise unexpected errors may occur

2, need to search for decompression whether there is an error, search keyword “error”

Note: Grid Home is where the files extracted from 18C are located. So when unpacking, unpack the file to GRID_HOME. Before 12C R2 is installed, the software will be automatically copied over.

Starting with Oracle Database 18c, the Oracle Database software is available as an image file for download and installation. Extract the image software into the directory where you want your Oracle home to be located, and then run the runInstaller script to start the Oracle Database installation.

Starting with Oracle Database 18c, installation and configuration of Oracle Database software is simplified with Image-Based installation.

Five, pre-check before installation

5.1 Installing the Patch Package (cvuqDisk)

Before installing RAC, you often need to run Cluster Verification Utility (CVU), which checks the system to verify that the current configuration meets requirements.

Check whether the cvuqdisk package is installed:

rpm -qa cvuqdisk
Copy the code

If not, run the following command on both nodes to install the package:

export CVUQDISK_GRP=oinstall
cd /u01/app/21.3. 0/grid/cv/rpm
rpm -ivh  cvuqdisk1.010.1.rpm
Copy the code

Transfer to second node for installation:

scp cvuqdisk1.010.1.rpm root@raclhr- 21c-n2:/soft

Install the cvuqdisk package on node 2
export CVUQDISK_GRP=oinstall
rpm -ivh  /soft/cvuqdisk1.010.1.rpm
Copy the code

5.2. Set SSH mutual trust to establish SSH equivalence

Sshusersetup. sh In the sshsetup directory after the GI installation media is decompressed. Run the following commands on node 1 as user root:

/u01/app/21.3. 0/grid/oui/prov/resources/scripts/sshUserSetup.sh -user grid  -hosts "raclhr-21c-n1 raclhr-21c-n2" -advanced exverify -confirm
/u01/app/21.3. 0/grid/oui/prov/resources/scripts/sshUserSetup.sh -user oracle  -hosts "raclhr-21c-n1 raclhr-21c-n2" -advanced exverify -confirm
Copy the code

Enter yes and your password and press Enter.

Test two-node connectivity on both nodes as oracle and Grid users:

ssh raclhr- 21c-n1 date
ssh raclhr- 21c-n2 date
ssh raclhr- 21c-n1-priv date
ssh raclhr- 21c-n2-priv date
Copy the code

If the password is not prompted for the second time and the command can be executed successfully, SSH equivalence is successfully configured.

5.3 Cluster hardware check – Check configuration information before installation

Use Cluster Verification Utility (cvu)

Before installing Oracle Clusterware, use CVU to ensure that your cluster is prepared for an installation:

Oracle provides CVU to perform system checks in preparation for an installation, patch updates, or other system changes. In addition, CVU can generate fixup scripts that can change many kernel parameters to at lease the minimum settings required for a successful installation.

Using CVU can help system administrators, storage administrators, and DBA to ensure that everyone has completed the system configuration and preinstallation steps.

./runcluvfy.sh -help

Sh stage-pre crsinst -n rac1,rac2 – fixup-verbose./runcluvfy.sh stage-pre crsinst -n rac1,rac2 – fixup-verbose

Install the operating system package cvuqdisk to both Oracle RAC nodes. Without cvuqdisk, Cluster Verification Utility cannot discover shared disks, and you will receive the error message “Package cvuqdisk not installed” when the Cluster Verification Utility is run (either manually or at the end of the Oracle grid infrastructure installation). Use the cvuqdisk RPM for your hardware architecture (for example, x86_64 or i386). The cvuqdisk RPM can be found on the Oracle grid infrastructure installation media in the rpm directory. For the purpose of this article, the Oracle grid infrastructure media was extracted to the /home/grid/software/oracle/grid directory on racnode1 as the grid user.

Before installing the GRID, you are advised to use the Cluster Verification Utility (CVU) to check the CRS environment before installation. Run as grid user:

su - grid
export CVUQDISK_GRP=oinstall
export CV_NODE_ALL=raclhr- 21c-n1,raclhr- 21c-n2
/u01/app/21.3. 0/grid/runcluvfy.sh stage -pre crsinst -allnodes -fixup -verbose -method root
Copy the code

Grid can also be verified as follows after installation:

$ORACLE_HOME/bin/cluvfy stage  -pre crsinst -n all  -verbose -fixup
Copy the code

Those that fail to pass the detection are displayed as Failed, and some failed can be repaired according to the provided script. Some need to be repaired according to the situation, and some failed can also be ignored.

  • Error 1:
/dev/shm mounted as temporary file system. FAILED raclhr- 21c-n2: PRVE- 0421. : No entry exists in /etc/fstab for mounting /dev/shm
raclhr- 21c-n1: PRVE- 0421. : No entry exists in /etc/fstab for mounting /dev/shm
Copy the code

Reference: blog.itpub.net/26736162/vi…

CentOS7 and RHEL7 do not include /dev/shm in /etc/fstab. You can add them manually or ignore them.

  • Error 2:
Systemd login manager IPC parameter. FAILED raclhr- 21c-n2: PRVE- 10233. : Systemd login manager parameter 'RemoveIPC' entry
               does not exist or is commented out in the configuration file
               "/etc/systemd/logind.conf" on node "raclhr-21c-n2".
               [Expected="no"]

raclhr- 21c-n1: PRVE- 10233. : Systemd login manager parameter 'RemoveIPC' entry
               does not exist or is commented out in the configuration file
               "/etc/systemd/logind.conf" on node "raclhr-21c-n1".
               [Expected="no"]
Copy the code

Reference: blog.itpub.net/29371470/vi…

Solution:

echo "RemoveIPC=no" >> /etc/systemd/logind.conf
systemctl daemon-reload
systemctl restart systemd-logind
Copy the code
  • An error 3:
Network TimeProtocol (NTP) ... FAILED raclhr- 21c-n2: PRVG- 1017. : NTP configuration file "/etc/ntp.conf" is present on
               nodes "raclhr-21c-n2,raclhr-21c-n1" on which NTP daemon or
               service was not running

raclhr- 21c-n1: PRVG- 1017. : NTP configuration file "/etc/ntp.conf" is present on
               nodes "raclhr-21c-n2,raclhr-21c-n1" on which NTP daemon or
               service was not running
Copy the code

We use CTSSD to synchronize the cluster time, so NTP must be turned off.

Install the cluster and DB on the GUI

Before installation, restart the OS and check whether the network and shared disks are correct.

First, open xmanager-passive as follows:

6.1 Installing the Grid

Note: Log in as the Grid user and run the following script, which differs from the previous version of the Grid installation:

[grid@raclhr- 21c-n1 ~]$ export DISPLAY=192.16859.1.:0.0
[grid@raclhr- 21c-n1 ~] $/u01/app/21.3. 0/grid/gridSetup.sh
Launching Oracle Grid Infrastructure Setup Wizard...
Copy the code

Click Add to add node 2, and click Next

GIMR is not installed by default and we will not install the MIMR library for now:

To find asm disks, change the disk path to /dev/asm*.

Fool all errors to continue installation

Execute on node 1 and node 2 respectively:

/u01/app/oraInventory/orainstRoot.sh
/u01/app/21.3. 0/grid/root.sh
Copy the code

Node 1 runs:

[root@raclhr- 21c-n1 ~] #/u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@raclhr- 21c-n1 ~] #/u01/app/21.3. 0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/21.3. 0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/21.3. 0/grid/crs/install/crsconfig_params
2021- 08- 20 08:38:46: Got permissions of file /u01/app/grid/crsdata/raclhr- 21c-n1/crsconfig: 0775
2021- 08- 20 08:38:46: Got permissions of file /u01/app/grid/crsdata: 0775
2021- 08- 20 08:38:46: Got permissions of file /u01/app/grid/crsdata/raclhr- 21c-n1: 0775
The log of current session can be found at:
  /u01/app/grid/crsdata/raclhr- 21c-n1/crsconfig/rootcrs_raclhr- 21c-n1_2021- 08- 20_08- 38- 46AM.log
2021/08/20 08:38:56 CLSRSC- 594.: Executing installation step 1 of 19: 'SetupTFA'.
2021/08/20 08:38:56 CLSRSC- 594.: Executing installation step 2 of 19: 'ValidateEnv'.
2021/08/20 08:38:56 CLSRSC- 594.: Executing installation step 3 of 19: 'CheckFirstNode'.
2021/08/20 08:38:58 CLSRSC- 594.: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2021/08/20 08:39:00 CLSRSC- 594.: Executing installation step 5 of 19: 'SetupOSD'.
Redirecting to /bin/systemctl restart rsyslog.service
2021/08/20 08:39:00 CLSRSC- 594.: Executing installation step 6 of 19: 'CheckCRSConfig'.
2021/08/20 08:39:00 CLSRSC- 594.: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2021/08/20 08:39:13 CLSRSC- 594.: Executing installation step 8 of 19: 'CreateRootCert'.
2021/08/20 08:39:17 CLSRSC- 594.: Executing installation step 9 of 19: 'ConfigOLR'.
2021/08/20 08:39:35 CLSRSC- 594.: Executing installation step 10 of 19: 'ConfigCHMOS'.
2021/08/20 08:39:35 CLSRSC- 594.: Executing installation step 11 of 19: 'CreateOHASD'.
2021/08/20 08:39:40 CLSRSC- 594.: Executing installation step 12 of 19: 'ConfigOHASD'.
2021/08/20 08:39:41 CLSRSC- 330.: Adding Clusterware entries to file 'oracle-ohasd.service'
2021/08/20 08:39:58 CLSRSC- 4002.: Successfully installed Oracle Autonomous Health Framework (AHF).
2021/08/20 08:40:14 CLSRSC- 594.: Executing installation step 13 of 19: 'InstallAFD'.
2021/08/20 08:40:14 CLSRSC- 594.: Executing installation step 14 of 19: 'InstallACFS'.
2021/08/20 08:40:19 CLSRSC- 594.: Executing installation step 15 of 19: 'InstallKA'.
2021/08/20 08:40:24 CLSRSC- 594.: Executing installation step 16 of 19: 'InitConfig'.
2021/08/20 08:41:52 CLSRSC- 482.: Running command: '/ u01 / app / 21.3.0 / grid/bin/ocrconfig - upgrade grid oinstall'
CRS- 4256.: Updating the profile
Successful addition of voting disk e4f4713a678d4f04bf0cce6c0c14692d.
Successful addition of voting disk 7f85f487c7e34f42bff66f6c7cfc6032.
Successful addition of voting disk 408b301b47c84f97bfc109558258b289.
Successfully replaced voting disk group with +OCR.
CRS- 4256.: Updating the profile
CRS- 4266.: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
-- ----- ----------------- --------- ---------
 1. ONLINE   e4f4713a678d4f04bf0cce6c0c14692d (/dev/asm-diskd) [OCR]
 2. ONLINE   7f85f487c7e34f42bff66f6c7cfc6032 (/dev/asm-diske) [OCR]
 3. ONLINE   408b301b47c84f97bfc109558258b289 (/dev/asm-diskf) [OCR]
Located 3 voting disk(s).
2021/08/20 08:43:30 CLSRSC- 594.: Executing installation step 17 of 19: 'StartCluster'.
2021/08/20 08:44:43 CLSRSC- 343.: Successfully started Oracle Clusterware stack
2021/08/20 08:44:43 CLSRSC- 594.: Executing installation step 18 of 19: 'ConfigNode'.
2021/08/20 08:47:14 CLSRSC- 594.: Executing installation step 19 of 19: 'PostConfig'.
2021/08/20 08:47:36 CLSRSC- 325.: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Copy the code

Configure Oracle Grid Infrastructure for a Cluster… After you finish your run, check:

[root@raclhr- 21c-n1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.chad
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.net1.network
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.ons
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        OFFLINE OFFLINE                               STABLE
ora.cdp1.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cdp2.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cdp3.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cvu
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.qosmserver
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.raclhr- 21c-n1.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
--------------------------------------------------------------------------------
Copy the code

Node 2:

[root@raclhr- 21c-n2 ~] #/u01/app/21.3. 0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/21.3. 0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/21.3. 0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/raclhr- 21c-n2/crsconfig/rootcrs_raclhr- 21c-n2_2021- 08- 20_08- 51- 42AM.log
2021/08/20 08:51:48 CLSRSC- 594.: Executing installation step 1 of 19: 'SetupTFA'.
2021/08/20 08:51:48 CLSRSC- 594.: Executing installation step 2 of 19: 'ValidateEnv'.
2021/08/20 08:51:48 CLSRSC- 594.: Executing installation step 3 of 19: 'CheckFirstNode'.
2021/08/20 08:51:50 CLSRSC- 594.: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2021/08/20 08:51:50 CLSRSC- 594.: Executing installation step 5 of 19: 'SetupOSD'.
2021/08/20 08:51:50 CLSRSC- 594.: Executing installation step 6 of 19: 'CheckCRSConfig'.
2021/08/20 08:51:51 CLSRSC- 594.: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2021/08/20 08:51:52 CLSRSC- 594.: Executing installation step 8 of 19: 'CreateRootCert'.
2021/08/20 08:51:52 CLSRSC- 594.: Executing installation step 9 of 19: 'ConfigOLR'.
2021/08/20 08:51:52 CLSRSC- 594.: Executing installation step 10 of 19: 'ConfigCHMOS'.
2021/08/20 08:52:23 CLSRSC- 594.: Executing installation step 11 of 19: 'CreateOHASD'.
2021/08/20 08:52:24 CLSRSC- 594.: Executing installation step 12 of 19: 'ConfigOHASD'.
2021/08/20 08:52:25 CLSRSC- 330.: Adding Clusterware entries to file 'oracle-ohasd.service'
2021/08/20 08:52:55 CLSRSC- 594.: Executing installation step 13 of 19: 'InstallAFD'.
2021/08/20 08:52:55 CLSRSC- 594.: Executing installation step 14 of 19: 'InstallACFS'.
2021/08/20 08:52:57 CLSRSC- 594.: Executing installation step 15 of 19: 'InstallKA'.
2021/08/20 08:52:58 CLSRSC- 594.: Executing installation step 16 of 19: 'InitConfig'.
2021/08/20 08:53:04 CLSRSC- 4002.: Successfully installed Oracle Autonomous Health Framework (AHF).
2021/08/20 08:53:08 CLSRSC- 594.: Executing installation step 17 of 19: 'StartCluster'.
2021/08/20 08:54:09 CLSRSC- 343.: Successfully started Oracle Clusterware stack
2021/08/20 08:54:09 CLSRSC- 594.: Executing installation step 18 of 19: 'ConfigNode'.
2021/08/20 08:54:28 CLSRSC- 594.: Executing installation step 19 of 19: 'PostConfig'.
2021/08/20 08:54:38 CLSRSC- 325.: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Copy the code

Configure Oracle Grid Infrastructure for a Cluster… Succeeded Indicates success. View:

[root@raclhr- 21c-n1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.chad
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.net1.network
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.ons
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.cdp1.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cdp2.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cdp3.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.cvu
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.qosmserver
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.raclhr- 21c-n1.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.raclhr- 21c-n2.vip
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
--------------------------------------------------------------------------------
Copy the code

Now go back to the interface and click OK to continue:

Finally, the cluster verification error, check the DNS and NTP problem, can be ignored, continue installation:

6.2 Installing the DB

[root@raclhr- 21c-n1 ~]# su - oracle
Last login: Thu Aug 19 15:26:38 CST 2021 on pts/0
[oracle@raclhr- 21c-n1 ~]$ cd $ORACLE_HOME
[oracle@raclhr- 21c-n1 dbhome_1]$ export DISPLAY=192.16859.1.:0.0
[oracle@raclhr- 21c-n1 dbhome_1]$ ./runInstaller 
Copy the code

Execute the following commands for nodes 1 and 2:

[root@raclhr- 21c-n1 ~] #/u01/app/oracle/product/21.3. 0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/21.3. 0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Copy the code

When done, click OK:

6.3. Create a Disk group

Run the ASMCA command as user grid to create disk groups DATA and FRA. :

[root@raclhr- 21c-n1 ~]# su - grid
Last login: Fri Aug 20 09:59:53 CST 2021
[grid@raclhr- 21c-n1 ~]$ export DISPLAY=192.16859.1.:0.0
[grid@raclhr- 21c-n1 ~]$ asmca
Copy the code

To view:

[grid@raclhr- 21c-n1 ~]$ $ORACLE_HOME/bin/kfod disks=all st=true ds=true
--------------------------------------------------------------------------------
 Disk          Size Header    Path                                    Disk Group    User     Group   
================================================================================
   1:       1024 MB MEMBER    /dev/asm-diskd                           OCR          grid     asmadmin
   2:       1024 MB MEMBER    /dev/asm-diske                           OCR          grid     asmadmin
   3:       1024 MB MEMBER    /dev/asm-diskf                           OCR          grid     asmadmin
   4:      10240 MB CANDIDATE /dev/asm-diskg                           #            grid     asmadmin
   5:      10240 MB CANDIDATE /dev/asm-diskh                           #            grid     asmadmin
   6:      10240 MB CANDIDATE /dev/asm-diski                           #            grid     asmadmin
   7:      15360 MB MEMBER    /dev/asm-diskj                           DATA         grid     asmadmin
   8:      15360 MB MEMBER    /dev/asm-diskk                           DATA         grid     asmadmin
   9:      15360 MB MEMBER    /dev/asm-diskl                           DATA         grid     asmadmin
  10:      10240 MB MEMBER    /dev/asm-diskm                           FRA          grid     asmadmin
  11:      10240 MB MEMBER    /dev/asm-diskn                           FRA          grid     asmadmin
  12:      10240 MB MEMBER    /dev/asm-disko                           FRA          grid     asmadmin
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME                                                          
================================================================================
Copy the code

6.4. Create a database

[oracle@raclhr- 21c-n1 ~]$ export DISPLAY=192.16859.1.:0.0
[oracle@raclhr- 21c-n1 ~]$ dbca
Copy the code

7. Silently install the cluster and DB

Before installation, restart the OS and check whether the network and shared disks are correct.

Reference: www.xmmup.com/zaicentos7-…

7.1. Install grid silently

Reference: www.xmmup.com/zaicentos7-…

7.2 installing the DB software silently

Reference: www.xmmup.com/zaicentos7-…

7.3. Create DATA and FRA Disk Groups

Reference: www.xmmup.com/zaicentos7-…

7.4. Create a Database silently

-- RAC database
dbca -silent -ignorePreReqs  -ignorePrereqFailure  -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
-gdbname rac21c  -sid rac21c \
-createAsContainerDatabase TRUE \
-sysPassword lhr -systemPassword lhr -dbsnmpPassword lhr \
-datafileDestination '+DATA' -recoveryAreaDestination '+FRA' \
-storageType ASM \
-characterset AL32UTF8 \
-totalMemory 1024 \
-databaseType OLTP \
-emConfiguration none \
-nodeinfo raclhr- 21c-n1,raclhr- 21c-n2

- a single instance
dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
-gdbname LHRCDB  -sid LHRCDB \
-createAsContainerDatabase TRUE \
-numberOfPDBs 1 \
-pdbName pdbxmm \
-pdbAdminPassword lhr \
-sysPassword lhr -systemPassword lhr \
-datafileDestination '/u01/app/oracle/oradata' \
-recoveryAreaDestination '/u01/app/oracle/flash_recovery_area' \
-redoLogFileSize 50 \
-storageType FS \
-characterset AL32UTF8 -nationalCharacterSet AL16UTF16 \
-totalMemory 1024 \
-databaseType OLTP  \
-emConfiguration NONE
Copy the code

Creation process:

[oracle@raclhr- 21c-n1 ~]$ dbca -silent -ignorePreReqs  -ignorePrereqFailure  -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
> -gdbname rac21c  -sid rac21c \
> -createAsContainerDatabase TRUE \
> -sysPassword lhr -systemPassword lhr -dbsnmpPassword lhr \
> -datafileDestination '+DATA' -recoveryAreaDestination '+FRA' \
> -storageType ASM \
> -characterset AL32UTF8 \
> -totalMemory 1024 \
> -databaseType OLTP \
> -emConfiguration none \
> -nodeinfo raclhr- 21c-n1,raclhr- 21c-n2
[WARNING] [DBT- 06208.] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character.1 lower case character and 1 digit [09 -].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT- 06208.] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character.1 lower case character and 1 digit [09 -].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT- 06208.] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character.1 lower case character and 1 digit [09 -].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
7% complete
Copying database files
27% complete
Creating and starting Oracle instance
28% complete
31% complete
35% complete
37% complete
40% complete
Creating cluster database views
41% complete
53% complete
Completing Database Creation
57% complete
59% complete
60% complete
80% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/rac21c.
Database Information:
Global Database Name:rac21c
System Identifier(SID) Prefix:rac21c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/rac21c/rac21c.log" for further details.

[oracle@raclhr- 21c-n1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.chad
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.net1.network
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.ons
               ONLINE  ONLINE       raclhr- 21c-n1            STABLE
               ONLINE  ONLINE       raclhr- 21c-n2            STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.FRA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            Started,STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.cdp1.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cdp2.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.cdp3.cdp
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.cvu
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.qosmserver
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.rac21c.db
      1        ONLINE  ONLINE       raclhr- 21c-n1            Open,HOME=/u01/app/o
                                                             racle/product/21.3. 0
                                                             /dbhome_1,STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            Open,HOME=/u01/app/o
                                                             racle/product/21.3. 0
                                                             /dbhome_1,STABLE
ora.raclhr- 21c-n1.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.raclhr- 21c-n2.vip
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
--------------------------------------------------------------------------------

[oracle@raclhr- 21c-n1 ~]$ sas

SQL*Plus: Release 21.0. 0. 0. 0 - Production on Mon Aug 23 10:32:50 2021
Version 21.3. 0. 0. 0

Copyright (c) 1982.2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 21c Enterprise Edition Release 21.0. 0. 0. 0 - Production
Version 21.3. 0. 0. 0

SYS@rac21c1> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
Copy the code

7.5. Create the PDB database

SYS@rac21c1> show parameter db_create_file_dest

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_create_file_dest                  string                 +DATA
SYS@rac21c1> create pluggable database PDBLHR1 admin user lhr identified by lhr;

Pluggable database created.

SYS@rac21c1> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBLHR1                        MOUNTED
SYS@rac21c1> alter pluggable database pdblhr1 open;

Pluggable database altered.

SYS@rac21c1> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBLHR1                        READ WRITE NO
SYS@rac21c1>  alter pluggable database all save state;

Pluggable database altered.

[oracle@raclhr- 21c-n1 ~]$ export ORACLE_PDB_SID=PDBLHR1
[oracle@raclhr- 21c-n1 ~]$ sas

SQL*Plus: Release 21.0. 0. 0. 0 - Production on Mon Aug 23 10:45:11 2021
Version 21.3. 0. 0. 0

Copyright (c) 1982.2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 21c Enterprise Edition Release 21.0. 0. 0. 0 - Production
Version 21.3. 0. 0. 0

SYS@rac21c1> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDBLHR1                        READ WRITE NO
SYS@rac21c1> show con_name

CON_NAME
------------------------------
PDBLHR1


[root@raclhr- 21c-n1 ~]# crsctl status resource  -w "TYPE = ora.database.type" -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.rac21c.db
      1        ONLINE  ONLINE       raclhr- 21c-n1            Open,HOME=/u01/app/o
                                                             racle/product/21.3. 0
                                                             /dbhome_1,STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            Open,HOME=/u01/app/o
                                                             racle/product/21.3. 0
                                                             /dbhome_1,STABLE
--------------------------------------------------------------------------------
[root@raclhr- 21c-n1 ~]# crsctl status resource  -w "TYPE = ora.pdb.type" -t        
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.rac21c.pdblhr1.pdb
      1        ONLINE  ONLINE       raclhr- 21c-n1            STABLE
      2        ONLINE  ONLINE       raclhr- 21c-n2            STABLE
--------------------------------------------------------------------------------
Copy the code

8. Modify basic configurations

8.1. Disable the automatic startup of the CRS and DB

-- Disable CRS autostart
crsctl disable has

-- Disable db automatic startup
crsctl modify resource ora.rac21c.db -attr AUTO_START=never -unsupported
crsctl stat res ora.rac21c.db -p | grep AUTO_START
Copy the code

8.2. Modify the SQL prompt

Oracle and Grid are modified:

cat >> $ORACLE_HOME/sqlplus/admin/glogin.sql <<"EOF"

set linesize 9999 pagesize 9999
set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> "

EOF
Copy the code

reference

Content too much, can not put down, part of the content has been deleted, the full text can refer to: www.xmmup.com/zaicentos7-…