暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle Database 19c RAC Installation On Oracle Linux 8.4

原创 liketoochao 2024-04-28
1750

1.环境配置

1.1.Download Software

Download the Oracle software from OTN or MOS depending on your support status.

  • OTN: Oracle Database 19c (19.3) Software (64-bit)
  • edelivery: Oracle Database 19c (19.3) Software (64-bit)

1.2.Set the correct hostname in the “/etc/hostname” file.

cat >> /etc/hosts <<EOF

# node-01
92.151.180.2    xyjj-01
92.151.180.3    xyjj-01-vip
193.168.100.10  xyjj-01-priv

# node-02
92.151.180.4    xyjj-02
92.151.180.5    xyjj-02-vip
193.168.100.20  xyjj-02-priv

# cluster scan ip
92.151.180.6    xyjj

EOF

1.3.配置 team 网络

step 1.添加逻辑网卡team0.并启用activebackup模式

nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}'

step 2. 绑定ip

nmcli con modify team0 ipv4.address 92.151.180.4/24  ipv4.gateway 92.151.180.1
nmcli con modify team0 ipv4.method manual

step 3. 添加物理网卡到activebackup模式

nmcli con add type team-slave con-name team0-port1 ifname ens21f0 master team0

nmcli con add type team-slave con-name team0-port2 ifname ens21f1 master team0

2.Oracle Installation Prerequisites

Automatic Setup

curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm

dnf localinstall -y oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm

Manual Setup combined with Automatic Setup

step 1.Add the following lines to the “/etc/sysctl.conf” file, or in a file called “/etc/sysctl.d/98-oracle.conf”.

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Run one of the following commands to change the current kernel parameters, depending on which file you edited.

/sbin/sysctl -p
# Or
/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

step 2.Add the following lines to a file called “/etc/security/limits.d/oracle-database-preinstall-19c.conf” file.

# oracle-database-preinstall-19c setting for nofile soft limit is 1024
oracle   soft   nofile    1024

# oracle-database-preinstall-19c setting for nofile hard limit is 65536
oracle   hard   nofile    65536

# oracle-database-preinstall-19c setting for nproc soft limit is 16384
# refer orabug15971421 for more info.
oracle   soft   nproc    16384

# oracle-database-preinstall-19c setting for nproc hard limit is 16384
oracle   hard   nproc    16384

# oracle-database-preinstall-19c setting for stack soft limit is 10240KB
oracle   soft   stack    10240

# oracle-database-preinstall-19c setting for stack hard limit is 32768KB
oracle   hard   stack    32768

# oracle-database-preinstall-19c setting for memlock hard limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM
oracle   hard   memlock    236957796

# oracle-database-preinstall-19c setting for memlock soft limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90% of RAM
oracle   soft   memlock    236957796

# oracle-database-preinstall-19c setting for data soft limit is 'unlimited'
oracle   soft   data    unlimited

# oracle-database-preinstall-19c setting for data hard limit is 'unlimited'
oracle   hard   data    unlimited

# grid-database-preinstall-19c setting for nofile soft limit is 1024
grid   soft   nofile    1024

# grid-database-preinstall-19c setting for nofile hard limit is 65536
grid   hard   nofile    65536

# grid-database-preinstall-19c setting for nproc soft limit is 16384
# refer orabug15971421 for more info.
grid   soft   nproc    16384

# grid-database-preinstall-19c setting for nproc hard limit is 16384
grid   hard   nproc    16384

# grid-database-preinstall-19c setting for stack soft limit is 10240KB
grid   soft   stack    10240

# grid-database-preinstall-19c setting for stack hard limit is 32768KB
grid   hard   stack    32768

# grid-database-preinstall-19c setting for memlock hard limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM
grid   hard   memlock    236957796

# grid-database-preinstall-19c setting for memlock soft limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90% of RAM
grid   soft   memlock    236957796

# grid-database-preinstall-19c setting for data soft limit is 'unlimited'
grid   soft   data    unlimited

