1、操作系统配置
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
关闭NetworkManager
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
关闭selinux
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
setenforce 0
关闭avahi
systemctl stop avahi-daemon.socket
systemctl stop avahi-daemon.service
systemctl disable avahi-daemon.service
ps -ef|grep avahi-daemon
kill -9 pid avahi-daemon
“NOZEROCONF=yes” 包含在 /etc/sysconfig/network
sed -i '$a\NOZEROCONF=yes' /etc/sysconfig/network
配置yum,安装系统包
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
vi /etc/yum.repos.d/oracle.repo
[Server]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=file:///media/cdrom
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel libXext libXtst libX11 libXau libxcb libXi compat-libcap1 iscsi-initiator-utils *vnc* -y
yum install bc binutils compat-libcap1 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six smartmontools sysstat targetcli -y
vi /etc/hosts
192.168.56.51 rac1
192.168.56.52 rac2
192.168.56.53 rac1-vip
192.168.56.54 rac2-vip
192.168.56.55 rac-scan
10.10.10.51 rac1-priv
10.10.10.52 rac2-priv
vi /etc/security/limits.conf
#for oracle
grid soft nproc 16384
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid hard stack 32768
grid soft stack 10240
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard stack 32768
oracle soft stack 10240
oracle hard memlock 3145728
oracle soft memlock 3145728
vi /etc/pam.d/login
session required pam_limits.so
vi /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
umask 022
fi
vi /etc/sysctl.d/97-oracle-database-sysctl.conf
kernel.shmall = 4194304 physical RAM/page_size getconf PAGE_SIZE 2097152
kernel.shmmax = 16106127360 1/2 of physical RAM 4294967296=4G 4294967296 最好大约SGA的大小
kernel.shmmni = 4096
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 = 4194304
fs.file-max = 6815744
vm.min_free_kbytes=524288
kernel.randomize_va_space=0
kernel.panic_on_oops = 1
kernel.numa_balancing = 0
#/sbin/sysctl --system
创建用户
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/useradd -u 54331 -g oinstall -G dba,asmdba,asmoper,asmadmin,racdba grid
/usr/sbin/useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle
echo "oracle" | passwd --stdin oracle
echo "grid" | passwd --stdin grid
创建目录
mkdir -p /u01/app/19.0.0/grid
mkdir -p /u01/app/grid
mkdir -p /u02/app/oracle/product/19.0.0/db_1
chown -R grid:oinstall /u01/
chown -R oracle:oinstall /u02/
chmod -R 775 /u01/ /u02/
配置环境变量
vi /home/grid/.bash_profile
if [ -t 0 ]; then
stty intr ^C
fi
PS1="[`whoami`@`hostname`:"'$PWD]$ '
export PS1
export ORACLE_SID=+ASM1 --节点2改为+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.0.0/grid
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:$ORACLE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LANG=C
umask 022
vi /home/oracle/.bash_profile
if [ -t 0 ]; then
stty intr ^C
fi
PS1="[`whoami`@`hostname`:"'$PWD]$ '
export PS1
export ORACLE_SID=orcl1 --节点2改为orcl2
export ORACLE_BASE=/u02/app/oracle
export ORACLE_HOME=/u02/app/oracle/product/19.0.0/db_1
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LANG=C
umask 022
禁用NTPD服务:
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
mv /etc/resolv.conf /etc/resolv.conf.bak
systemctl stop chronyd
systemctl disable chronyd
mv /etc/resolv.conf /etc/resolv.conf.bak
mv /etc/chrony.conf /etc/chrony.conf.bak
建议关闭透明大页及NUMA
1 修改grub文件
cp /etc/default/grub /etc/default/grub.bak
vi /etc/default/grub
2 添加transparent_hugepage=never numa=off到GRUB_CMDLINE_LINUX的**行尾**,不要直接替换此行
GRUB_CMDLINE_LINUX=
"rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never numa=off
3 执行命令
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
4 不重启生效
[root@rac1 ~]#echo never > /sys/kernel/mm/transparent_hugepage/enabled
5 查看是否禁用透明大页
[root@rac1 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
[root@rac2 ~]# grep AnonHugePages /proc/meminfo
AnonHugePages: 0 kB---------->>>返回值若是零,代表成功禁用THP
配置共享存储
查询磁盘设备的wwid
for i in `cat /proc/partitions | awk '{print $4}' |grep sd | grep [a-z]$`; do echo "### $i: ` /usr/lib/udev/scsi_id -g -u -d /dev/$i`"; done
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB6ad1e9ef-331e7e1c", RUN+="/bin/sh -c 'mknod /dev/raw/raw1 b $major $minor; chown grid:asmadmin /dev/raw/raw1; chmod 0660 /dev/raw/raw1'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB65e80c32-76759d78", RUN+="/bin/sh -c 'mknod /dev/raw/raw2 b $major $minor; chown grid:asmadmin /dev/raw/raw2; chmod 0660 /dev/raw/raw2'"
/sbin/udevadm trigger --type=devices --action=change
# ll /dev/raw
2、安装GI
[root@rac1 ~]# su - grid
[grid@rac1:/home/grid]$ unzip /opt/LINUX.X64_193000_grid_home.zip -d $ORACLE_HOME
[root@rac1 ~]# /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@rac1 ~]# /u01/app/19.0.0/grid/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/19.0.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/19.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/rac1/crsconfig/rootcrs_rac1_2020-03-17_11-31-30AM.log
2020/03/17 11:31:53 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2020/03/17 11:31:53 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2020/03/17 11:31:53 CLSRSC-363: User ignored prerequisites during installation
2020/03/17 11:31:53 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2020/03/17 11:31:55 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2020/03/17 11:31:56 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2020/03/17 11:31:56 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2020/03/17 11:31:57 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2020/03/17 11:32:40 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2020/03/17 11:32:41 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2020/03/17 11:32:46 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2020/03/17 11:33:03 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2020/03/17 11:33:03 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2020/03/17 11:33:09 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2020/03/17 11:33:10 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2020/03/17 11:34:11 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2020/03/17 11:35:05 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2020/03/17 11:35:51 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2020/03/17 11:35:58 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
[INFO] [DBT-30161] Disk label(s) created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-200317AM113635.log for details.
2020/03/17 11:38:00 CLSRSC-482: Running command: '/u01/app/19.0.0/grid/bin/ocrconfig -upgrade grid oinstall'
CRS-4256: Updating the profile
Successful addition of voting disk 63fa84d7b8114f78bfc9cab34b596cbb.
Successful addition of voting disk 879e4648e7934f87bf52edd826576142.
Successful addition of voting disk a64cd70858e74f7fbf1ac454f41a0e75.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 63fa84d7b8114f78bfc9cab34b596cbb (AFD:CRS1) [CRS]
2. ONLINE 879e4648e7934f87bf52edd826576142 (AFD:CRS2) [CRS]
3. ONLINE a64cd70858e74f7fbf1ac454f41a0e75 (AFD:CRS3) [CRS]
Located 3 voting disk(s).
2020/03/17 11:39:48 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2020/03/17 11:41:32 CLSRSC-343: Successfully started Oracle Clusterware stack
2020/03/17 11:41:32 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2020/03/17 11:43:10 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2020/03/17 11:43:52 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@rac2 ~]# /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@rac2 ~]# /u01/app/19.0.0/grid/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/19.0.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/19.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/rac2/crsconfig/rootcrs_rac2_2020-03-17_11-45-29AM.log
2020/03/17 11:45:38 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2020/03/17 11:45:38 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2020/03/17 11:45:38 CLSRSC-363: User ignored prerequisites during installation
2020/03/17 11:45:38 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2020/03/17 11:45:40 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2020/03/17 11:45:40 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2020/03/17 11:45:40 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2020/03/17 11:45:42 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2020/03/17 11:45:43 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2020/03/17 11:45:43 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2020/03/17 11:45:53 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2020/03/17 11:45:53 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2020/03/17 11:45:55 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2020/03/17 11:45:55 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2020/03/17 11:46:15 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2020/03/17 11:47:00 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2020/03/17 11:47:57 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2020/03/17 11:48:42 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2020/03/17 11:48:43 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
2020/03/17 11:48:55 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2020/03/17 11:49:52 CLSRSC-343: Successfully started Oracle Clusterware stack
2020/03/17 11:49:52 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2020/03/17 11:50:09 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2020/03/17 11:50:35 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Error 4 opening dom ASM/Self in 0x63a08d0
Domain name to open is ASM/Self
Error 4 opening dom ASM/Self in 0x63a08d0
3、ASMCA 创建磁盘组
[root@rac1 ~]# /u01/app/19.0.0/grid/bin/crsctl status res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.chad
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.net1.network
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.ons
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.proxy_advm
OFFLINE OFFLINE rac1 STABLE
OFFLINE OFFLINE rac2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.CRS.dg(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 ONLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac1 Started,STABLE
2 ONLINE ONLINE rac2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE rac1 STABLE
ora.qosmserver
1 ONLINE ONLINE rac1 STABLE
ora.rac1.vip
1 ONLINE ONLINE rac1 STABLE
ora.rac2.vip
1 ONLINE ONLINE rac2 STABLE
ora.scan1.vip
1 ONLINE ONLINE rac1 STABLE
--------------------------------------------------------------------------------
4、安装DB
[root@rac1 ~]# su - oracle
[oracle@rac1:/home/oracle]$ unzip /opt/LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
[root@rac1 ~]# /u02/app/oracle/product/19.0.0/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u02/app/oracle/product/19.0.0/db_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.
[root@rac2 ~]# /u02/app/oracle/product/19.0.0/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u02/app/oracle/product/19.0.0/db_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.
5、DBCA建库
[root@rac1 ~]# /u01/app/19.0.0/grid/bin/crsctl status res -t
-------------------------------------------------------------------------------
Name Target State Server State details
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.chad
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.net1.network
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.ons
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.proxy_advm
OFFLINE OFFLINE rac1 STABLE
OFFLINE OFFLINE rac2 STABLE
-------------------------------------------------------------------------------
Cluster Resources
-------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.CRS.dg(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 ONLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac1 Started,STABLE
2 ONLINE ONLINE rac2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE rac1 STABLE
ora.orcl.db
1 ONLINE ONLINE rac1 Open,HOME=/u02/app/o
racle/product/19.0.0
/db_1,STABLE
2 ONLINE ONLINE rac2 Open,HOME=/u02/app/o
racle/product/19.0.0
/db_1,STABLE
ora.qosmserver
1 ONLINE ONLINE rac1 STABLE
ora.rac1.vip
1 ONLINE ONLINE rac1 STABLE
ora.rac2.vip
1 ONLINE ONLINE rac2 STABLE
ora.scan1.vip
1 ONLINE ONLINE rac1 STABLE
-------------------------------------------------------------------------------
6、两个节点滚动安装RU 19.6.0.0.0
节点1
更新OPatch
[root@rac1 opt]# su - grid
[grid@rac1:/home/grid]$ cd $ORACLE_HOME
[grid@rac1:/u01/app/19.0.0/grid]$ unzip /opt/12.2.0.1.19_p6880880_190000_Linux-x86-64.zip -d ./
replace ./OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[grid@rac1:/u01/app/19.0.0/grid]$ ./OPatch/opatch version
OPatch Version: 12.2.0.1.19
[root@rac1 opt]# su - oracle
Last login: Wed Mar 18 10:18:56 CST 2020
[oracle@rac1:/home/oracle]$ unzip /opt/12.2.0.1.19_p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME
replace /u02/app/oracle/product/19.0.0/db_1/OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
解压补丁包
[root@rac1 ~]# mkdir /oraru
[root@rac1 ~]# chown -R grid:oinstall /oraru/
[root@rac1 ~]# su - grid
[grid@rac1:/home/grid]$ unzip /opt/GI_19.6.0.0.200114_p30501910_190000_Linux-x86-64.zip -d /oraru/
开始打补丁
[root@rac1 ~]# export ORACLE_HOME=/u01/app/19.0.0/grid
[root@rac1 ~]# export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[root@rac1 ~]# opatch version
OPatch Version: 12.2.0.1.19
OPatch succeeded.
[root@rac1 ~]# opatchauto apply /oraru/30501910
OPatchauto session is initiated at Wed Mar 18 11:40:29 2020
System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2020-03-18_11-40-34AM.log.
Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2020-03-18_11-41-48AM.log
The id for this session is GKFC
Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid
Executing OPatch prereq operations to verify patch applicability on home /u02/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /u02/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /u01/app/19.0.0/grid
Verifying SQL patch applicability on home /u02/app/oracle/product/19.0.0/db_1
SQL patch applicability verified successfully on home /u02/app/oracle/product/19.0.0/db_1
Preparing to bring down database service on home /u02/app/oracle/product/19.0.0/db_1
Successfully prepared home /u02/app/oracle/product/19.0.0/db_1 to bring down database service
Bringing down CRS service on home /u01/app/19.0.0/grid
CRS service brought down successfully on home /u01/app/19.0.0/grid
Performing prepatch operation on home /u02/app/oracle/product/19.0.0/db_1
Perpatch operation completed successfully on home /u02/app/oracle/product/19.0.0/db_1
Start applying binary patch on home /u02/app/oracle/product/19.0.0/db_1
Binary patch applied successfully on home /u02/app/oracle/product/19.0.0/db_1
Performing postpatch operation on home /u02/app/oracle/product/19.0.0/db_1
Postpatch operation completed successfully on home /u02/app/oracle/product/19.0.0/db_1
Start applying binary patch on home /u01/app/19.0.0/grid
Binary patch applied successfully on home /u01/app/19.0.0/grid
Starting CRS service on home /u01/app/19.0.0/grid
CRS service started successfully on home /u01/app/19.0.0/grid
Preparing home /u02/app/oracle/product/19.0.0/db_1 after database service restarted
No step execution required.........
Trying to apply SQL patch on home /u02/app/oracle/product/19.0.0/db_1
SQL patch applied successfully on home /u02/app/oracle/product/19.0.0/db_1
OPatchAuto successful.
--------------------------------Summary--------------------------------
Patching is completed successfully. Please find the summary as follows:
Host:rac1
RAC Home:/u02/app/oracle/product/19.0.0/db_1
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /oraru/30501910/30489632
Reason: This patch is not applicable to this specified target type - "rac_database"
Patch: /oraru/30501910/30655595
Reason: This patch is not applicable to this specified target type - "rac_database"
==Following patches were SUCCESSFULLY applied:
Patch: /oraru/30501910/30489227
Log: /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_11-47-00AM_1.log
Patch: /oraru/30501910/30557433
Log: /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_11-47-00AM_1.log
Host:rac1
CRS Home:/u01/app/19.0.0/grid
Version:19.0.0.0.0
Summary:
==Following patches were SUCCESSFULLY applied:
Patch: /oraru/30501910/30489227
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_11-58-04AM_1.log
Patch: /oraru/30501910/30489632
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_11-58-04AM_1.log
Patch: /oraru/30501910/30557433
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_11-58-04AM_1.log
Patch: /oraru/30501910/30655595
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_11-58-04AM_1.log
OPatchauto session completed at Wed Mar 18 12:16:56 2020
Time taken to complete the session 36 minutes, 28 seconds
将节点1的oui-patch.xml文件复制到节点2
[root@rac1 ~]# ll /u01/app/oraInventory/ContentsXML/oui-patch.xml
-rw-rw---- 1 grid oinstall 174 Mar 18 12:08 /u01/app/oraInventory/ContentsXML/oui-patch.xml
[root@rac2 ~]# ll /u01/app/oraInventory/ContentsXML/oui-patch.xml
ls: cannot access /u01/app/oraInventory/ContentsXML/oui-patch.xml: No such file or directory
[root@rac1 ~]# scp -rp /u01/app/oraInventory/ContentsXML/oui-patch.xml rac2:/u01/app/oraInventory/ContentsXML
[root@rac2 ~]# chown grid:oinstall /u01/app/oraInventory/ContentsXML/oui-patch.xml
[root@rac2 ~]# ll /u01/app/oraInventory/ContentsXML/oui-patch.xml
-rw-rw---- 1 grid oinstall 174 Mar 18 12:08 /u01/app/oraInventory/ContentsXML/oui-patch.xml
节点2重复节点1的打补丁操作
[root@rac2 opt]# su - grid
[grid@rac2:/home/grid]$ cd $ORACLE_HOME
[grid@rac2:/u01/app/19.0.0/grid]$ unzip /opt/12.2.0.1.19_p6880880_190000_Linux-x86-64.zip -d ./
replace ./OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[grid@rac2:/u01/app/19.0.0/grid]$ ./OPatch/opatch version
OPatch Version: 12.2.0.1.19
[root@rac2 opt]# su - oracle
Last login: Wed Mar 18 10:18:56 CST 2020
[oracle@rac2:/home/oracle]$ unzip /opt/12.2.0.1.19_p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME
replace /u02/app/oracle/product/19.0.0/db_1/OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[root@rac2 ~]# mkdir /oraru
[root@rac2 ~]# chown -R grid:oinstall /oraru/
[root@rac2 ~]# su - grid
[grid@rac2:/home/grid]$ unzip /opt/GI_19.6.0.0.200114_p30501910_190000_Linux-x86-64.zip -d /oraru/
[root@rac2 ~]# export ORACLE_HOME=/u01/app/19.0.0/grid
[root@rac2 ~]# export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[root@rac2 ~]# opatch version
OPatch Version: 12.2.0.1.19
OPatch succeeded.
[root@rac2 ~]# opatchauto apply /oraru/30501910
OPatchauto session is initiated at Wed Mar 18 12:34:43 2020
System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2020-03-18_12-34-54PM.log.
Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2020-03-18_12-37-53PM.log
The id for this session is GVVD
Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid
Executing OPatch prereq operations to verify patch applicability on home /u02/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /u02/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /u01/app/19.0.0/grid
Verifying SQL patch applicability on home /u02/app/oracle/product/19.0.0/db_1
SQL patch applicability verified successfully on home /u02/app/oracle/product/19.0.0/db_1
Preparing to bring down database service on home /u02/app/oracle/product/19.0.0/db_1
Successfully prepared home /u02/app/oracle/product/19.0.0/db_1 to bring down database service
Bringing down CRS service on home /u01/app/19.0.0/grid
CRS service brought down successfully on home /u01/app/19.0.0/grid
Performing prepatch operation on home /u02/app/oracle/product/19.0.0/db_1
Perpatch operation completed successfully on home /u02/app/oracle/product/19.0.0/db_1
Start applying binary patch on home /u02/app/oracle/product/19.0.0/db_1
Binary patch applied successfully on home /u02/app/oracle/product/19.0.0/db_1
Performing postpatch operation on home /u02/app/oracle/product/19.0.0/db_1
Postpatch operation completed successfully on home /u02/app/oracle/product/19.0.0/db_1
Start applying binary patch on home /u01/app/19.0.0/grid
Binary patch applied successfully on home /u01/app/19.0.0/grid
Starting CRS service on home /u01/app/19.0.0/grid
CRS service started successfully on home /u01/app/19.0.0/grid
Preparing home /u02/app/oracle/product/19.0.0/db_1 after database service restarted
No step execution required.........
Trying to apply SQL patch on home /u02/app/oracle/product/19.0.0/db_1
SQL patch applied successfully on home /u02/app/oracle/product/19.0.0/db_1
OPatchAuto successful.
--------------------------------Summary--------------------------------
Patching is completed successfully. Please find the summary as follows:
Host:rac2
RAC Home:/u02/app/oracle/product/19.0.0/db_1
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /oraru/30501910/30489632
Reason: This patch is not applicable to this specified target type - "rac_database"
Patch: /oraru/30501910/30655595
Reason: This patch is not applicable to this specified target type - "rac_database"
==Following patches were SUCCESSFULLY applied:
Patch: /oraru/30501910/30489227
Log: /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_12-49-03PM_1.log
Patch: /oraru/30501910/30557433
Log: /u02/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_12-49-03PM_1.log
Host:rac2
CRS Home:/u01/app/19.0.0/grid
Version:19.0.0.0.0
Summary:
==Following patches were SUCCESSFULLY applied:
Patch: /oraru/30501910/30489227
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_12-59-36PM_1.log
Patch: /oraru/30501910/30489632
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_12-59-36PM_1.log
Patch: /oraru/30501910/30557433
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_12-59-36PM_1.log
Patch: /oraru/30501910/30655595
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-03-18_12-59-36PM_1.log
OPatchauto session completed at Wed Mar 18 13:35:07 2020
Time taken to complete the session 60 minutes, 25 seconds
检查
[grid@rac1:/home/grid]$ $ORACLE_HOME/OPatch/opatch lsinventory
[grid@rac2:/home/grid]$ /u01/app/19.0.0/grid/OPatch/opatch lspatches
30655595;TOMCAT RELEASE UPDATE 19.0.0.0.0 (30655595)
30557433;Database Release Update : 19.6.0.0.200114 (30557433)
30489632;ACFS RELEASE UPDATE 19.6.0.0.0 (30489632)
30489227;OCW RELEASE UPDATE 19.6.0.0.0 (30489227)
OPatch succeeded.
SQL> select STATUS,DESCRIPTION from dba_registry_sqlpatch;
STATUS
-------------------------
DESCRIPTION
-------------------------------------------------------------------------------
SUCCESS
Database Release Update : 19.3.0.0.190416 (29517242)
SUCCESS
Database Release Update : 19.6.0.0.200114 (30557433)
最后修改时间:2022-02-12 16:30:41
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。