# grid-database-preinstall-19c setting for data hard limit is 'unlimited'
grid   hard   data    unlimited

step 3.The following packages are listed as required. Don’t worry if some don’t install. It won’t prevent the installation.

dnf install -y bc
dnf install -y binutils
#dnf install -y compat-libcap1
dnf install -y compat-libstdc++-33
#dnf install -y dtrace-modules
#dnf install -y dtrace-modules-headers
#dnf install -y dtrace-modules-provider-headers
#dnf install -y dtrace-utils
dnf install -y elfutils-libelf
dnf install -y elfutils-libelf-devel
dnf install -y fontconfig-devel
dnf install -y glibc
dnf install -y glibc-devel
dnf install -y ksh
dnf install -y libaio
dnf install -y libaio-devel
#dnf install -y libdtrace-ctf-devel
dnf install -y libXrender
dnf install -y libXrender-devel
dnf install -y libX11
dnf install -y libXau
dnf install -y libXi
dnf install -y libXtst
dnf install -y libgcc
dnf install -y librdmacm-devel
dnf install -y libstdc++
dnf install -y libstdc++-devel
dnf install -y libxcb
dnf install -y make
dnf install -y net-tools # Clusterware
dnf install -y nfs-utils # ACFS
dnf install -y python # ACFS
dnf install -y python-configshell # ACFS
dnf install -y python-rtslib # ACFS
dnf install -y python-six # ACFS
dnf install -y targetcli # ACFS
dnf install -y smartmontools
dnf install -y sysstat

# Added by me.
dnf install -y unixODBC

# New for OL8
dnf install -y libnsl
dnf install -y libnsl.i686
dnf install -y libnsl2
dnf install -y libnsl2.i686

step 4.Create the new 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,oper oracle

添加用户组

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

添加grid用户

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

修改 Oracle 用户组:

usermod -a -G dba,oper,asmdba,asmoper oracle

step 5.关闭透明大页和NUMA
关闭透明大页和NUMA(oracle-database-preinstall-19c 会自动设置,可跳过这一步)

# 修改/etc/default/grub,会在quiet后面加上transparent_hugepage=never numa=off
sed -i 's/quiet/quiet transparent_hugepage=never numa=off/' /etc/default/grub

# 关闭透明大页
grub2-mkconfig -o /boot/grub2/grub.cfg

# 需要重启下,检查是否已关闭
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /proc/cmdline

如果安装了 oracle-database-preinstall-19c,会自动设置,也可以检查下 /etc/default/grub 中的 GRUB_CMDLINE_LINUX 中 numa=off 和 transparent_hugepage=never 是否存在

[root@myrac1 ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"

step 6.配置 avahi-daemon
avahi-daemon会影响集群间的心跳网络,建议关闭(如果没有安装,也装上后关闭,避免后面不小心安装导致问题)

yum install -y avahi*

systemctl stop avahi-daemon.socket
systemctl stop avahi-daemon.service

pgrep -f avahi-daemon | awk '{print "kill -9 "$2}'

systemctl disable avahi-daemon.socket
systemctl disable avahi-daemon.service

修改文件 /etc/sysconfig/network,如果安装了oracle-database-preinstall-19c, 会自动设置

cat <<EOF>>/etc/sysconfig/network
NOZEROCONF=yes
EOF

Additional Setup

step 1.Set the password for the “oracle” and “grid” user.

echo "oracle" | passwd oracle --stdin
echo "oracle" | passwd grid --stdin

step 2.Set secure Linux to permissive by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows.

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

Once the change is complete, restart the server or run the following command.

# setenforce Permissive

step 3.If you have the Linux firewall enabled, you will need to disable or configure it, as shown here. To disable it, do the following.

systemctl stop firewalld && systemctl disable firewalld

step 4.If you are not using Oracle Linux and UEK, you will need to manually disable transparent huge pages.
step 5.Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oraInventory
mkdir -p /u01/app/grid/
mkdir -p /u01/app/19.3.0/grid
mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1

chown -R grid:oinstall /u01
chmod -R 775 /u01

step 6.Unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.

xhost +<machine-name>

step 7.编辑 /etc/profile

cat >> /etc/profile <<EOF
# Setting the appropriate ulimits for oracle and grid user
if [ $USER = "oracle" ]; then
     if [ $SHELL = "/bin/ksh" ]; then
        ulimit -u 16384
        ulimit -n 65536
     else
        ulimit -u 16384 -n 65536
     fi
fi

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

EOF

step 8.grid environment
Create an environment file called “setEnv.sh”. The “$” characters are escaped using “”. If you are not creating the file with the cat command, you will need to remove the escape characters.

cat >> /home/grid/.bash_profile <<EOF
# grid Settings
export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3.0/grid
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_TERM=xterm
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

EOF

step 9.Oracle environment
Create an environment file called “setEnv.sh”. The “$” characters are escaped using “”. If you are not creating the file with the cat command, you will need to remove the escape characters.

cat >> /home/oracle/.bash_profile <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_UNQNAME=xyjj
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=xyjj01

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
EOF

step 10.插入式认证模块配置:
使用 root 用户修改以下文件/etc/pam.d/login,增加如下内容:

cat >> /etc/pam.d/login <<EOF
session    required     pam_limits.so
EOF

Note:limits.conf 文件实际是 Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件,而且只针对于单个会话。

step 11.Create a “start_all.sh” and “stop_all.sh” script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbstart \$ORACLE_HOME
EOF


cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbshut \$ORACLE_HOME
EOF

chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh

Once the installation is complete and you’ve edited the “/etc/oratab”, you should be able to start/stop the database with the following scripts run from the “oracle” user.

~/scripts/start_all.sh
~/scripts/stop_all.sh

只针对于单个会话。

3.创建 asm 磁盘

3.1.配置磁盘多路径

step 1.安装多路径软件包
查询是否安装了多路径软件包:

rpm -qa |grep device-mapper-multipath

如果没有安装,则用yum安装即可:

dnf install device-mapper-multipath -y

step 2.扫描设备

[root@localhost Packages]# multipath -v2
Jul 29 01:27:09 | DM multipath kernel driver not loaded
Jul 29 01:27:09 | /etc/multipath.conf does not exist, blacklisting all devices.
Jul 29 01:27:09 | A sample multipath.conf file is located at
Jul 29 01:27:09 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Jul 29 01:27:09 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf
Jul 29 01:27:09 | DM multipath kernel driver not loaded
[root@localhost Packages]# 

step 3.加载DM模块:
加载DM模块

modprobe dm-multipath
modprobe dm-round-robin

确认内核成功加载:

modprobe -l |grep multipath

step 4.生成multipath配置文件

  • 使用mpathconf生成配置
/sbin/mpathconf  --enable
  • 使用示例配置文件
    可以从“/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf” 复制:
cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/

step 5.设置服务开机启动

systemctl enable multipathd
systemctl status multipathd
systemctl start multipathd

step 6.用命令查看设备wwid:

multipath -ll
multipath -v3

设备wwid

cat /etc/multipath/wwids 

与设备绑定的WWID

cat /etc/multipath/bindings

step 7. 配置/etc/multipath.conf,添加每个存储LUN的wwid号并设置对应的别名:

cat >> /etc/multipath.conf <<EOF
# Oracle Device Block
blacklist_exceptions {
    wwid "222b6000155641a1b"
    wwid "2222800015522035f"
    wwid "222ff000155a052b6"
    wwid "222970001556fab40"
    wwid "22282000155100869"
    wwid "2220d0001556d9cad"
    wwid "2229f000155bda899"
    wwid "222ff000155f7f20d"
    wwid "2227d000155e74597"
    wwid "2224600015525715d"
    wwid "222d200015501efef"
    wwid "2220200015538a7b8"
    wwid "2225100015533959c"
    }

multipaths {
    multipath {
                wwid "222e2000155b24e78"
                alias   OCR00
        }
    multipath {
                wwid "222b6000155641a1b"
                alias   OCR01
        }    
    multipath {
                wwid "2220d0001556d9cad"
                alias   OCR02
        }  
    multipath {
                wwid  2222800015522035f
                alias   DATA00
        }  
    multipath {
                wwid  222ff000155a052b6
                alias   DATA01
        } 
    multipath {
                wwid  222970001556fab40
                alias   DATA02
        }
    multipath {
                wwid  22282000155100869
                alias   DATA03
        }
    multipath {
                wwid  2229f000155bda899
                alias   DATA04
        }
    multipath {
                wwid  222ff000155f7f20d
                alias   DATA05
        }
    multipath {
                wwid  2227d000155e74597
                alias   DATA06
        }
    multipath {
                wwid  2224600015525715d
                alias   DATA07
        }
    multipath {
                wwid  222d200015501efef
                alias   DATA08
        }
    multipath {
                wwid  2220200015538a7b8
                alias   DATA09
        }
    multipath {
                wwid  2225100015533959c
                alias   DATA10
        }
   }
EOF

3.2.使用asmfd

[root@xyjj-01 bin]# ./asmcmd afd_label OCR00 /dev/mapper/OCR00 --init
[root@xyjj-01 bin]# ./asmcmd afd_label OCR01 /dev/mapper/OCR01 --init
[root@xyjj-01 bin]# ./asmcmd afd_label OCR02 /dev/mapper/OCR02 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA00 /dev/mapper/DATA00 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA01 /dev/mapper/DATA01 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA02 /dev/mapper/DATA02 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA03 /dev/mapper/DATA03 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA04 /dev/mapper/DATA04 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA05 /dev/mapper/DATA05 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA06 /dev/mapper/DATA06 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA07 /dev/mapper/DATA07 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA08 /dev/mapper/DATA08 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA09 /dev/mapper/DATA09 --init
[root@xyjj-01 bin]# ./asmcmd afd_label DATA10 /dev/mapper/DATA10 --init
[root@xyjj-01 bin]# 
[root@xyjj-01 bin]# 
[root@xyjj-01 bin]# ./asmcd afd_lslbl
-bash: ./asmcd: No such file or directory
[root@xyjj-01 bin]# ./asmcmd afd_lslbl
Could not open pfile '/etc/oracleafd.conf'--------------------------------------------------------------------------------
Label                     Duplicate  Path
================================================================================
DATA00                            Y   /dev/sdl
DATA00                            Y   /dev/sdz
DATA01                            Y   /dev/sdm
DATA01                            Y   /dev/sdaa
DATA02                            Y   /dev/sdn
DATA02                            Y   /dev/sdab
DATA03                            Y   /dev/sdo
DATA03                            Y   /dev/sdac
DATA04                            Y   /dev/sdf
DATA04                            Y   /dev/sds
DATA05                            Y   /dev/sde
DATA05                            Y   /dev/sdt
DATA06                            Y   /dev/sdh
DATA06                            Y   /dev/sdu
DATA07                            Y   /dev/sdg
DATA07                            Y   /dev/sdv
DATA08                            Y   /dev/sdi
DATA08                            Y   /dev/sdw
DATA09                            Y   /dev/sdj
DATA09                            Y   /dev/sdx
DATA10                            Y   /dev/sdk
DATA10                            Y   /dev/sdy
OCR00                             Y   /dev/sdp
OCR00                             Y   /dev/sdb
OCR01                             Y   /dev/sdq
OCR01                             Y   /dev/sdc
OCR02                             Y   /dev/sdr
OCR02                             Y   /dev/sdd
[root@xyjj-01 bin]# 

改变上述创建的ASM裸设备的拥有者:

chown -R grid:oinstall /dev/mapper/OCR00
chown -R grid:oinstall /dev/mapper/OCR01
chown -R grid:oinstall /dev/mapper/OCR02
chown -R grid:oinstall /dev/mapper/DATA00
chown -R grid:oinstall /dev/mapper/DATA01
chown -R grid:oinstall /dev/mapper/DATA02
chown -R grid:oinstall /dev/mapper/DATA03
chown -R grid:oinstall /dev/mapper/DATA04
chown -R grid:oinstall /dev/mapper/DATA05
chown -R grid:oinstall /dev/mapper/DATA06
chown -R grid:oinstall /dev/mapper/DATA07
chown -R grid:oinstall /dev/mapper/DATA08
chown -R grid:oinstall /dev/mapper/DATA09
chown -R grid:oinstall /dev/mapper/DATA10

注意:这里要设置为 grid:oinstall用户和组,设置为其它,有可能导致+ASM实例无法启动)

在/etc/rc.local文件中,添加上述命令,以确保asm 裸设备 所有者为grid:asmadmin

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

chown -R grid:oinstall /dev/mapper/OCR00
chown -R grid:oinstall /dev/mapper/OCR01
chown -R grid:oinstall /dev/mapper/OCR02
chown -R grid:oinstall /dev/mapper/DATA00
chown -R grid:oinstall /dev/mapper/DATA01
chown -R grid:oinstall /dev/mapper/DATA02
chown -R grid:oinstall /dev/mapper/DATA03
chown -R grid:oinstall /dev/mapper/DATA04
chown -R grid:oinstall /dev/mapper/DATA05
chown -R grid:oinstall /dev/mapper/DATA06
chown -R grid:oinstall /dev/mapper/DATA07
chown -R grid:oinstall /dev/mapper/DATA08
chown -R grid:oinstall /dev/mapper/DATA09
chown -R grid:oinstall /dev/mapper/DATA10

修改rc.local的文件特性,使其开机自动运行:

chmod +x /etc/rc.local

删除root帐户下的ORACLE_BASE环境变量设置:

# unset ORACLE_BASE

4.安装 grid

  • LINUX.X64_193000_grid_home.zip
  • LINUX.X64_193000_db_home.zip
  • p6880880_190000_Linux-x86-64.zip:Opatch
  • p33509923_190000_Linux-x86-64.zip:The GI Release Update 19.14.0.0.220118 includes updates for both the Oracle Grid Infrastructure home and Oracle Database home that can be applied in a rolling fashion.

step 1.解压 grid 安装包

su - grid -c "unzip -q /home/grid/LINUX.X64_193000_grid_home.zip -d /u01/app/19.3.0/grid/"

解压 Opatch 和 RU补丁

su - grid -c "unzip -q -o /home/grid/p6880880_190000_Linux-x86-64.zip -d /u01/app/19.3.0/grid"
su - grid -c "unzip -q /home/grid/p33509923_190000_Linux-x86-64.zip -d /home/grid"

step 2.安装 cvuqdisk,后面先决条件会检查,提前安装

rpm -ivh /u01/app/19.3.0/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm

节点2 也需要安装。

step 3.安装Grid软件
执行安装程序开始安装,通过-applyRU参数指向补丁解压位置,提前安装grid补丁

LANG=en_US
cd $ORACLE_HOME
./gridSetup.sh -applyRU /soft/33509923






私有心跳网络和ASM用途




ASM 磁盘









5.Installation database

5.1.安装前

step 1.Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

step 2.解压文件
解压 database 安装包

su - oracle -c "unzip -q  /home/oracle/LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/db/"

解压 Opatch 和 RU补丁

su - oracle -c "unzip -q -o /home/oracle/p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.3.0/db"

step 3.Edit cvu_config and change the following line:

[WARNING] [INS-08101] Unexpected error while executing the action at state: 'supportedOSCheck'
   CAUSE: No additional information available.
   ACTION: Contact Oracle Support Services or refer to the software manual.
   SUMMARY:
       - java.lang.NullPointerException

Edit cvu_config and change the following line:

# Fake Oracle Linux 7.
export CV_ASSUME_DISTID=OEL8.4

5.2.安装

Interactive mode

./runInstaller 

Silent mode

./runInstaller -ignorePrereq -waitforcompletion -silent                        \
    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \
    oracle.install.option=INSTALL_DB_SWONLY                                    \
    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \
    UNIX_GROUP_NAME=oinstall                                                   \
    INVENTORY_LOCATION=${ORA_INVENTORY}                                        \
    SELECTED_LANGUAGES=en,en_GB                                                \
    ORACLE_HOME=${ORACLE_HOME}                                                 \
    ORACLE_BASE=${ORACLE_BASE}                                                 \
    oracle.install.db.InstallEdition=EE                                        \
    oracle.install.db.OSDBA_GROUP=dba                                          \
    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \
    oracle.install.db.OSDGDBA_GROUP=dba                                        \
    oracle.install.db.OSKMDBA_GROUP=dba                                        \
    oracle.install.db.OSRACDBA_GROUP=dba                                       \
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \
    DECLINE_SECURITY_UPDATES=true

升级安装

在安装节点的GI HOME和DB HOME下,都更新为符合应用补丁需求的OPatch版本。 将之前OPatch备份,解压新版本的OPatch到$ORACLE_HOME目录下,最后检查OPatch版本。

mv OPatch OPatch_bak

unzip p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME

$ORACLE_HOME/OPatch/opatch version

OPatch Version: 12.2.0.1.35

执行升级安装

/u01/app/oracle/product/19.0.0/dbhome_1/runInstaller -applyRU /tmp/34130714

成功应用 RU 后,OUI 会启动安装程序。数据库安装与普通单实例基本相同。

5.3.Run the root scripts when prompted.

As a root user, execute the following script(s):

  1. /u01/app/oraInventory/orainstRoot.sh
  2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh

6.Patch Installation (Optional)

export SOFTWARE_DIR=/u01/software
export PATH=${ORACLE_HOME}/OPatch:${PATH}
export OPATCH_FILE="p6880880_190000_Linux-x86-64.zip"
export PATCH_FILE="p30783543_190000_Linux-x86-64.zip"
export PATCH_TOP=${SOFTWARE_DIR}/30783543
export PATCH_PATH1=${PATCH_TOP}/30869156
export PATCH_PATH2=${PATCH_TOP}/30805684

# Prepare opatch.
cd ${ORACLE_HOME}
unzip -oq ${SOFTWARE_DIR}/${OPATCH_FILE}

# Unzip software.
cd ${SOFTWARE_DIR}
unzip -oq ${PATCH_FILE}

cd ${PATCH_PATH1}
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
opatch apply -silent

cd ${PATCH_PATH2}
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
opatch apply -silent

7.Database Creation

7.1.启动监听

# Start the listener.
lsnrctl start

7.2.创建数据库

Interactive mode.

dbca

Silent mode

dbca -silent -createDatabase                                                   \
     -templateName General_Purpose.dbc                                         \
     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \
     -characterSet AL32UTF8                                                    \
     -sysPassword Admin123                                                     \
     -systemPassword Admin123                                                  \
     -createAsContainerDatabase true                                           \
     -numberOfPDBs 1                                                           \
     -pdbName ${PDB_NAME}                                                      \
     -pdbAdminPassword PdbPassword1                                            \
     -databaseType MULTIPURPOSE                                                \
     -memoryMgmtType auto_sga                                                  \
     -totalMemory 4096                                                         \
     -storageType FS                                                           \
     -datafileDestination "${DATA_DIR}"                                        \
     -redoLogFileSize 50                                                       \
     -emConfiguration NONE                                                     \
     -ignorePreReqs

7.3.Post Installation

step 1.Edit the “/etc/oratab” file setting the restart flag for each instance to ‘Y’.

cdb1:/u01/app/oracle/product/19.0.0/dbhome_1:Y

step 2.Enable Oracle Managed Files (OMF) and make sure the PDB starts when the instance starts.

sqlplus / as sysdba <<EOF
alter system set db_create_file_dest='${DATA_DIR}';
alter pluggable database ${PDB_NAME} save state;
exit;
EOF
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论