m6米乐安卓版下载-米乐app官网下载
18

适合新人练手:centos7.4 vmware搭建oralce 11g rac 日常操作 -m6米乐安卓版下载

吴明 2022-05-05
1817

以下操作过程适合新人练手,搭建、更新补丁、配置归档等等都是日常操作内容。后续我将本套vmware虚拟机环境、操作手册、各种安装包上传供新手学习,如有问题,请留言。

一、系统环境准备

系统版本 主机名 网卡(桥接) public ip 网卡(仅主机) private ip vip scan ip 实例名
centos7.4 rac1 ens33 172.22.180.221 ens34 10.0.0.1 172.22.180.223 172.22.180.225 rac1
centos7.4 rac2 ens33 172.22.180.222 ens34 10.0.0.2 172.22.180.224 172.22.180.225 rac2

以下操作在两台节点都执行,以节点1 为例

1,创建用户和组、配置主机名

[root@rac1 ~]# /usr/sbin/groupadd -g 5001 oinstall [root@rac1 ~]# /usr/sbin/groupadd -g 5002 dba [root@rac1 ~]# /usr/sbin/groupadd -g 5003 oper [root@rac1 ~]# /usr/sbin/groupadd -g 5004 asmadmin [root@rac1 ~]# /usr/sbin/groupadd -g 5005 asmoper [root@rac1 ~]# /usr/sbin/groupadd -g 5006 asmdba [root@rac1 ~]# /usr/sbin/useradd -u 6001 -g oinstall -g dba,asmdba,oper oracle [root@rac1 ~]# /usr/sbin/useradd -u 6002 -g oinstall -g asmadmin,asmdba,asmoper,oper,dba grid [root@rac1 ~]# echo "grid" | passwd --stdin grid [root@rac1 ~]# echo "oracle" | passwd --stdin oracle [root@rac1 ~]# vi /etc/hosts #public ip 172.22.180.221 rac1 172.22.180.222 rac2 #private ip 10.0.0.1 rac1-priv 10.0.0.2 rac2-priv #vip 172.22.180.223 rac1-vip 172.22.180.224 rac2-vip #scanip 172.22.180.225 scan

2,创建目录

[root@rac1 ~]# mkdir -p /oracle/app/grid [root@rac1 ~]# mkdir -p /oracle/app/11.2.0/grid [root@rac1 ~]# chown -r grid:oinstall /oracle [root@rac1 ~]# mkdir -p /oracle/app/orainventory [root@rac1 ~]# chown -r grid:oinstall /oracle/app/orainventory/ [root@rac1 ~]# mkdir -p /oracle/app/oracle [root@rac1 ~]# chown -r oracle:oinstall /oracle/app/oracle/ [root@rac1 ~]# chmod -r 755 /oracle/ [root@rac1 ~]# mkdir -p /tmp/soft

3,配置本地yum源、安装包

[root@rac1 ~]# mount /dev/cdrom /mnt [root@rac1 ~]# cd /etc/yum.repos.d [root@rac1 yum.repos.d]# mkdir bk [root@rac1 yum.repos.d]# mv *.repo bk/ [root@rac1 yum.repos.d]# echo "[el]" >> /etc/yum.repos.d/local.repo [root@rac1 yum.repos.d]# echo "name =linux 7.x dvd" >> /etc/yum.repos.d/local.repo [root@rac1 yum.repos.d]# echo "baseurl=file:///mnt" >> /etc/yum.repos.d/local.repo [root@rac1 yum.repos.d]# echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo [root@rac1 yum.repos.d]# echo "enabled=1" >> /etc/yum.repos.d/local.repo [root@rac1 yum.repos.d]# echo "/dev/cdrom /mnt iso9660 defaults 0 0" >> /etc/fstab [root@rac1 yum.repos.d]# yum -y install smartmontools vnc* install autoconf automake binutils binutils-devel bison cpp dos2unix ftp gcc gcc-c lrzsz python-devel compat-db* compat-gcc-34 compat-gcc-34-c compat-libcap1 compat-libstdc -33 compat-libstdc -33.i686 glibc-* glibc-*.i686 libxpm-*.i686 libxp.so.6 libxt.so.6 libxtst.so.6 libxext libxext.i686 libxtst libxtst.i686 libx11 libx11.i686 libxau libxau.i686 libxcb libxcb.i686 libxi libxi.i686 libgcc_s.so.1 libstdc .i686 libstdc -devel libstdc -devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 ksh libxp libaio-devel numactl numactl-devel make -y sysstat -y unixodbc unixodbc-devel elfutils-libelf-devel-0.97 elfutils-libelf-devel redhat-lsb-core unzip [root@rac1 yum.repos.d]# yum groupinstall –y "gnome desktop" "x window system" "desktop" [root@rac1 yum.repos.d]# rpm -ivh /tmp/soft/cvuqdisk-1.0.9-1.rpm [root@rac1 yum.repos.d]# rpm -ivh /tmp/soft/compat-libstdc -33-3.2.3-72.el7.x86_64.rpm [root@rac1 yum.repos.d]# rpm -e ksh-20120801-34.el7.x86_64 [root@rac1 yum.repos.d]# rpm -ivh /tmp/soft/pdksh-5.2.14-37.el5_8.1.x86_64.rpm

4,修改系统资源限制

[root@rac1 yum.repos.d]# vi /etc/security/limits.conf 新增内容如下 #oracle setting grid soft nproc 16384 grid hard nproc 16384 grid soft nofile 65536 grid hard nofile 65536 grid soft stack 32768 grid hard stack 32768 oracle soft nproc 16384 oracle hard nproc 16384 oracle soft nofile 65536 oracle hard nofile 65536 oracle soft stack 32768 oracle hard stack 32768 oracle hard memlock 2000000 oracle soft memlock 2000000 [root@rac1 yum.repos.d]# echo "* - nproc 16384" > /etc/security/limits.d/20-nproc.conf [root@rac1 yum.repos.d]# echo "session required pam_limits.so" >> /etc/pam.d/login

5,修改系统内核参数

[root@rac1 yum.repos.d]# vi /etc/sysctl.conf #oracle setting fs.aio-max-nr = 1048576 fs.file-max = 6815744 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 = 1048586 kernel.panic_on_oops = 1 vm.nr_hugepages = 400 kernel.shmmax = 1610612736 kernel.shmall = 393216 kernel.shmmni = 4096 [root@rac1 yum.repos.d]# /sbin/sysctl -p

6,关闭透明页

[root@rac1 yum.repos.d]# vi /etc/rc.d/rc.local 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 [root@rac1 yum.repos.d]# chmod x /etc/rc.d/rc.local

7,取消numa

[root@rac1 yum.repos.d]# vi /etc/default/grub grub_cmdline_linux="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off" [root@rac1 yum.repos.d]# grub2-mkconfig -o /etc/grub2.cfg

8,关闭服务

[root@rac1 yum.repos.d]# echo "selinux=disabled" > /etc/selinux/config [root@rac1 yum.repos.d]# echo "#selinuxtype=targeted " >> /etc/selinux/config [root@rac1 yum.repos.d]# setenforce 0 [root@rac1 yum.repos.d]# systemctl stop firewalld.service [root@rac1 yum.repos.d]# systemctl disable firewalld.service [root@rac1 ~]# systemctl stop networkmanager [root@rac1 ~]# systemctl disable networkmanager [root@rac1 ~]# ifconfig virbr0 down [root@rac1 ~]# brctl delbr virbr0 [root@rac1 ~]# systemctl disable libvirtd [root@rac1 ~]# systemctl restart network.service [root@rac1 ~]# systemctl disable ntpd [root@rac1 ~]# systemctl stop ntpd

9,修改用户环境变量、配置ssh信任

[root@rac1 ~]# vi .bash_profile path=$path:$home/bin:/oracle/app/11.2.0/grid/bin [root@rac1 yum.repos.d]# su - grid [grid@rac1 ~]$ vi .bash_profile ps1="[`whoami`@`hostname`:"'$pwd]$' export ps1 umask 022 export tmp=/tmp export lang=en_us export tmpdir=$tmp oracle_sid= asm1; export oracle_sid oracle_term=xterm; export oracle_term oracle_base=/oracle/app/grid; export oracle_base oracle_home=/oracle/app/11.2.0/grid; export oracle_home nls_date_format="yyyy-mm-dd hh24:mi:ss"; export nls_date_format path=.:$path:$home/bin:$oracle_home/bin; export path threads_flag=native; export threads_flag if [ $user = "oracle" ] || [ $user = "grid" ]; then if [ $shell = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi [root@rac1 yum.repos.d]# su - oracle [oracle@rac1 ~]$ vi .bash_profile ps1="[`whoami`@`hostname`:"'$pwd]$' export ps1 export tmp=/tmp export lang=en_us export tmpdir=$tmp export oracle_unqname=orcl oracle_base=/oracle/app/oracle; export oracle_base oracle_home=$oracle_base/product/11.2.0/db_1; export oracle_home oracle_sid=orcl1; export oracle_sid oracle_term=xterm; export oracle_term nls_date_format="yyyy-mm-dd hh24:mi:ss"; export nls_date_format nls_lang=american_america.zhs16gbk;export nls_lang path=.:$path:$home/bin:$oracle_base/product/11.2.0/db_1/bin:$oracle_home/bin; export path threads_flag=native; export threads_flag if [ $user = "oracle" ] || [ $user = "grid" ]; then if [ $shell = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi [root@rac1 yum.repos.d]# cd /tmp/soft/ [root@rac1 soft]# ll -rw-r--r-- 1 root root 195388 nov 4 23:54 compat-libstdc -33-3.2.3-72.el7.x86_64.rpm -rw-r--r--. 1 root root 8288 aug 26 2013 cvuqdisk-1.0.9-1.rpm -rw-r--r--. 1 root root 1395582860 jan 21 17:27 p13390677_112040_linux-x86-64_1of7.zip -rw-r--r--. 1 root root 1151304589 jan 21 17:28 p13390677_112040_linux-x86-64_2of7.zip -rw-r--r--. 1 root root 1205251894 apr 24 19:43 p13390677_112040_linux-x86-64_3of7.zip -rw-r--r-- 1 root root 123248706 jan 21 17:27 p18370031_112040_linux-x86-64.zip -rw-r--r-- 1 root root 19848 jan 21 17:27 p19404309_112040_linux-x86-64.zip -rw-r--r--. 1 root root 1386494818 apr 24 19:50 p33575261_112040_linux-x86-64 .zip -rw-r--r--. 1 root root 124863526 apr 24 19:36 p6880880_112000_linux-x86-64 .zip -rw-r--r-- 1 root root 210877 nov 5 01:13 pdksh-5.2.14-37.el5_8.1.x86_64.rpm -rw-r--r--. 1 root root 32343 aug 26 2013 sshusersetup.sh [root@rac1 soft]# chmod x sshusersetup.sh [root@rac1 soft]# ./sshusersetup.sh -user grid -hosts "rac1 rac2" -advanced -exverify -confirm [root@rac1 soft]# ./sshusersetup.sh -user oracle -hosts "rac1 rac2" -advanced -exverify -confirm

二、配置asm存储

1,创建共享磁盘

先在节点1添加磁盘,2g3、5g2、8g*1






scsi1:0.filename = ocr1.vmdk"
scsi1:1.filename = ocr2.vmdk"
scsi1:2.filename =ocr3.vmdk"
scsi1:3.filename =data1vmdk.vmdk"
scsi1:4.filename = data2.vmdk"
scsi1:5.filename = fra.vmdk"

再在节点2添加磁盘,虚拟设备节点跟节点1一样

2,修改vmware配置

2台虚拟机关机,然后打开虚拟机安装目录,编辑“.vmx”结尾文件 scsi1.sharedbus = "virtual" disk.locking = "false" disklib.datacachemaxsize = "0" disklib.datacachemaxreadaheadsize = "0" disklib.datacacheminreadaheadsize = "0" disklib.datacachepagesize = "4096" disklib.maxunsyncedwrites = "0" disk.enableuuid = "true" 保存后启动虚拟机。 第二台虚拟机与第一台虚拟机操作一致。 注意:有时disk.enableuuid = "true"参数,配置文件中已存在,留一个即可,否则开机报错

3,获取每块磁盘的uuid

[root@rac1 ~]# fdisk -l |grep sd disk /dev/sda: 42.9 gb, 42949672960 bytes, 83886080 sectors /dev/sda1 * 2048 1026047 512000 83 linux /dev/sda2 1026048 83886079 41430016 8e linux lvm disk /dev/sdc: 2147 mb, 2147483648 bytes, 4194304 sectors disk /dev/sdb: 2147 mb, 2147483648 bytes, 4194304 sectors disk /dev/sdd: 2147 mb, 2147483648 bytes, 4194304 sectors disk /dev/sde: 5368 mb, 5368709120 bytes, 10485760 sectors disk /dev/sdg: 8589 mb, 8589934592 bytes, 16777216 sectors disk /dev/sdf: 5368 mb, 5368709120 bytes, 10485760 sectors [root@rac1 ~]# for i in b c d; > do > echo "sd$i" "`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i` "; > done sdb 36000c295cd7b722a824777ad14edfea4 sdc 36000c2933a3d3e368f0617d67101c4fd sdd 36000c29af4b6848f6be744dfe61cd58b [root@rac1 ~]# for i in e f; > do > echo "sd$i" "`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i` "; > done sde 36000c293b06266f783f78ffa51ff8017 sdf 36000c29edd85099d2fd375823d87b343 [root@rac1 ~]# for i in g; > do > echo "sd$i" "`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i` "; > done sdg 36000c292b0b4af6f63aea0655a6c89b7

4,编辑asm规则文件

[root@rac1 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules kernel=="sd*", subsystem=="block", program=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", result=="36000c295cd7b722a824777ad14edfea4", symlink ="asm-ocr1", owner="grid", group="asmadmin", mode="0660" kernel=="sd*", subsystem=="block", program=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", result=="36000c2933a3d3e368f0617d67101c4fd", symlink ="asm-ocr2", owner="grid", group="asmadmin", mode="0660" kernel=="sd*", subsystem=="block", program=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", result=="36000c29af4b6848f6be744dfe61cd58b", symlink ="asm-ocr3", owner="grid", group="asmadmin", mode="0660" kernel=="sd*", subsystem=="block", program=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", result=="36000c293b06266f783f78ffa51ff8017", symlink ="asm-data1", owner="grid", group="asmadmin", mode="0660" kernel=="sd*", subsystem=="block", program=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", result=="36000c29edd85099d2fd375823d87b343", symlink ="asm-data2", owner="grid", group="asmadmin", mode="0660" kernel=="sd*", subsystem=="block", program=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", result=="36000c292b0b4af6f63aea0655a6c89b7", symlink ="asm-fra", owner="grid", group="asmadmin", mode="0660" 让udev重新加载规则生效 [root@rac1 ~]# /sbin/udevadm control --reload-rules [root@rac1 ~]# /sbin/udevadm trigger --type=devices --action=change [root@rac1 ~]# ll /dev/asm* lrwxrwxrwx 1 root root 3 apr 25 21:28 /dev/asm-data1 -> sde lrwxrwxrwx 1 root root 3 apr 25 21:28 /dev/asm-data2 -> sdf lrwxrwxrwx 1 root root 3 apr 25 21:28 /dev/asm-fra -> sdg lrwxrwxrwx 1 root root 3 apr 25 21:28 /dev/asm-ocr1 -> sdb lrwxrwxrwx 1 root root 3 apr 25 21:28 /dev/asm-ocr2 -> sdc lrwxrwxrwx 1 root root 3 apr 25 21:28 /dev/asm-ocr3 -> sdd [root@rac1 ~]# ll /dev/sd* brw-rw---- 1 root disk 8, 0 apr 25 21:28 /dev/sda brw-rw---- 1 root disk 8, 1 apr 25 21:28 /dev/sda1 brw-rw---- 1 root disk 8, 2 apr 25 21:28 /dev/sda2 brw-rw---- 1 grid asmadmin 8, 16 apr 25 21:28 /dev/sdb brw-rw---- 1 grid asmadmin 8, 32 apr 25 21:28 /dev/sdc brw-rw---- 1 grid asmadmin 8, 48 apr 25 21:28 /dev/sdd brw-rw---- 1 grid asmadmin 8, 64 apr 25 21:28 /dev/sde brw-rw---- 1 grid asmadmin 8, 80 apr 25 21:28 /dev/sdf brw-rw---- 1 grid asmadmin 8, 96 apr 25 21:28 /dev/sdg

三、安装grid软件

1,配置图形化

[root@rac1 soft]# cd /tmp/soft/ [root@rac1 soft]# unzip p13390677_112040_linux-x86-64_3of7.zip [root@rac1 soft]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service [root@rac1 soft]# vi /etc/systemd/system/vncserver\@\:1.service execstart=/usr/sbin/runuser -l -c "/usr/bin/vncserver %i" pidfile=/root/.vnc/%h%i.pid [root@rac1 soft]# systemctl daemon-reload [root@rac1 soft]# su - grid [grid@rac1:/home/grid]$vncserver [grid@rac1:/home/grid]$cd /tmp/soft [grid@rac1:/tmp/soft]$unzip p19404309_112040_linux-x86-64.zip [grid@rac1:/tmp/soft]$cp b19404309/grid/cvu_prereq.xml /tmp/soft/grid/ [grid@rac1:/tmp/soft]$cd /tmp/soft/grid/ [grid@rac1:/tmp/soft/grid]$./runinstaller -jreloc /etc/alternatives/jre_1.8.0

2,安装grid























遇到如上图报错,根据提示执行如下脚本
[grid@rac2:/home/grid]$/oracle/app/11.2.0/grid/oui/bin/runinstaller -jreloc /etc/alternatives/jre_1.8.0 -attachhome -noclusterenabled oracle_home=/oracle/app/11.2.0/grid oracle_home_name=ora11g_gridinfrahome1 cluster_nodes=rac1,rac2 “inventory_location=/oracle/app/orainventory” local_node=rac2
starting oracle universal installer…

checking swap space: must be greater than 500 mb. actual 4095 mb passed
the java runtime environment was not found at /etc/alternatives/jre_1.8.0/bin/java. hence, the oracle universal installer cannot be run.
please visit http://www.javasoft.com and install jre version 1.3.1 or higher and try again.
: no such file or directory
根据上面报错提示没有jre环境,需要安装图形化软件即可
[root@rac2 ~]# yum groupinstall –y “gnome desktop” “x window system” “desktop”
再次执行脚本成功
[root@rac2 ~]# su - grid
last login: mon apr 25 17:19:29 cst 2022 on pts/0
[grid@rac2:/home/grid]$/oracle/app/11.2.0/grid/oui/bin/runinstaller -jreloc /etc/alternatives/jre_1.8.0 -attachhome -noclusterenabled oracle_home=/oracle/app/11.2.0/grid oracle_home_name=ora11g_gridinfrahome1 cluster_nodes=rac1,rac2 “inventory_location=/oracle/app/orainventory” local_node=rac2
starting oracle universal installer…

checking swap space: must be greater than 500 mb. actual 4095 mb passed
the inventory pointer is located at /etc/orainst.loc
the inventory is located at /oracle/app/orainventory
please execute the ‘/oracle/app/orainventory/orainstroot.sh’ script at the end of the session.
‘attachhome’ was successful


![image.png](https://oss-emcsprod-public.modb.pro/image/editor/20220504-cb62289d-0349-47aa-90ed-ee0785881ee0.png)
```sh
依次在2个节点按照顺序执行第一个脚本
[root@rac1 soft]# /oracle/app/orainventory/orainstroot.sh
[root@rac2 ~]# /oracle/app/orainventory/orainstroot.sh
依次在2个节点按照顺序执行第二个脚本
[root@rac1 soft]# /oracle/app/11.2.0/grid/root.sh
[root@rac2 ~]# /oracle/app/11.2.0/grid/root.sh
每个节点在执行root.sh的时候遇到如上报错,解决方法是新开一个终端窗口,然后执行如下命令 [root@rac1 ~]# touch /usr/lib/systemd/system/ohas.service [root@rac1 ~]# chmod 777 /usr/lib/systemd/system/ohas.service [root@rac1 ~]# vi /usr/lib/systemd/system/ohas.service [unit] description=oracle high availability services after=syslog.target [service] execstart=/etc/init.d/init.ohasd run >/dev/null 2>&1 type=simple restart=always [install] wantedby=multi-user.target [root@rac1 ~]# systemctl daemon-reload [root@rac1 ~]# systemctl start ohas.service [root@rac1 ~]# systemctl enable ohas.service ###网上也有说使用如下命令的,没有亲测过不知道是否可用### [root@rac1 ~]# cd /var/tmp/.oracle/ [root@rac1 .oracle]# dd if=npohasd of=/dev/null bs=1024 count=1 ###还有种推荐的方法,需要在执行root.sh之前打一个补丁p18370031_112040_linux-x86-64.zip### [grid@rac1:/home/grid]$cd /tmp/soft [grid@rac2:/tmp/soft]$unzip p18370031_112040_linux-x86-64.zip [grid@rac2:/tmp/soft]$cd 18370031/ [grid@rac1:/tmp/soft]$$oracle_home/opatch/opatch apply
节点2执行root.sh的时候,除了像节点1那样出现上面图片的报错,可能还出现如下报错: mounting disk group ocr failed with the following message: ora-15032: not all alterations performed ora-15017: diskgroup "ocr" cannot be mounted ora-15003: diskgroup "ocr" already mounted in another lock name space configuration of asm ... failed see asmca logs at /oracle/app/grid/cfgtoollogs/asmca for details did not succssfully configure and start asm at /oracle/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 6912. /oracle/app/11.2.0/grid/perl/bin/perl -i/oracle/app/11.2.0/grid/perl/lib -i/oracle/app/11.2.0/grid/crs/install /oracle/app/11.2.0/grid/crs/install/rootcrs.pl execution failed 在2个节点清除crs配置信息后,重新运行root.sh [root@rac1 soft]# cd /oracle/app/11.2.0/grid/crs/install/ [root@rac1 install]# ./rootcrs.pl -verbose -deconfig -force 出现如下报错信息: can't locate env.pm in @inc (@inc contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . .) at crsconfig_lib.pm line 703. begin failed--compilation aborted at crsconfig_lib.pm line 703. compilation failed in require at ./rootcrs.pl line 305. begin failed--compilation aborted at ./rootcrs.pl line 305. 解决方法如下,安装perl-env即可: [root@rac1 install]# yum install perl-env [root@rac1 install]# ./rootcrs.pl -verbose -deconfig -force 再在第二个节点清除crs配置 [root@rac2 install]# yum install perl-env [root@rac2 install]# cd /oracle/app/11.2.0/grid/crs/install/ [root@rac2 install]# ./rootcrs.pl -verbose -deconfig -force -lastnode 然后继续安装

四、创建asm磁盘组

[grid@rac1 ~]$ asmca






五、安装database软件

[root@rac1 ~]# su - oracle last login: sun apr 24 20:00:03 cst 2022 on pts/0 [oracle@rac1:/home/oracle]$vncserver 密码仍然设置为oracle [oracle@rac1 ~]$ cd /tmp/soft/database/ [oracle@rac1 database]$ ./runinstaller -jreloc /etc/alternatives/jre_1.8.0















[oracle@rac1:/home/oracle]$cd /oracle/app/oracle/product/11.2.0/db_1/sysman/lib [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/sysman/lib]$cp ins_emagent.mk ins_emagent.mk.bak [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/sysman/lib]$vi ins_emagent.mk $(sysmanbin)emdctl: $(mk_emagent_nmectl) -lnnz11 回到安装界面点击retry
[root@rac1 ~]# /oracle/app/oracle/product/11.2.0/db_1/root.sh performing root user operation for oracle 11g the following environment variables are set as: oracle_owner= oracle oracle_home= /oracle/app/oracle/product/11.2.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. finished product-specific root actions.

六、dbca创建数据库

[oracle@rac1 ~]$ dbca

















[root@rac1 ~]# crsctl status res -t -------------------------------------------------------------------------------- name target state server state_details -------------------------------------------------------------------------------- local resources -------------------------------------------------------------------------------- ora.data.dg online online rac1 online online rac2 ora.fra.dg online online rac1 online online rac2 ora.listener.lsnr online online rac1 online online rac2 ora.ocr.dg online online rac1 online online rac2 ora.asm online online rac1 started online online rac2 started ora.gsd offline offline rac1 offline offline rac2 ora.net1.network online online rac1 online online rac2 ora.ons online online rac1 online online rac2 -------------------------------------------------------------------------------- cluster resources -------------------------------------------------------------------------------- ora.listener_scan1.lsnr 1 online online rac1 ora.cvu 1 online online rac1 ora.oc4j 1 online online rac1 ora.orcl.db 1 online online rac1 open 2 online online rac2 open ora.rac1.vip 1 online online rac1 ora.rac2.vip 1 online online rac2 ora.scan1.vip 1 online online rac1

七、安装psu

1,备份oracle_home

停止数据库后,在2个节点备份grid用户和oracle用户的oracle_home
[root@rac1 tmp]# tar cvf /tmp/grid_home.tar /oracle/app/11.2.0/grid
[root@rac1 tmp]# tar cvf /tmp/oracle_home.tar /oracle/app/oracle/product/11.2.0/db_1

2,升级opatch

```新版本的opatch位于/tmp/soft/``` 升级grid用户的opatch [root@rac1 ~]# mv /oracle/app/11.2.0/grid/opatch/ /oracle/app/11.2.0/grid/opatch.bak [root@rac1 ~]# unzip /tmp/soft/p6880880_112000_linux-x86-64\ .zip -d /oracle/app/11.2.0/grid/ [root@rac1 ~]# chown -r grid:oinstall /oracle/app/11.2.0/grid/opatch [root@rac1 ~]# su - grid [grid@rac1:/home/grid]$cd $oracle_home [grid@rac1:/oracle/app/11.2.0/grid]$opatch/opatch version opatch version: 11.2.0.3.33 升级oracle用户的opatch [root@rac1 ~]# mv /oracle/app/oracle/product/11.2.0/db_1/opatch/ /oracle/app/oracle/product/11.2.0/db_1/opatch.bak [root@rac1 ~]# unzip /tmp/soft/p6880880_112000_linux-x86-64\ .zip -d /oracle/app/oracle/product/11.2.0/db_1/ [root@rac1 ~]# chown -r oracle:oinstall /oracle/app/oracle/product/11.2.0/db_1/opatch [root@rac1 ~]# su - oracle [oracle@rac1:/home/oracle]$cd $oracle_home [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1]$opatch/opatch version opatch version: 11.2.0.3.33

3,验证inventory

分别用grid和oracle用户检查inventory有效性 [root@rac1 bin]# su - grid [grid@rac1:/home/grid]$$oracle_home/opatch/opatch lsinventory -detail -oh $oracle_home oracle interim patch installer version 11.2.0.3.33 米乐app官网下载 copyright (c) 2022, oracle corporation. all rights reserved. oracle home : /oracle/app/11.2.0/grid central inventory : /oracle/app/orainventory from : /oracle/app/11.2.0/grid/orainst.loc opatch version : 11.2.0.3.33 oui version : 11.2.0.4.0 log file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/opatch2022-04-26_14-41-40pm_1.log lsinventory output file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2022-04-26_14-41-40pm.txt -------------------------------------------------------------------------------- local machine information:: hostname: rac1 aru platform id: 226 aru platform description:: linux x86-64 installed top-level products (1): oracle grid infrastructure 11g 11.2.0.4.0 there are 1 products installed in this oracle home. installed products (89): agent required support files 10.2.0.4.5 assistant common files 11.2.0.4.0 automatic storage management assistant 11.2.0.4.0 bali share 1.1.18.0.0 buildtools common files 11.2.0.4.0 character set migration utility 11.2.0.4.0 cluster ready services files 11.2.0.4.0 cluster verification utility common files 11.2.0.4.0 cluster verification utility files 11.2.0.4.0 database sql scripts 11.2.0.4.0 deinstallation tool 11.2.0.4.0 enterprise manager common core files 10.2.0.4.5 enterprise manager common files 10.2.0.4.5 enterprise manager plugin common files 11.2.0.4.0 expat libraries 2.0.1.0.1 has common files 11.2.0.4.0 has files for db 11.2.0.4.0 installation common files 11.2.0.4.0 installation plugin files 11.2.0.4.0 installer sdk component 11.2.0.4.0 java development kit 1.5.0.51.10 ldap required support files 11.2.0.4.0 olap sql scripts 11.2.0.4.0 oracle advanced security 11.2.0.4.0 oracle clusterware rdbms files 11.2.0.4.0 oracle configuration manager deconfiguration 10.3.1.0.0 oracle containers for java 11.2.0.4.0 oracle core required support files 11.2.0.4.0 oracle database 11g 11.2.0.4.0 oracle database 11g multimedia files 11.2.0.4.0 oracle database deconfiguration 11.2.0.4.0 oracle database user interface 2.2.13.0.0 oracle database utilities 11.2.0.4.0 oracle dbca deconfiguration 11.2.0.4.0 oracle extended windowing toolkit 3.4.47.0.0 oracle globalization support 11.2.0.4.0 oracle globalization support 11.2.0.4.0 oracle grid infrastructure 11g 11.2.0.4.0 oracle help for java 4.2.9.0.0 oracle ice browser 5.2.3.6.0 oracle internet directory client 11.2.0.4.0 oracle java client 11.2.0.4.0 oracle jdbc/oci instant client 11.2.0.4.0 oracle jdbc/thin interfaces 11.2.0.4.0 oracle jfc extended windowing toolkit 4.2.36.0.0 oracle jvm 11.2.0.4.0 oracle ldap administration 11.2.0.4.0 oracle locale builder 11.2.0.4.0 oracle multimedia 11.2.0.4.0 oracle multimedia client option 11.2.0.4.0 oracle multimedia java advanced imaging 11.2.0.4.0 oracle multimedia locator 11.2.0.4.0 oracle multimedia locator rdbms files 11.2.0.4.0 oracle net 11.2.0.4.0 oracle net listener 11.2.0.4.0 oracle net required support files 11.2.0.4.0 oracle netca client 11.2.0.4.0 oracle notification service 11.2.0.3.0 oracle notification service (eons) 11.2.0.4.0 oracle one-off patch installer 11.2.0.3.4 oracle quality of service management (client) 11.2.0.4.0 oracle quality of service management (server) 11.2.0.4.0 oracle rac deconfiguration 11.2.0.4.0 oracle rac required support files-has 11.2.0.4.0 oracle recovery manager 11.2.0.4.0 oracle security developer tools 11.2.0.4.0 oracle text required support files 11.2.0.4.0 oracle universal installer 11.2.0.4.0 oracle usm deconfiguration 11.2.0.4.0 oracle wallet manager 11.2.0.4.0 parser generator required support files 11.2.0.4.0 perl interpreter 5.10.0.0.2 perl modules 5.10.0.0.1 pl/sql 11.2.0.4.0 pl/sql embedded gateway 11.2.0.4.0 platform required support files 11.2.0.4.0 precompiler required support files 11.2.0.4.0 rdbms required support files 11.2.0.4.0 rdbms required support files for instant client 11.2.0.4.0 rdbms required support files runtime 11.2.0.4.0 required support files 11.2.0.4.0 secure socket layer 11.2.0.4.0 sql*plus 11.2.0.4.0 sql*plus files for instant client 11.2.0.4.0 sql*plus required support files 11.2.0.4.0 ssl required support files for instantclient 11.2.0.4.0 universal storage manager files 11.2.0.4.0 xdk required support files 11.2.0.4.0 xml parser for java 11.2.0.4.0 there are 89 products installed in this oracle home. there are no interim patches installed in this oracle home. -------------------------------------------------------------------------------- opatch succeeded. [grid@rac1:/home/grid]$$oracle_home/opatch/opatch lspatches there are no interim patches installed in this oracle home "/oracle/app/11.2.0/grid". opatch succeeded. [root@rac1 bin]# su - oracle [oracle@rac1:/home/oracle]$$oracle_home/opatch/opatch lsinventory -detail -oh $oracle_home oracle interim patch installer version 11.2.0.3.33 米乐app官网下载 copyright (c) 2022, oracle corporation. all rights reserved. oracle home : /oracle/app/oracle/product/11.2.0/db_1 central inventory : /oracle/app/orainventory from : /oracle/app/oracle/product/11.2.0/db_1/orainst.loc opatch version : 11.2.0.3.33 oui version : 11.2.0.4.0 log file location : /oracle/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2022-04-26_14-46-17pm_1.log lsinventory output file location : /oracle/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2022-04-26_14-46-17pm.txt -------------------------------------------------------------------------------- local machine information:: hostname: rac1 aru platform id: 226 aru platform description:: linux x86-64 installed top-level products (1): oracle database 11g 11.2.0.4.0 there are 1 products installed in this oracle home. installed products (136): agent required support files 10.2.0.4.5 assistant common files 11.2.0.4.0 bali share 1.1.18.0.0 buildtools common files 11.2.0.4.0 character set migration utility 11.2.0.4.0 cluster verification utility common files 11.2.0.4.0 database configuration and upgrade assistants 11.2.0.4.0 database sql scripts 11.2.0.4.0 database workspace manager 11.2.0.4.0 deinstallation tool 11.2.0.4.0 enterprise edition options 11.2.0.4.0 enterprise manager agent 10.2.0.4.5 enterprise manager agent core files 10.2.0.4.5 enterprise manager common core files 10.2.0.4.5 enterprise manager common files 10.2.0.4.5 enterprise manager database plugin -- agent support 11.2.0.4.0 enterprise manager database plugin -- repository support 11.2.0.4.0 enterprise manager grid control core files 10.2.0.4.5 enterprise manager plugin common files 11.2.0.4.0 enterprise manager repository core files 10.2.0.4.5 exadata storage server 11.2.0.1.0 expat libraries 2.0.1.0.1 generic connectivity common files 11.2.0.4.0 has common files 11.2.0.4.0 has files for db 11.2.0.4.0 installation common files 11.2.0.4.0 installation plugin files 11.2.0.4.0 installer sdk component 11.2.0.4.0 jaccelerator (companion) 11.2.0.4.0 java development kit 1.5.0.51.10 ldap required support files 11.2.0.4.0 olap sql scripts 11.2.0.4.0 oracle 11g warehouse builder required files 11.2.0.4.0 oracle advanced security 11.2.0.4.0 oracle application express 11.2.0.4.0 oracle call interface (oci) 11.2.0.4.0 oracle clusterware rdbms files 11.2.0.4.0 oracle code editor 1.2.1.0.0i oracle configuration manager 10.3.8.1.0 oracle configuration manager client 10.3.2.1.0 oracle configuration manager deconfiguration 10.3.1.0.0 oracle containers for java 11.2.0.4.0 oracle core required support files 11.2.0.4.0 oracle data mining rdbms files 11.2.0.4.0 oracle database 11g 11.2.0.4.0 oracle database 11g 11.2.0.4.0 oracle database 11g multimedia files 11.2.0.4.0 oracle database deconfiguration 11.2.0.4.0 oracle database gateway for odbc 11.2.0.4.0 oracle database user interface 2.2.13.0.0 oracle database utilities 11.2.0.4.0 oracle database vault j2ee application 11.2.0.4.0 oracle database vault option 11.2.0.4.0 oracle dbca deconfiguration 11.2.0.4.0 oracle display fonts 9.0.2.0.0 oracle enterprise manager console db 11.2.0.4.0 oracle extended windowing toolkit 3.4.47.0.0 oracle globalization support 11.2.0.4.0 oracle globalization support 11.2.0.4.0 oracle help for java 4.2.9.0.0 oracle help for the web 2.0.14.0.0 oracle ice browser 5.2.3.6.0 oracle internet directory client 11.2.0.4.0 oracle java client 11.2.0.4.0 oracle jdbc server support package 11.2.0.4.0 oracle jdbc/oci instant client 11.2.0.4.0 oracle jdbc/thin interfaces 11.2.0.4.0 oracle jfc extended windowing toolkit 4.2.36.0.0 oracle jvm 11.2.0.4.0 oracle label security 11.2.0.4.0 oracle ldap administration 11.2.0.4.0 oracle locale builder 11.2.0.4.0 oracle message gateway common files 11.2.0.4.0 oracle multimedia 11.2.0.4.0 oracle multimedia annotator 11.2.0.4.0 oracle multimedia client option 11.2.0.4.0 oracle multimedia java advanced imaging 11.2.0.4.0 oracle multimedia locator 11.2.0.4.0 oracle multimedia locator rdbms files 11.2.0.4.0 oracle net 11.2.0.4.0 oracle net listener 11.2.0.4.0 oracle net required support files 11.2.0.4.0 oracle net services 11.2.0.4.0 oracle netca client 11.2.0.4.0 oracle notification service 11.2.0.3.0 oracle notification service (eons) 11.2.0.4.0 oracle odbc driver 11.2.0.4.0 oracle odbc driverfor instant client 11.2.0.4.0 oracle olap 11.2.0.4.0 oracle olap api 11.2.0.4.0 oracle olap rdbms files 11.2.0.4.0 oracle one-off patch installer 11.2.0.3.4 oracle partitioning 11.2.0.4.0 oracle programmer 11.2.0.4.0 oracle quality of service management (client) 11.2.0.4.0 oracle rac deconfiguration 11.2.0.4.0 oracle rac required support files-has 11.2.0.4.0 oracle real application testing 11.2.0.4.0 oracle recovery manager 11.2.0.4.0 oracle security developer tools 11.2.0.4.0 oracle spatial 11.2.0.4.0 oracle sql developer 11.2.0.4.0 oracle starter database 11.2.0.4.0 oracle text 11.2.0.4.0 oracle text required support files 11.2.0.4.0 oracle uix 2.2.24.6.0 oracle universal connection pool 11.2.0.4.0 oracle universal installer 11.2.0.4.0 oracle usm deconfiguration 11.2.0.4.0 oracle wallet manager 11.2.0.4.0 oracle xml development kit 11.2.0.4.0 oracle xml query 11.2.0.4.0 parser generator required support files 11.2.0.4.0 perl interpreter 5.10.0.0.2 perl modules 5.10.0.0.1 pl/sql 11.2.0.4.0 pl/sql embedded gateway 11.2.0.4.0 platform required support files 11.2.0.4.0 precompiler common files 11.2.0.4.0 precompiler required support files 11.2.0.4.0 provisioning advisor framework 10.2.0.4.3 rdbms required support files 11.2.0.4.0 rdbms required support files for instant client 11.2.0.4.0 rdbms required support files runtime 11.2.0.4.0 regexp 2.1.9.0.0 required support files 11.2.0.4.0 sample schema data 11.2.0.4.0 secure socket layer 11.2.0.4.0 sql*plus 11.2.0.4.0 sql*plus files for instant client 11.2.0.4.0 sql*plus required support files 11.2.0.4.0 sqlj runtime 11.2.0.4.0 ssl required support files for instantclient 11.2.0.4.0 xdk required support files 11.2.0.4.0 xml parser for java 11.2.0.4.0 xml parser for oracle jvm 11.2.0.4.0 there are 136 products installed in this oracle home. there are no interim patches installed in this oracle home. -------------------------------------------------------------------------------- opatch succeeded. [oracle@rac1:/home/oracle]$$oracle_home/opatch/opatch lspatches there are no interim patches installed in this oracle home "/oracle/app/oracle/product/11.2.0/db_1". opatch succeeded.

4,检查补丁是否有冲突

```psu原先上传在/tmp/soft/p33575261_112040_linux-x86-64 .zip,现在移动到/psu目录``` [root@rac1 ~]# mkdir /psu [root@rac1 ~]# unzip /tmp/soft/p33575261_112040_linux-x86-64\ .zip -d /psu [root@rac1 ~]# chown -r grid:oinstall /psu/ [root@rac1 ~]# chmod -r 777 /psu/ [root@rac1 ~]# crsctl stop crs [root@rac1 ~]# su - grid [grid@rac1:/home/grid]$srvctl stop listener [grid@rac1:/home/grid]$lsnrctl stop listener_scan1 [grid@rac1:/home/grid]$cd /psu/33575261/ [grid@rac1:/psu/33575261]$$oracle_home/opatch/opatch prereq checkconflictagainstohwithdetail -ph ./ oracle interim patch installer version 11.2.0.3.33 米乐app官网下载 copyright (c) 2022, oracle corporation. all rights reserved. prereq session oracle home : /oracle/app/11.2.0/grid central inventory : /oracle/app/orainventory from : /oracle/app/11.2.0/grid/orainst.loc opatch version : 11.2.0.3.33 oui version : 11.2.0.4.0 log file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/opatch2022-04-26_15-02-15pm_1.log invoking prereq "checkconflictagainstohwithdetail" prereq "checkconflictagainstohwithdetail" passed. opatch succeeded. [grid@rac1:/psu/33575261/33477185]$$oracle_home/opatch/opatch prereq checkactivefilesandexecutables -ph ./ oracle interim patch installer version 11.2.0.3.33 米乐app官网下载 copyright (c) 2022, oracle corporation. all rights reserved. prereq session oracle home : /oracle/app/11.2.0/grid central inventory : /oracle/app/orainventory from : /oracle/app/11.2.0/grid/orainst.loc opatch version : 11.2.0.3.33 oui version : 11.2.0.4.0 log file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/opatch2022-04-26_21-33-10pm_1.log invoking prereq "checkactivefilesandexecutables" prereq "checkactivefilesandexecutables" for patch 17478514 passed. prereq "checkactivefilesandexecutables" for patch 18031668 passed. prereq "checkactivefilesandexecutables" for patch 18522509 passed. prereq "checkactivefilesandexecutables" for patch 19121551 passed. prereq "checkactivefilesandexecutables" for patch 19769489 passed. prereq "checkactivefilesandexecutables" for patch 20299013 passed. prereq "checkactivefilesandexecutables" for patch 20760982 passed. prereq "checkactivefilesandexecutables" for patch 21352635 passed. prereq "checkactivefilesandexecutables" for patch 21948347 passed. prereq "checkactivefilesandexecutables" for patch 22502456 passed. prereq "checkactivefilesandexecutables" for patch 23054359 passed. prereq "checkactivefilesandexecutables" for patch 24006111 passed. prereq "checkactivefilesandexecutables" for patch 24732075 passed. prereq "checkactivefilesandexecutables" for patch 25869727 passed. prereq "checkactivefilesandexecutables" for patch 26609445 passed. prereq "checkactivefilesandexecutables" for patch 26392168 passed. prereq "checkactivefilesandexecutables" for patch 26925576 passed. prereq "checkactivefilesandexecutables" for patch 27338049 passed. prereq "checkactivefilesandexecutables" for patch 27734982 passed. prereq "checkactivefilesandexecutables" for patch 28204707 passed. prereq "checkactivefilesandexecutables" for patch 28729262 passed. prereq "checkactivefilesandexecutables" for patch 29141056 passed. prereq "checkactivefilesandexecutables" for patch 29497421 passed. prereq "checkactivefilesandexecutables" for patch 29913194 passed. prereq "checkactivefilesandexecutables" for patch 30298532 passed. prereq "checkactivefilesandexecutables" for patch 30670774 passed. prereq "checkactivefilesandexecutables" for patch 31103343 passed. prereq "checkactivefilesandexecutables" for patch 31537677 passed. prereq "checkactivefilesandexecutables" for patch 31983472 passed. prereq "checkactivefilesandexecutables" for patch 32328626 passed. prereq "checkactivefilesandexecutables" for patch 32758711 passed. prereq "checkactivefilesandexecutables" for patch 33128584 passed. prereq "checkactivefilesandexecutables" for patch 33477185 passed. opatch succeeded.

5,预演补丁升级

```不用停crs``` [root@rac1 ~]# /oracle/app/11.2.0/grid/opatch/opatch auto /psu/33575261/ -oh /oracle/app/11.2.0/grid,/oracle/app/oracle/product/11.2.0/db_1 -report executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/opatch/crs/patch11203.pl -patchdir /psu -patchn 33575261 -oh /oracle/app/11.2.0/grid,/oracle/app/oracle/product/11.2.0/db_1 -report -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params this is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_15-17-21.log this file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_15-17-21.report.log 2022-04-26 15:17:21: starting clusterware patch setup using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params opatchauto is running in analyze/report mode. it will make no change to your system patch /psu/33575261/32758914 apply (report mode) successful for home /oracle/app/11.2.0/grid patch /psu/33575261/33477185 apply (report mode) successful for home /oracle/app/11.2.0/grid patch /psu/33575261/33112794 apply (report mode) successful for home /oracle/app/11.2.0/grid patch /psu/33575261/32758914/custom/server/32758914 apply (report mode) successful for home /oracle/app/oracle/product/11.2.0/db_1 patch /psu/33575261/33477185 apply (report mode) successful for home /oracle/app/oracle/product/11.2.0/db_1 opatch auto succeeded.

6,升级补丁

the opatch utility has automated the patch application for the oracle grid infrastructure (gi) home and the oracle rac database homes when run with root privileges. it must be executed on each node in the cluster if the gi home or oracle rac database home is in non-shared storage. the utility should not be run in parallel on the cluster nodes.

根据readme的指导,root用户执行opatch auto会自动升级gi和database

[root@rac1 33575261]# /oracle/app/11.2.0/grid/opatch/opatch auto /psu/33575261/ -oh /oracle/app/11.2.0/grid,/oracle/app/oracle/product/11.2.0/db_1 但是在实际操作中遇到报错: /oracle/app/11.2.0/grid/bin/crsctl query crs activeversion ... failed rc=8 with message: oracle cluster registry initialization failed accessing oracle cluster registry device: proc-26: error while accessing the physical storage ora-29701: unable to connect to cluster synchronization service stopping rac /oracle/app/oracle/product/11.2.0/db_1 ... failed to stop resources from database home /oracle/app/oracle/product/11.2.0/db_1 error: refer log file for more details. opatch auto failed. 根据查看安装日志,里面有下面的提示: 2022-04-26 17:57:05: executing cmd: /oracle/app/11.2.0/grid/bin/crsctl query crs activeversion 2022-04-26 17:57:16: command output: 百度了一下可能是触发了oracle的某个bug导致安装失败。

于是只好分开升级,先升级gi的psu,然后再升级db的psu

```节点1的gi升级过程如下``` [root@rac1 ~]# /oracle/app/11.2.0/grid/opatch/opatch auto /psu/33575261/ -oh /oracle/app/11.2.0/grid executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/opatch/crs/patch11203.pl -patchdir /psu -patchn 33575261 -oh /oracle/app/11.2.0/grid -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params this is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_21-47-47.log this file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_21-47-47.report.log 2022-04-26 21:47:47: starting clusterware patch setup using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params stopping crs... stopped crs successfully patch /psu/33575261/32758914 apply successful for home /oracle/app/11.2.0/grid patch /psu/33575261/33477185 apply successful for home /oracle/app/11.2.0/grid patch /psu/33575261/33112794 apply successful for home /oracle/app/11.2.0/grid starting crs... installing trace file analyzer crs-4123: oracle high availability services has been started. opatch auto succeeded. 升级报告内容如下 [root@rac1 ~]# more /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_21-47-47.report.log *********** configuration data *********** * it shows only those targets that will be patched in this session * crs_home=/oracle/app/11.2.0/grid owner=grid opatch_ver=11.2.0.3.33 *********** steps to be executed as owner unless specified as root *********** 1: /oracle/app/11.2.0/grid/opatch/opatch prereq checkcomponents -ph /psu/33575261/32758914 -oh /oracle/app/11.2.0/grid 2: /oracle/app/11.2.0/grid/opatch/opatch prereq checkcomponents -ph /psu/33575261/33477185 -oh /oracle/app/11.2.0/grid 3: /oracle/app/11.2.0/grid/opatch/opatch prereq checkcomponents -ph /psu/33575261/33112794 -oh /oracle/app/11.2.0/grid 4: /oracle/app/11.2.0/grid/opatch/opatch prereq checkconflictagainstoh -ph /psu/33575261/32758914 -oh /oracle/app/11.2.0/grid 5: /oracle/app/11.2.0/grid/opatch/opatch prereq checkconflictagainstoh -ph /psu/33575261/33477185 -oh /oracle/app/11.2.0/grid 6: /oracle/app/11.2.0/grid/opatch/opatch prereq checkconflictagainstoh -ph /psu/33575261/33112794 -oh /oracle/app/11.2.0/grid 7: /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -unlock : run as root 8: /oracle/app/11.2.0/grid/tfa/bin/tfactl stop : run as root 9: /sbin/fuser -k /oracle/app/11.2.0/grid/bin/crsctl.bin : run as root 10: /oracle/app/11.2.0/grid/opatch/opatch prereq checkapplicable -ph /psu/33575261/32758914 -oh /oracle/app/11.2.0/grid 11: /oracle/app/11.2.0/grid/opatch/opatch prereq checkapplicable -ph /psu/33575261/33477185 -oh /oracle/app/11.2.0/grid 12: /oracle/app/11.2.0/grid/opatch/opatch prereq checkapplicable -ph /psu/33575261/33112794 -oh /oracle/app/11.2.0/grid 13: /oracle/app/11.2.0/grid/opatch/opatch napply /psu/33575261/32758914 -local -silent -oh /oracle/app/11.2.0/grid -invptrloc /oracle/a pp/11.2.0/grid/orainst.loc 14: /oracle/app/11.2.0/grid/opatch/opatch napply /psu/33575261/33477185 -local -silent -oh /oracle/app/11.2.0/grid -invptrloc /oracle/a pp/11.2.0/grid/orainst.loc 15: /oracle/app/11.2.0/grid/opatch/opatch napply /psu/33575261/33112794 -local -silent -oh /oracle/app/11.2.0/grid -invptrloc /oracle/a pp/11.2.0/grid/orainst.loc 16: /oracle/app/11.2.0/grid/bin/emctl start dbconsole 17: /oracle/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh : run as root 18: /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -patch : run as root ```节点1的db升级过程如下``` [root@rac1 ~]# /oracle/app/11.2.0/grid/opatch/opatch auto /psu/33575261/ -oh /oracle/app/oracle/product/11.2.0/db_1 executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/opatch/crs/patch11203.pl -patchdir /psu -patchn 33575261 -oh /oracle/app/oracle/product/11.2.0/db_1 -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params this is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-00-41.log this file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-00-41.report.log 2022-04-26 22:00:41: starting clusterware patch setup using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params stopping rac /oracle/app/oracle/product/11.2.0/db_1 ... stopped rac /oracle/app/oracle/product/11.2.0/db_1 successfully patch /psu/33575261/32758914/custom/server/32758914 apply successful for home /oracle/app/oracle/product/11.2.0/db_1 patch /psu/33575261/33477185 apply successful for home /oracle/app/oracle/product/11.2.0/db_1 starting rac /oracle/app/oracle/product/11.2.0/db_1 ... started rac /oracle/app/oracle/product/11.2.0/db_1 successfully opatch auto succeeded. 升级报告内容如下 [root@rac1 ~]# more /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-00-41.report.log *********** configuration data *********** * it shows only those targets that will be patched in this session * rac_home=/oracle/app/oracle/product/11.2.0/db_1 owner=oracle opatch_ver=11.2.0.3.33 *********** steps to be executed as owner unless specified as root *********** 1: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch prereq checkcomponents -ph /psu/33575261/32758914/custom/server/32758914 -oh /o racle/app/oracle/product/11.2.0/db_1 2: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch prereq checkcomponents -ph /psu/33575261/33477185 -oh /oracle/app/oracle/produc t/11.2.0/db_1 3: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch prereq checkconflictagainstoh -ph /psu/33575261/32758914/custom/server/32758914 -oh /oracle/app/oracle/product/11.2.0/db_1 4: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch prereq checkconflictagainstoh -ph /psu/33575261/33477185 -oh /oracle/app/oracle /product/11.2.0/db_1 5: /oracle/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole 6: /oracle/app/oracle/product/11.2.0/db_1/bin/emctl stop agent 7: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch prereq checkapplicable -ph /psu/33575261/32758914/custom/server/32758914 -oh /o racle/app/oracle/product/11.2.0/db_1 8: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch prereq checkapplicable -ph /psu/33575261/33477185 -oh /oracle/app/oracle/produc t/11.2.0/db_1 9: /oracle/app/oracle/product/11.2.0/db_1/bin/srvctl stop home -o /oracle/app/oracle/product/11.2.0/db_1 -s /oracle/app/oracle/product/ 11.2.0/db_1/srvm/admin/stophome.txt -n rac1 -f 10: /psu/33575261/32758914/custom/server/32758914/custom/scripts/prepatch.sh -dbhome /oracle/app/oracle/product/11.2.0/db_1 11: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch napply /psu/33575261/32758914/custom/server/32758914 -local -silent -oh /oracl e/app/oracle/product/11.2.0/db_1 -invptrloc /oracle/app/oracle/product/11.2.0/db_1/orainst.loc 12: /oracle/app/oracle/product/11.2.0/db_1/opatch/opatch napply /psu/33575261/33477185 -local -silent -oh /oracle/app/oracle/product/11 .2.0/db_1 -invptrloc /oracle/app/oracle/product/11.2.0/db_1/orainst.loc 13: /psu/33575261/32758914/custom/server/32758914/custom/scripts/postpatch.sh -dbhome /oracle/app/oracle/product/11.2.0/db_1 14: /oracle/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole 15: /oracle/app/oracle/product/11.2.0/db_1/bin/emctl start agent 16: /oracle/app/oracle/product/11.2.0/db_1/bin/srvctl start home -o /oracle/app/oracle/product/11.2.0/db_1 -s /oracle/app/oracle/produc t/11.2.0/db_1/srvm/admin/stophome.txt -n rac1 ```验证gi补丁升级结果``` [root@rac1 ~]# su - grid [grid@rac1:/home/grid]$$oracle_home/opatch/opatch lsinventory oracle interim patch installer version 11.2.0.3.33 米乐app官网下载 copyright (c) 2022, oracle corporation. all rights reserved. oracle home : /oracle/app/11.2.0/grid central inventory : /oracle/app/orainventory from : /oracle/app/11.2.0/grid/orainst.loc opatch version : 11.2.0.3.33 oui version : 11.2.0.4.0 log file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/opatch2022-04-26_22-15-36pm_1.log lsinventory output file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2022-04-26_22-15-36pm.txt -------------------------------------------------------------------------------- local machine information:: hostname: rac1 aru platform id: 226 aru platform description:: linux x86-64 installed top-level products (1): oracle grid infrastructure 11g 11.2.0.4.0 there are 1 products installed in this oracle home. interim patches (3) : patch 33112794 : applied on tue apr 26 21:55:24 cst 2022 unique patch id: 24333589 patch description: "acfs patch set update 11.2.0.4.210720 (33112794)" created on 14 jul 2021, 01:00:58 hrs pst8pdt bugs fixed: 26247490, 28069955, 21369858, 16318126, 19690653, 17503605, 17203009 17359415, 20140148, 17611362, 25098392, 17270418, 17164243, 17696547 19053182, 17488768, 25078431, 18168684, 21519796, 18143006, 21208140 23321114, 17428148, 17070158, 20438706, 29397017, 17510275, 17172303 28142134, 18610307, 17376318, 17721778, 22198405, 17699423, 18915417 22810422, 18155334, 21233961, 25381434, 19919907, 18321597, 33112882 18185024, 17636008, 17363999, 27593263, 20681968, 17475946, 27463879 patch 33477185 : applied on tue apr 26 21:53:52 cst 2022 unique patch id: 24548176 patch description: "database patch set update : 11.2.0.4.220118 (33477185)" created on 15 dec 2021, 07:23:11 hrs utc sub-patch 33128584; "database patch set update : 11.2.0.4.211019 (33128584)" sub-patch 32758711; "database patch set update : 11.2.0.4.210720 (32758711)" sub-patch 32328626; "database patch set update : 11.2.0.4.210420 (32328626)" sub-patch 31983472; "database patch set update : 11.2.0.4.210119 (31983472)" sub-patch 31537677; "database patch set update : 11.2.0.4.201020 (31537677)" sub-patch 31103343; "database patch set update : 11.2.0.4.200714 (31103343)" sub-patch 30670774; "database patch set update : 11.2.0.4.200414 (30670774)" sub-patch 30298532; "database patch set update : 11.2.0.4.200114 (30298532)" sub-patch 29913194; "database patch set update : 11.2.0.4.191015 (29913194)" sub-patch 29497421; "database patch set update : 11.2.0.4.190716 (29497421)" sub-patch 29141056; "database patch set update : 11.2.0.4.190416 (29141056)" sub-patch 28729262; "database patch set update : 11.2.0.4.190115 (28729262)" sub-patch 28204707; "database patch set update : 11.2.0.4.181016 (28204707)" sub-patch 27734982; "database patch set update : 11.2.0.4.180717 (27734982)" sub-patch 27338049; "database patch set update : 11.2.0.4.180417 (27338049)" sub-patch 26925576; "database patch set update : 11.2.0.4.180116 (26925576)" sub-patch 26392168; "database patch set update : 11.2.0.4.171017 (26392168)" sub-patch 26609445; "database patch set update : 11.2.0.4.170814 (26609445)" sub-patch 25869727; "database patch set update : 11.2.0.4.170718 (25869727)" sub-patch 24732075; "database patch set update : 11.2.0.4.170418 (24732075)" sub-patch 24006111; "database patch set update : 11.2.0.4.161018 (24006111)" sub-patch 23054359; "database patch set update : 11.2.0.4.160719 (23054359)" sub-patch 22502456; "database patch set update : 11.2.0.4.160419 (22502456)" sub-patch 21948347; "database patch set update : 11.2.0.4.160119 (21948347)" sub-patch 21352635; "database patch set update : 11.2.0.4.8 (21352635)" sub-patch 20760982; "database patch set update : 11.2.0.4.7 (20760982)" sub-patch 20299013; "database patch set update : 11.2.0.4.6 (20299013)" sub-patch 19769489; "database patch set update : 11.2.0.4.5 (19769489)" sub-patch 19121551; "database patch set update : 11.2.0.4.4 (19121551)" sub-patch 18522509; "database patch set update : 11.2.0.4.3 (18522509)" sub-patch 18031668; "database patch set update : 11.2.0.4.2 (18031668)" sub-patch 17478514; "database patch set update : 11.2.0.4.1 (17478514)" bugs fixed: 18619917, 19309466, 28876684, 28855981, 18189036, 19781326, 13609098 16285691, 16756406, 18430495, 17323222, 13854364, 29483723, 19915271 22468255, 19516448, 14458214, 23713236, 23140259, 29434301, 22502493 19540573, 18272672, 16410570, 16494615, 19174430, 21352646, 16901385 16596890, 22243719, 32741584, 18996843, 21387964, 20334344, 17174582 22250006, 17798953, 24307571, 14015842, 18031668, 15955387, 30758943 17391136, 21534893, 16832076, 16065166, 16579084, 25427662, 21179898 24589081, 11786053, 15990359, 17982832, 18685892, 20142975, 24835538 16315398, 20861693, 30018017, 17037130, 17284817, 17643573, 18832544 17891946, 17279227, 17588480, 17291347, 16731148, 21097043, 24528741 22321741, 17165204, 26245237, 17891943, 25205368, 32776891, 17359610 17265217, 17465741, 29621961, 22551446, 31492176, 18191164, 16721594 18614015, 27825893, 18440095, 19769489, 20596234, 25115178, 18482502 16043574, 20936905, 17360606, 22321756, 19211724, 17392698, 19463893 31492164, 29033139, 17477958, 17040764, 18362222, 19463897, 24624166 17853456, 14521849, 17816865, 32190132, 19692824, 21868720, 17951233 25505407, 17040527, 31022191, 24975421, 19888853, 18009564, 20882568 20803583, 23026585, 18604692, 17622427, 16903536, 29483771, 17865671 17883081, 16228604, 17325413, 17082359, 30517516, 12747740, 22168163 16091637, 20569094, 31492144, 17468141, 30365745, 29962939, 19469538 29633753, 20598042, 32775512, 16042673, 23302839, 17437634, 24473736 28734355, 19049453, 33027553, 16941434, 20387265, 16833527, 21343775 17297939, 16069901, 14285317, 22380919, 18436647, 23065323, 31885190 21983325, 31927930, 17853498, 24790914, 23571055, 16542886, 21286665 17365043, 17752995, 25914276, 17296856, 18783224, 22353199, 22083366 28305362, 21419850, 16180763, 23294548, 26679352, 13960236, 25328093 25423453, 18339044, 17282229, 28384353, 25600421, 18856999, 31031715 18259031, 28806384, 21354456, 23725036, 31885162, 18471685, 30237239 17258090, 16344544, 17903598, 17011832, 18135678, 18704244, 17786518 19718981, 25655390, 17242746, 20250147, 19197175, 17390431, 17835627 17672719, 31125948, 17393915, 21566639, 18765602, 21425496, 26544823 22228324, 29962927, 18682983, 30179644, 25165496, 12816846, 31885179 18774543, 31885173, 18747196, 17824637, 21834568, 19429927, 21429602 16524926, 17343514, 19271443, 17019345, 18681862, 17186905, 23330119 17811438, 26474853, 17215560, 16875449, 21380789, 17184721, 18508861 19466309, 33065437, 23330124, 17811429, 17019356, 25654936, 17754782 17752121, 22809871, 17201159, 18308268, 19777862, 16198143, 29027694 18828868, 17586955, 28076295, 19445860, 26654363, 30200680, 22977256 16692232, 27374796, 21142837, 20869721, 17649265, 24555417, 17847764 25879656, 21756699, 19697993, 28364007, 17787259, 30578221, 23628685 30252098, 23007241, 27351628, 18094246, 18460587, 20031873, 17375354 21698350, 26513067, 32153619, 21538567, 18232865, 22683212, 16450169 17478145, 17311728, 17648596, 17308789, 22836801, 21756677, 18674047 33040335, 14084247, 19788303, 22683225, 27534509, 16833845, 18948177 32368789, 17205719, 21756661, 20004021, 17922254, 13837378, 32368792 18084625, 17912217, 11883252, 24842886, 12982566, 26203182, 14176370 14764829, 21847223, 16875230, 28079127, 22568797, 17237521, 29511611 25635149, 16934803, 17848897, 20441797, 20175161, 19831647, 16613964 17532245, 18334586, 17288409, 17341326, 31338362, 17449815, 15913355 16399083, 27404573, 18740837, 20294666, 14565184, 21517440, 17614134 32222473, 19854503, 14245531, 16194160, 18325460, 15979965, 30562923 20671094, 29965888, 27870645, 25093656, 18247991, 16912439, 30562936 17047404, 24433711, 19930276, 22092979, 20506715, 31884535, 23003979 20506706, 13871092, 19272701, 17397545, 16785708, 19461270, 21051862 13829543, 16220077, 17008068, 18061914, 20448824, 30275359, 18674024 29343156, 19689979, 24411921, 23184013, 30275351, 17596908, 17036973 22175564, 22499356, 17612828, 20725343, 31001455, 28199085, 23194294 17630484, 21051858, 20017509, 21051852, 17767676, 17232014, 22893153 12611721, 25555252, 18356166, 17071721, 19315668, 25764020, 16863422 21051840, 17820741, 17267114, 33106822, 18043064, 21538558, 26243698 20324049, 21612959, 30305880, 16392068, 18744139, 24348685, 26746894 17806696, 18628388, 27072923, 14010183, 16595641, 31711889, 17080436 17332800, 20777150, 21453153, 20299015, 18413820, 18264060, 16819962 22465352, 21351877, 21051833, 18673342, 30393318, 30562907, 30562909 29200700, 27441326, 16571443, 18328509, 27567477, 18674465, 16422541 18306996, 19359219, 21424824, 17443671, 17478514, 21067387, 16268425 32846272, 17381384, 18723434, 17235750, 23328639, 22195448, 24570598 21172913, 17655240, 18384391, 16992075, 22195441, 17025461, 30562891 16472716, 19289642, 21502702, 22195457, 20475845, 22148226, 26030218 18331850, 17945983, 13498382, 24652769, 31885230, 18673304, 17610798 19891090, 25369547, 18456514, 8322815, 22657942, 17313525, 17050888 18317531, 19835133, 17495022, 11733603, 18798250, 19285025, 18260550 17390160, 18316692, 19458377, 14368995, 17551063, 21343838, 12905058 14735792, 28612674, 16855292, 23315889, 24480567, 13364795, 33096609 18235390, 18293054, 32190284, 18673325, 30215130, 19393542, 14657740 17532729, 17393683, 17389192, 17783588, 17852463, 19358317, 17441661 14034426, 28254374, 20631274, 19207117, 26569225, 17518652, 24662775 19475971, 31885201, 18282562, 30421204, 19896336, 17348614, 19827973 31883489, 17346671, 31022281, 19791273, 32359044, 24476274, 22296366 13853126, 18273830, 17570606, 13558557, 20425790, 26007010, 16685417 31885223, 18180390, 14692762, 18159793, 17027426, 24476265, 23177648 17851160, 16870214, 18202441, 17227073, 32984679, 20657411, 19006849 22606521, 20506699, 28000269, 23536835, 17761775, 20382309, 16306373 31885213, 17801017, 19680952, 16850630, 17694209, 26667015, 17877323 18230522, 25288078, 24563422, 17446237, 17889549, 17551674, 16233738 22730454, 17571039, 26667023, 19972570, 18849970, 21532755, 20860659 22905130, 21168487, 17016369, 21263635, 17231779, 17717883, 21343897 27710072, 18522509, 23209741, 17484731, 21972320, 19972569, 19972568 17716305, 21059919, 19972566, 19972564, 26667032, 17394950, 26318200 20657441, 17551699, 17006570, 18051556, 12364061, 18029658, 17546973 18262334, 19699191, 30387666, 17227277, 32676350, 18018515, 16943711 18388363, 17982555, 20828947, 18098207, 18436307, 19584068, 16898135 13936038, 19601762, 31010960, 14054676, 25505394, 18228645, 29782211 19013183, 25042823, 17721717, 17239687, 25248384, 25634317, 20134113 20273319, 28501075, 31945038, 30624864, 21063322, 31834759, 17344412 22507210, 32097882, 16354467, 21795111, 25505371, 16777840, 25879984 17811456, 19730508, 17385178, 18166013, 17484762, 10136473, 6599380 20717359, 20296213, 27097854, 13955826, 18193833, 17545847, 16837842 18964939, 19871910, 25505382, 14786201, 17811447, 18554763, 21132297 25957038, 20004087, 17889583, 19544839, 26631046, 22507234, 24719736 18868646, 17042658, 20627866, 14106803, 13951456, 10088587, 18139690 18277454, 13680635, 22750215, 25823754, 18554871, 18515268, 20169408 24908321, 17274537, 17602269, 26575788, 19032867, 17762296, 14829250 16929165, 14602788, 28849751, 21794615, 18899974, 29944660, 18441944 14521218, 17811789, 20074391, 14852021, 17705023, 13645875, 24316947 16668584, 17786278, 25947799, 20879889, 19578350, 28022101, 22594718 16384983, 26439748, 17957017, 19121551, 17570240, 19788842, 18382302 27086138, 21330264, 21197626, 14338435, 13944971, 21656630, 22826067 18886413, 17156148, 17936109, 20509482, 27255377, 24717859, 18762750 21526048, 24560906, 18096714, 17238511, 26078387, 27053456, 20144308 25364628, 18244962, 19433930, 20476175, 19297917, 19330795, 31506720 21174504, 18280813, 28819280, 17614227, 28357401, 32335769, 21911701 25809524, 17006183, 18092127, 19727057, 17695685, 26039623, 22820579 20856766, 15861775, 17258582, 21668627, 19487147, 20925795, 28100487 22760679, 26482376, 19554106, 21629064, 18199537, 18091059, 17299889 26999139, 21538485, 17546761, 26336977, 25775213, 18155762, 30803210 31683205, 31194264, 16956380, 19207156, 14705949, 31836113, 23105538 26198926, 19258504, 16314254, 17890099, 17246576, 17655634, 16989630 20067212, 19721304, 25077278, 19490948, 18203835, 18203838, 18973907 18203837, 29483672, 19615136, 17587063, 18000422, 18641451, 18090142 21641760, 17019086, 30559616, 19373893, 18373438, 21820934, 18641461 17346091, 21422580, 22351572, 18604493, 23008056, 22901797, 18610915 22666802, 17892268, 31668061, 17501491, 20907061, 14354737, 17835048 21787056, 22195485, 22782647, 17082983, 23266217, 18641419, 16618694 14133975, 22195492, 18331812, 18093615, 24385983, 25897615, 20513399 21281607, 13866822, 18841764, 17600719, 17842825, 20558005, 17088068 9756271, 22195465, 18440047, 32834168, 19211433, 21515534, 20331945 22686674, 18384537, 18607546, 17254374, 18315328, 31172207, 23115139 28790634, 21394225, 16360112, 22195477, 17726838, 18510194, 17571306 24766121, 17302277, 21842740, 33090781, 17551709, 28566241, 26910644 17634921, 25489607, 16538760 patch 32758914 : applied on tue apr 26 21:51:56 cst 2022 unique patch id: 24257847 patch description: "ocw patch set update 11.2.0.4.210720 (32758914)" created on 13 jul 2021, 11:48:50 hrs pst8pdt bugs fixed: 19270660, 18328800, 18508710, 18691572, 20038451, 21251192, 22162062 21232394, 20365005, 17336871, 17750548, 17387214, 17617807, 14497275 20219458, 17733927, 18180541, 23757020, 18962892, 17292250, 17378618 16759171, 20110156, 17843489, 17065496, 21694632, 13991403, 18419139 17273020, 22762046, 17336884, 17155238, 21245437, 20012766, 18053580 18261183, 17336889, 20218012, 17013634, 17886392, 24422155, 20995001 17039197, 17947785, 16317771, 10052729, 22353346, 20340620, 16237657 20317221, 15917869, 18199185, 18399991, 20186278, 18024089, 17374271 16849642, 20246071, 20746251, 14270845, 23621494, 20552947, 18414137 18882642, 17001914, 17927970, 29323944, 14378120, 16346413, 15986647 17336898, 18068871, 21222147, 18143836, 16206997, 21982225, 25490238 19168690, 20235511, 18343490, 21875360, 16613232, 19276791, 17722664 20440643, 12928658, 18952577, 16249829, 18520351, 18226143, 18265482 16076412, 18229842, 17172091, 20676340, 17818075, 20091753, 18231837 14373486, 20136892, 17483479, 20551654, 18120545, 18729166, 13843841 21225209, 17405302, 18709496, 18330979, 18744838, 14525998, 18187697 17087371, 20531190, 14385860, 20598625, 18348155, 19479503, 12928592 17516024, 18370031, 17764053, 19272663, 17551223, 14671408, 18272135 14207615, 24692493, 21255373, 17500165, 18875012, 14769643, 19558324 25656952, 18464784, 18848125, 19241857, 14851828, 17955615, 30158572 20315294, 14693336, 20014326, 17352230, 16284825, 17238586, 17089344 17405605, 21327402, 17531342, 26546632, 19398098, 17640316, 17159489 13823394, 16543190, 22024217, 17983675, 20795241, 28973538, 16281493 17598201, 28553832, 18346135, 17481314, 15986311, 19601468, 17208793 18999857, 18700935, 14076173, 18428146, 16709532, 18352845, 17435488 17592037, 20408163, 18352846, 19616601, 17391726, 17387779, 15851860 14777968, 20141091, 16206882, 19885321, 20175174, 21113068, 17305100 15832129, 16901346, 25591658, 17985714, 18536826, 17780903, 18752378 18946768, 16875342, 16876500, 17769597, 19955755, 16429265, 31999107 18336452, 23186035, 17273003, 17209968, 25484507, 17059927, 17046460 20094984, 19319357, 16988311, 18053631, 16867761, 18774591, 20235486 21442094, 19359787, 15869775, 19642566, 17447588, 21152052, 16798862 15920201 -------------------------------------------------------------------------------- opatch succeeded. [grid@rac1:/home/grid]$$oracle_home/opatch/opatch lspatches 33112794;acfs patch set update 11.2.0.4.210720 (33112794) 33477185;database patch set update : 11.2.0.4.220118 (33477185) 32758914;ocw patch set update 11.2.0.4.210720 (32758914) opatch succeeded. ```验证db升级结果``` [root@rac1 ~]# su - oracle [oracle@rac1:/home/oracle]$$oracle_home/opatch/opatch lsinventory oracle interim patch installer version 11.2.0.3.33 米乐app官网下载 copyright (c) 2022, oracle corporation. all rights reserved. oracle home : /oracle/app/oracle/product/11.2.0/db_1 central inventory : /oracle/app/orainventory from : /oracle/app/oracle/product/11.2.0/db_1/orainst.loc opatch version : 11.2.0.3.33 oui version : 11.2.0.4.0 log file location : /oracle/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2022-04-26_22-17-06pm_1.log lsinventory output file location : /oracle/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2022-04-26_22-17-06pm.txt -------------------------------------------------------------------------------- local machine information:: hostname: rac1 aru platform id: 226 aru platform description:: linux x86-64 installed top-level products (1): oracle database 11g 11.2.0.4.0 there are 1 products installed in this oracle home. interim patches (2) : patch 33477185 : applied on tue apr 26 22:06:06 cst 2022 unique patch id: 24548176 patch description: "database patch set update : 11.2.0.4.220118 (33477185)" created on 15 dec 2021, 07:23:11 hrs utc sub-patch 33128584; "database patch set update : 11.2.0.4.211019 (33128584)" sub-patch 32758711; "database patch set update : 11.2.0.4.210720 (32758711)" sub-patch 32328626; "database patch set update : 11.2.0.4.210420 (32328626)" sub-patch 31983472; "database patch set update : 11.2.0.4.210119 (31983472)" sub-patch 31537677; "database patch set update : 11.2.0.4.201020 (31537677)" sub-patch 31103343; "database patch set update : 11.2.0.4.200714 (31103343)" sub-patch 30670774; "database patch set update : 11.2.0.4.200414 (30670774)" sub-patch 30298532; "database patch set update : 11.2.0.4.200114 (30298532)" sub-patch 29913194; "database patch set update : 11.2.0.4.191015 (29913194)" sub-patch 29497421; "database patch set update : 11.2.0.4.190716 (29497421)" sub-patch 29141056; "database patch set update : 11.2.0.4.190416 (29141056)" sub-patch 28729262; "database patch set update : 11.2.0.4.190115 (28729262)" sub-patch 28204707; "database patch set update : 11.2.0.4.181016 (28204707)" sub-patch 27734982; "database patch set update : 11.2.0.4.180717 (27734982)" sub-patch 27338049; "database patch set update : 11.2.0.4.180417 (27338049)" sub-patch 26925576; "database patch set update : 11.2.0.4.180116 (26925576)" sub-patch 26392168; "database patch set update : 11.2.0.4.171017 (26392168)" sub-patch 26609445; "database patch set update : 11.2.0.4.170814 (26609445)" sub-patch 25869727; "database patch set update : 11.2.0.4.170718 (25869727)" sub-patch 24732075; "database patch set update : 11.2.0.4.170418 (24732075)" sub-patch 24006111; "database patch set update : 11.2.0.4.161018 (24006111)" sub-patch 23054359; "database patch set update : 11.2.0.4.160719 (23054359)" sub-patch 22502456; "database patch set update : 11.2.0.4.160419 (22502456)" sub-patch 21948347; "database patch set update : 11.2.0.4.160119 (21948347)" sub-patch 21352635; "database patch set update : 11.2.0.4.8 (21352635)" sub-patch 20760982; "database patch set update : 11.2.0.4.7 (20760982)" sub-patch 20299013; "database patch set update : 11.2.0.4.6 (20299013)" sub-patch 19769489; "database patch set update : 11.2.0.4.5 (19769489)" sub-patch 19121551; "database patch set update : 11.2.0.4.4 (19121551)" sub-patch 18522509; "database patch set update : 11.2.0.4.3 (18522509)" sub-patch 18031668; "database patch set update : 11.2.0.4.2 (18031668)" sub-patch 17478514; "database patch set update : 11.2.0.4.1 (17478514)" bugs fixed: 18619917, 19309466, 28876684, 28855981, 18189036, 19781326, 13609098 16285691, 16756406, 18430495, 17323222, 13854364, 29483723, 19915271 22468255, 19516448, 14458214, 23713236, 23140259, 29434301, 22502493 19540573, 18272672, 16410570, 16494615, 19174430, 21352646, 16901385 16596890, 22243719, 32741584, 18996843, 21387964, 20334344, 17174582 22250006, 17798953, 24307571, 14015842, 18031668, 15955387, 30758943 17391136, 21534893, 16832076, 16065166, 16579084, 25427662, 21179898 24589081, 11786053, 15990359, 17982832, 18685892, 20142975, 24835538 16315398, 20861693, 30018017, 17037130, 17284817, 17643573, 18832544 17891946, 17279227, 17588480, 17291347, 16731148, 21097043, 24528741 22321741, 17165204, 26245237, 17891943, 25205368, 32776891, 17359610 17265217, 17465741, 29621961, 22551446, 31492176, 18191164, 16721594 18614015, 27825893, 18440095, 19769489, 20596234, 25115178, 18482502 16043574, 20936905, 17360606, 22321756, 19211724, 17392698, 19463893 31492164, 29033139, 17477958, 17040764, 18362222, 19463897, 24624166 17853456, 14521849, 17816865, 32190132, 19692824, 21868720, 17951233 25505407, 17040527, 31022191, 24975421, 19888853, 18009564, 20882568 20803583, 23026585, 18604692, 17622427, 16903536, 29483771, 17865671 17883081, 16228604, 17325413, 17082359, 30517516, 12747740, 22168163 16091637, 20569094, 31492144, 17468141, 30365745, 29962939, 19469538 29633753, 20598042, 32775512, 16042673, 23302839, 17437634, 24473736 28734355, 19049453, 33027553, 16941434, 20387265, 16833527, 21343775 17297939, 16069901, 14285317, 22380919, 18436647, 23065323, 31885190 21983325, 31927930, 17853498, 24790914, 23571055, 16542886, 21286665 17365043, 17752995, 25914276, 17296856, 18783224, 22353199, 22083366 28305362, 21419850, 16180763, 23294548, 26679352, 13960236, 25328093 25423453, 18339044, 17282229, 28384353, 25600421, 18856999, 31031715 18259031, 28806384, 21354456, 23725036, 31885162, 18471685, 30237239 17258090, 16344544, 17903598, 17011832, 18135678, 18704244, 17786518 19718981, 25655390, 17242746, 20250147, 19197175, 17390431, 17835627 17672719, 31125948, 17393915, 21566639, 18765602, 21425496, 26544823 22228324, 29962927, 18682983, 30179644, 25165496, 12816846, 31885179 18774543, 31885173, 18747196, 17824637, 21834568, 19429927, 21429602 16524926, 17343514, 19271443, 17019345, 18681862, 17186905, 23330119 17811438, 26474853, 17215560, 16875449, 21380789, 17184721, 18508861 19466309, 33065437, 23330124, 17811429, 17019356, 25654936, 17754782 17752121, 22809871, 17201159, 18308268, 19777862, 16198143, 29027694 18828868, 17586955, 28076295, 19445860, 26654363, 30200680, 22977256 16692232, 27374796, 21142837, 20869721, 17649265, 24555417, 17847764 25879656, 21756699, 19697993, 28364007, 17787259, 30578221, 23628685 30252098, 23007241, 27351628, 18094246, 18460587, 20031873, 17375354 21698350, 26513067, 32153619, 21538567, 18232865, 22683212, 16450169 17478145, 17311728, 17648596, 17308789, 22836801, 21756677, 18674047 33040335, 14084247, 19788303, 22683225, 27534509, 16833845, 18948177 32368789, 17205719, 21756661, 20004021, 17922254, 13837378, 32368792 18084625, 17912217, 11883252, 24842886, 12982566, 26203182, 14176370 14764829, 21847223, 16875230, 28079127, 22568797, 17237521, 29511611 25635149, 16934803, 17848897, 20441797, 20175161, 19831647, 16613964 17532245, 18334586, 17288409, 17341326, 31338362, 17449815, 15913355 16399083, 27404573, 18740837, 20294666, 14565184, 21517440, 17614134 32222473, 19854503, 14245531, 16194160, 18325460, 15979965, 30562923 20671094, 29965888, 27870645, 25093656, 18247991, 16912439, 30562936 17047404, 24433711, 19930276, 22092979, 20506715, 31884535, 23003979 20506706, 13871092, 19272701, 17397545, 16785708, 19461270, 21051862 13829543, 16220077, 17008068, 18061914, 20448824, 30275359, 18674024 29343156, 19689979, 24411921, 23184013, 30275351, 17596908, 17036973 22175564, 22499356, 17612828, 20725343, 31001455, 28199085, 23194294 17630484, 21051858, 20017509, 21051852, 17767676, 17232014, 22893153 12611721, 25555252, 18356166, 17071721, 19315668, 25764020, 16863422 21051840, 17820741, 17267114, 33106822, 18043064, 21538558, 26243698 20324049, 21612959, 30305880, 16392068, 18744139, 24348685, 26746894 17806696, 18628388, 27072923, 14010183, 16595641, 31711889, 17080436 17332800, 20777150, 21453153, 20299015, 18413820, 18264060, 16819962 22465352, 21351877, 21051833, 18673342, 30393318, 30562907, 30562909 29200700, 27441326, 16571443, 18328509, 27567477, 18674465, 16422541 18306996, 19359219, 21424824, 17443671, 17478514, 21067387, 16268425 32846272, 17381384, 18723434, 17235750, 23328639, 22195448, 24570598 21172913, 17655240, 18384391, 16992075, 22195441, 17025461, 30562891 16472716, 19289642, 21502702, 22195457, 20475845, 22148226, 26030218 18331850, 17945983, 13498382, 24652769, 31885230, 18673304, 17610798 19891090, 25369547, 18456514, 8322815, 22657942, 17313525, 17050888 18317531, 19835133, 17495022, 11733603, 18798250, 19285025, 18260550 17390160, 18316692, 19458377, 14368995, 17551063, 21343838, 12905058 14735792, 28612674, 16855292, 23315889, 24480567, 13364795, 33096609 18235390, 18293054, 32190284, 18673325, 30215130, 19393542, 14657740 17532729, 17393683, 17389192, 17783588, 17852463, 19358317, 17441661 14034426, 28254374, 20631274, 19207117, 26569225, 17518652, 24662775 19475971, 31885201, 18282562, 30421204, 19896336, 17348614, 19827973 31883489, 17346671, 31022281, 19791273, 32359044, 24476274, 22296366 13853126, 18273830, 17570606, 13558557, 20425790, 26007010, 16685417 31885223, 18180390, 14692762, 18159793, 17027426, 24476265, 23177648 17851160, 16870214, 18202441, 17227073, 32984679, 20657411, 19006849 22606521, 20506699, 28000269, 23536835, 17761775, 20382309, 16306373 31885213, 17801017, 19680952, 16850630, 17694209, 26667015, 17877323 18230522, 25288078, 24563422, 17446237, 17889549, 17551674, 16233738 22730454, 17571039, 26667023, 19972570, 18849970, 21532755, 20860659 22905130, 21168487, 17016369, 21263635, 17231779, 17717883, 21343897 27710072, 18522509, 23209741, 17484731, 21972320, 19972569, 19972568 17716305, 21059919, 19972566, 19972564, 26667032, 17394950, 26318200 20657441, 17551699, 17006570, 18051556, 12364061, 18029658, 17546973 18262334, 19699191, 30387666, 17227277, 32676350, 18018515, 16943711 18388363, 17982555, 20828947, 18098207, 18436307, 19584068, 16898135 13936038, 19601762, 31010960, 14054676, 25505394, 18228645, 29782211 19013183, 25042823, 17721717, 17239687, 25248384, 25634317, 20134113 20273319, 28501075, 31945038, 30624864, 21063322, 31834759, 17344412 22507210, 32097882, 16354467, 21795111, 25505371, 16777840, 25879984 17811456, 19730508, 17385178, 18166013, 17484762, 10136473, 6599380 20717359, 20296213, 27097854, 13955826, 18193833, 17545847, 16837842 18964939, 19871910, 25505382, 14786201, 17811447, 18554763, 21132297 25957038, 20004087, 17889583, 19544839, 26631046, 22507234, 24719736 18868646, 17042658, 20627866, 14106803, 13951456, 10088587, 18139690 18277454, 13680635, 22750215, 25823754, 18554871, 18515268, 20169408 24908321, 17274537, 17602269, 26575788, 19032867, 17762296, 14829250 16929165, 14602788, 28849751, 21794615, 18899974, 29944660, 18441944 14521218, 17811789, 20074391, 14852021, 17705023, 13645875, 24316947 16668584, 17786278, 25947799, 20879889, 19578350, 28022101, 22594718 16384983, 26439748, 17957017, 19121551, 17570240, 19788842, 18382302 27086138, 21330264, 21197626, 14338435, 13944971, 21656630, 22826067 18886413, 17156148, 17936109, 20509482, 27255377, 24717859, 18762750 21526048, 24560906, 18096714, 17238511, 26078387, 27053456, 20144308 25364628, 18244962, 19433930, 20476175, 19297917, 19330795, 31506720 21174504, 18280813, 28819280, 17614227, 28357401, 32335769, 21911701 25809524, 17006183, 18092127, 19727057, 17695685, 26039623, 22820579 20856766, 15861775, 17258582, 21668627, 19487147, 20925795, 28100487 22760679, 26482376, 19554106, 21629064, 18199537, 18091059, 17299889 26999139, 21538485, 17546761, 26336977, 25775213, 18155762, 30803210 31683205, 31194264, 16956380, 19207156, 14705949, 31836113, 23105538 26198926, 19258504, 16314254, 17890099, 17246576, 17655634, 16989630 20067212, 19721304, 25077278, 19490948, 18203835, 18203838, 18973907 18203837, 29483672, 19615136, 17587063, 18000422, 18641451, 18090142 21641760, 17019086, 30559616, 19373893, 18373438, 21820934, 18641461 17346091, 21422580, 22351572, 18604493, 23008056, 22901797, 18610915 22666802, 17892268, 31668061, 17501491, 20907061, 14354737, 17835048 21787056, 22195485, 22782647, 17082983, 23266217, 18641419, 16618694 14133975, 22195492, 18331812, 18093615, 24385983, 25897615, 20513399 21281607, 13866822, 18841764, 17600719, 17842825, 20558005, 17088068 9756271, 22195465, 18440047, 32834168, 19211433, 21515534, 20331945 22686674, 18384537, 18607546, 17254374, 18315328, 31172207, 23115139 28790634, 21394225, 16360112, 22195477, 17726838, 18510194, 17571306 24766121, 17302277, 21842740, 33090781, 17551709, 28566241, 26910644 17634921, 25489607, 16538760 patch 32758914 : applied on tue apr 26 22:02:02 cst 2022 unique patch id: 24257847 patch description: "ocw patch set update 11.2.0.4.210720 (32758914)" created on 13 jul 2021, 11:48:40 hrs pst8pdt bugs fixed: 19270660, 18328800, 18508710, 18691572, 20038451, 21251192, 22162062 21232394, 20365005, 17336871, 17750548, 17387214, 17617807, 14497275 20219458, 17733927, 18180541, 23757020, 18962892, 17292250, 17378618 16759171, 20110156, 17843489, 17065496, 21694632, 13991403, 18419139 17273020, 22762046, 17336884, 17155238, 21245437, 20012766, 18053580 18261183, 17336889, 20218012, 17013634, 17886392, 24422155, 20995001 17039197, 17947785, 16317771, 10052729, 22353346, 20340620, 16237657 20317221, 15917869, 18199185, 18399991, 20186278, 18024089, 17374271 16849642, 20246071, 20746251, 14270845, 23621494, 20552947, 18414137 18882642, 17001914, 17927970, 29323944, 14378120, 16346413, 15986647 17336898, 18068871, 21222147, 18143836, 16206997, 21982225, 25490238 19168690, 20235511, 18343490, 21875360, 16613232, 19276791, 17722664 20440643, 12928658, 18952577, 16249829, 18520351, 18226143, 18265482 16076412, 18229842, 17172091, 20676340, 17818075, 20091753, 18231837 14373486, 20136892, 17483479, 20551654, 18120545, 18729166, 13843841 21225209, 17405302, 18709496, 18330979, 18744838, 14525998, 18187697 17087371, 20531190, 14385860, 20598625, 18348155, 19479503, 12928592 17516024, 18370031, 17764053, 19272663, 17551223, 14671408, 18272135 14207615, 24692493, 21255373, 17500165, 18875012, 14769643, 19558324 25656952, 18464784, 18848125, 19241857, 14851828, 17955615, 30158572 20315294, 14693336, 20014326, 17352230, 16284825, 17238586, 17089344 17405605, 21327402, 17531342, 26546632, 19398098, 17640316, 17159489 13823394, 16543190, 22024217, 17983675, 20795241, 28973538, 16281493 17598201, 28553832, 18346135, 17481314, 15986311, 19601468, 17208793 18999857, 18700935, 14076173, 18428146, 16709532, 18352845, 17435488 17592037, 20408163, 18352846, 19616601, 17391726, 17387779, 15851860 14777968, 20141091, 16206882, 19885321, 20175174, 21113068, 17305100 15832129, 16901346, 25591658, 17985714, 18536826, 17780903, 18752378 18946768, 16875342, 16876500, 17769597, 19955755, 16429265, 31999107 18336452, 23186035, 17273003, 17209968, 25484507, 17059927, 17046460 20094984, 19319357, 16988311, 18053631, 16867761, 18774591, 20235486 21442094, 19359787, 15869775, 19642566, 17447588, 21152052, 16798862 15920201 -------------------------------------------------------------------------------- opatch succeeded. [oracle@rac1:/home/oracle]$$oracle_home/opatch/opatch lspatches 33477185;database patch set update : 11.2.0.4.220118 (33477185) 32758914;ocw patch set update 11.2.0.4.210720 (32758914) opatch succeeded. ```然后开始为节点2升级gi、db的psu``` [root@rac2 ~]# /oracle/app/11.2.0/grid/opatch/opatch auto /psu/33575261/ -oh /oracle/app/11.2.0/grid executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/opatch/crs/patch11203.pl -patchdir /psu -patchn 33575261 -oh /oracle/app/11.2.0/grid -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params this is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-22-28.log this file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-22-28.report.log 2022-04-26 22:22:28: starting clusterware patch setup using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params stopping crs... stopped crs successfully patch /psu/33575261/32758914 apply successful for home /oracle/app/11.2.0/grid patch /psu/33575261/33477185 apply successful for home /oracle/app/11.2.0/grid patch /psu/33575261/33112794 apply successful for home /oracle/app/11.2.0/grid starting crs... installing trace file analyzer crs-4124: oracle high availability services startup failed. crs-4000: command start failed, or completed with errors. `到了这个地方会卡住一段时间,新开窗口执行crsctl start has启动has` opatch auto succeeded. [root@rac2 ~]# /oracle/app/11.2.0/grid/opatch/opatch auto /psu/33575261/ -oh /oracle/app/oracle/product/11.2.0/db_1 executing /oracle/app/11.2.0/grid/perl/bin/perl /oracle/app/11.2.0/grid/opatch/crs/patch11203.pl -patchdir /psu -patchn 33575261 -oh /oracle/app/oracle/product/11.2.0/db_1 -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params this is the main log file: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-42-50.log this file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /oracle/app/11.2.0/grid/cfgtoollogs/opatchauto2022-04-26_22-42-50.report.log 2022-04-26 22:42:50: starting clusterware patch setup using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params stopping rac /oracle/app/oracle/product/11.2.0/db_1 ... stopped rac /oracle/app/oracle/product/11.2.0/db_1 successfully patch /psu/33575261/32758914/custom/server/32758914 apply successful for home /oracle/app/oracle/product/11.2.0/db_1 patch /psu/33575261/33477185 apply successful for home /oracle/app/oracle/product/11.2.0/db_1 starting rac /oracle/app/oracle/product/11.2.0/db_1 ... started rac /oracle/app/oracle/product/11.2.0/db_1 successfully opatch auto succeeded.

7,执行sql更新数据字典

[oracle@rac1:/home/oracle]$cd $oracle_home/rdbms/admin [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/rdbms/admin]$sqlplus /nolog sql*plus: release 11.2.0.4.0 production on tue apr 26 22:52:22 2022 米乐app官网下载 copyright (c) 1982, 2013, oracle. all rights reserved. @>connect / as sysdba connected to an idle instance. sys@orcl1>startup oracle instance started. total system global area 1453092864 bytes fixed size 2253304 bytes variable size 1325403656 bytes database buffers 117440512 bytes redo buffers 7995392 bytes ora-00205: error in identifying control file, check alert log for more info 查看alert日志,有大量如下报错信息: tue apr 26 22:53:57 2022 success: diskgroup data was dismounted error: diskgroup data was not mounted ora-01565: unable to open spfile data/orcl/spfileorcl.ora. ora-15025: could not open disk "/dev/asm-data1" ora-27041: unable to open file linux-x86_64 error: 13: permission denied additional information: 9 ora-15025: could not open disk "/dev/asm-data2" ora-27041: unable to open file linux-x86_64 error: 13: permission denied additional information: 9 success: diskgroup data was dismounted error: diskgroup data was not mounted ora-01565: unable to open spfile data/orcl/spfileorcl.ora. ora-15025: could not open disk "/dev/asm-data1" ora-27041: unable to open file linux-x86_64 error: 13: permission denied additional information: 9 这跟$oracle_home/bin/oracle这个文件的属性有关系: 在安装oracle soft之后: $oracle_home/bin/oracle文件属性权限为oracle:oninstall 751(-rwxr-x--x) 在安装asm建库(dbca)时: 此文件属性会自动被修改为oracle:asmadmin6751(-rwsr-s--x) 在psu apply之后: 此文件属性又被自动被修改为oracle:oinstall751(-rwxr-x--x),修改此文件属主及权限如下: [root@rac1 ~]# chown oracle:asmadmin /oracle/app/oracle/product/11.2.0/db_1/bin/oracle [root@rac1 ~]# chmod 6751 /oracle/app/oracle/product/11.2.0/db_1/bin/oracle [root@rac1 ~]# ls -al /oracle/app/oracle/product/11.2.0/db_1/bin/oracle -rwsr-s--x 1 oracle asmadmin 239988728 apr 26 22:07 /oracle/app/oracle/product/11.2.0/db_1/bin/oracle [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/rdbms/admin]$sqlplus / as sysdba sys@orcl1>startup ora-01012: not logged on sys@orcl1>shutdown abort sys@orcl1>exit [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/rdbms/admin]$sqlplus /nolog sql*plus: release 11.2.0.4.0 production on tue apr 26 23:03:26 2022 米乐app官网下载 copyright (c) 1982, 2013, oracle. all rights reserved. @>connect / as sysdba connected to an idle instance. sys@orcl1>startup oracle instance started. total system global area 1453092864 bytes fixed size 2253304 bytes variable size 1325403656 bytes database buffers 117440512 bytes redo buffers 7995392 bytes database mounted. database opened. sys@orcl1>@catbundle.sql psu apply sys@orcl1>col action_time for a30 sys@orcl1>col action for a10 sys@orcl1>col namespace for a10 sys@orcl1>col version for a20 sys@orcl1>col comments for a10 sys@orcl1>set linesize 300 sys@orcl1>select * from dba_registry_history; action_time action namespace version id bundle_series comments ------------------------------ ---------- ---------- -------------------- ---------- ------------------------------ ---------- 24-aug-13 12.03.45.119862 pm apply server 11.2.0.4 0 psu patchset 1 1.2.0.2.0 26-apr-22 09.24.31.313733 am apply server 11.2.0.4 0 psu patchset 1 1.2.0.2.0 26-apr-22 11.07.13.586425 pm apply server 11.2.0.4 220118 psu psu 11.2.0 .4.220118 然后启动节点2的数据库,启动的时候和节点1有同样的报错,按照节点1的处理方法即可。

八、修改ip

```现有ip配置``` #public ip 172.22.180.221 rac1 172.22.180.222 rac2 #private ip 10.0.0.1 rac1-priv 10.0.0.2 rac2-priv #vip 172.22.180.223 rac1-vip 172.22.180.224 rac2-vip #scanip 172.22.180.225 scan ```修改后的ip配置``` 192.168.10.221 rac1 192.168.10.222 rac2 #private ip 172.0.0.221 rac1-priv 172.0.0.222 rac2-priv #vip 192.168.10.223 rac1-vip 192.168.10.224 rac2-vip #scanip 192.168.10.225 scan 当前集群网卡ip配置信息 [root@rac1 ~]# oifcfg getif ens33 172.22.180.0 global public ens34 10.0.0.0 global cluster_interconnect 当前vip配置信息 [root@rac1 ~]# srvctl config nodeapps -a network exists: 1/172.22.180.0/255.255.255.0/ens33, type static vip exists: /rac1-vip/172.22.180.223/172.22.180.0/255.255.255.0/ens33, hosting node rac1 vip exists: /rac2-vip/172.22.180.224/172.22.180.0/255.255.255.0/ens33, hosting node rac2 当前网卡配置文件 [root@rac1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 type="ethernet" proxy_method="none" browser_only="no" bootproto="none" defroute="yes" ipv4_failure_fatal="no" ipv6init="yes" ipv6_autoconf="yes" ipv6_defroute="yes" ipv6_failure_fatal="no" ipv6_addr_gen_mode="stable-privacy" name="ens33" uuid="92ad197e-1585-4848-ad95-e7b64549d652" device="ens33" onboot="yes" ipv6_privacy="no" ipaddr="172.22.180.221" prefix="24" gateway="172.22.180.254" [root@rac1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens34 type=ethernet proxy_method=none browser_only=no bootproto=none defroute=yes ipv4_failure_fatal=no ipv6init=yes ipv6_autoconf=yes ipv6_defroute=yes ipv6_failure_fatal=no ipv6_addr_gen_mode=stable-privacy name=ens34 uuid=3eea2291-283b-4267-b029-6e8bc4748198 device=ens34 onboot=yes ipaddr=10.0.0.1 prefix=24 gateway=10.0.0.254 ipv6_privacy=no

1,备份相关配置文件

手动备份ocr [root@rac1 ~]# ocrconfig -manualbackup rac1 2022/04/28 14:48:39 /oracle/app/11.2.0/grid/cdata/orcl-cluster/backup_20220428_144839.ocr [root@rac1 ~]# ocrconfig -export /tmp/orc_bak 备份网卡配置信息 [root@rac1 ~]# cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33.bak [root@rac1 ~]# cp /etc/sysconfig/network-scripts/ifcfg-ens34 /etc/sysconfig/network-scripts/ifcfg-ens34.bak 备份hosts文件 [root@rac1 ~]# cp /etc/hosts /etc/hosts.bak

2,停止相关资源

  • 停止监听

    [grid@rac1:/home/grid]$srvctl status listener listener listener is enabled listener listener is running on node(s): rac2,rac1 [grid@rac1:/home/grid]$srvctl stop listener [grid@rac1:/home/grid]$srvctl status listener listener listener is enabled listener listener is not running
  • 停止数据库

    [grid@rac1:/home/grid]$srvctl status database -d orcl instance orcl1 is running on node rac1 instance orcl2 is running on node rac2 [grid@rac1:/home/grid]$srvctl stop database -d orcl [grid@rac1:/home/grid]$srvctl status database -d orcl instance orcl1 is not running on node rac1 instance orcl2 is not running on node rac2
  • 停止vip

    [grid@rac1:/home/grid]$srvctl status vip -n rac1 vip rac1-vip is enabled vip rac1-vip is running on node: rac1 [grid@rac1:/home/grid]$srvctl status vip -n rac2 vip rac2-vip is enabled vip rac2-vip is running on node: rac2 [grid@rac1:/home/grid]$srvctl stop vip -n rac1 [grid@rac1:/home/grid]$srvctl stop vip -n rac2 [root@rac1 ~]# srvctl status vip -n rac1 vip rac1-vip is enabled vip rac1-vip is not running [root@rac1 ~]# srvctl status vip -n rac2 vip rac2-vip is enabled vip rac2-vip is not running
  • 停止sacn_listener

    [root@rac1 ~]# srvctl status scan_listener scan listener listener_scan1 is enabled scan listener listener_scan1 is running on node rac1 [root@rac1 ~]# srvctl disable scan_listener [root@rac1 ~]# srvctl stop scan_listener [root@rac1 ~]# srvctl status scan_listener scan listener listener_scan1 is disabled scan listener listener_scan1 is not running
  • 停止scan

    [root@rac1 ~]# srvctl status scan scan vip scan1 is enabled scan vip scan1 is running on node rac1 [root@rac1 ~]# srvctl stop scan [root@rac1 ~]# srvctl status scan scan vip scan1 is disabled scan vip scan1 is not running
  • 注意:不用停止两台节点的crs,否则在修改public ip的时候会出现如下报错

    [root@rac1 ~]# oifcfg delif -global ens33/172.22.180.0 prif-10: failed to initialize the cluster registry [root@rac1 ~]# oifcfg delif -global ens33/172.22.180.0 prif-33: failed to set or delete interface because hosts could not be discovered crs-02307: no gpnp services on requested remote hosts. prif-32: error in checking for profile availability for host rac2 crs-02306: gpnp service on host "rac2" not found.

3,修改public ip

  • 删除集群网卡配置

    [root@rac1 ~]# oifcfg delif -global ens33/172.22.180.0
  • 配置新的public地址

    [root@rac1 ~]# oifcfg setif -global ens33/192.168.10.0:public [root@rac1 ~]# oifcfg getif ens34 10.0.0.0 global cluster_interconnect ens33 192.168.10.0 global public
  • 两台节点修改hosts文件

    #public ip 192.168.10.221 rac1 192.168.10.222 rac2
  • 两台节点修改网卡配置文件

    [root@rac1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33 ipaddr=192.168.10.221 gateway=192.168.10.254 [root@rac2 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33 ipaddr=192.168.10.222 gateway=192.168.10.254
  • 重启网络服务

    vip地址依赖于public地址,所以上面修改地址之后,需要重启网络服务,让ens33网卡获取新的ip,修改虚拟机里网卡连接方式,由桥接修改为nat [root@rac1 ~]# systemctl restart network [root@rac2 ~]# systemctl restart network

4,修改vip

  • 两节点修改hosts文件

    #vip 192.168.10.223 rac1-vip 192.168.10.224 rac2-vip
  • 修改集群vip配置并启动服务

    [root@rac1 ~]# srvctl modify nodeapps -n rac1 -a 192.168.10.223/255.255.255.0/ens33 [root@rac1 ~]# srvctl start vip -n rac1 [root@rac1 ~]# srvctl start listener -n rac1

5,修改scan ip

  • 修改hosts文件

    #scanip 192.168.10.225 scan
  • 修改集群scan ip并启动服务

    [root@rac1 ~]# srvctl modify scan -n scan [root@rac1 ~]# srvctl start scan [root@rac1 ~]# srvctl start scan_listener

6,修改private ip

  • 两台节点备份profile.xml

    [grid@rac1 ~]$ cd /oracle/app/11.2.0/grid/gpnp/rac1/profiles/peer/ [grid@rac1 ~]$ cp -p profile.xml profile.xml.bak [grid@rac2 ~]$ cd /oracle/app/11.2.0/grid/gpnp/rac1/profiles/peer/ [grid@rac2 ~]$ cp -p profile.xml profile.xml.bak
  • 查看当前集群网卡接口信息

    [root@rac1 ~]# oifcfg getif ens33 192.168.10.0 global public ens34 10.0.0.0 global cluster_interconnect
  • 加入新的private ip

    [root@rac1 ~]# oifcfg setif -global ens34/172.0.0.0:cluster_interconnect [root@rac1 ~]# oifcfg getif ens33 192.168.10.0 global public ens34 10.0.0.0 global cluster_interconnect ens34 172.0.0.0 global cluster_interconnect
  • 两台节点关闭并禁用crs

    [root@rac1 ~]# crsctl stop crs [root@rac1 ~]# crsctl disable crs [root@rac2 ~]# crsctl stop crs [root@rac2 ~]# crsctl disable crs
  • 修改hosts文件

    #private ip 172.0.0.221 rac1-priv 172.0.0.222 rac2-priv
  • 修改ens34网卡配置

    [root@rac1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens34 ipaddr=172.0.0.221 gateway=172.0.0.254 [root@rac2 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens34 ipaddr=172.0.0.222 gateway=172.0.0.254
  • 重启网络服务

    虚拟机修改网卡“仅主机”网卡的网段为172.0.0.0后,重启网络服务 [root@rac1 ~]# systemctl restart network [root@rac2 ~]# systemctl restart network
  • 两台节点启动crs

    [root@rac1 ~]# crsctl enable crs [root@rac1 ~]# crsctl start crs [root@rac2 ~]# crsctl enable crs [root@rac2 ~]# crsctl start crs
  • 删除旧的private ip

    [root@rac1 ~]# oifcfg delif -global ens34/10.0.0.0

九、日常维护

  • 关闭crs软件自动启动

    [root@rac1 ~]# crsctl disable crs
  • sqlplus显示登陆的用户名和实例名

    [oracle@rac1:/home/oracle]$cd $oracle_home/sqlplus/admin [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/sqlplus/admin]$vi glogin.sql -- description set sqlprompt "_user'@'_connect_identifier>" [oracle@rac1:/oracle/app/oracle/product/11.2.0/db_1/sqlplus/admin]$sqlplus / as sysdba sys@orcl1>
  • 建库后执行sql

    alter profile default limit password_life_time unlimited;  create pfile='/tmp/db.ora' from spfile; alter system set "_ash_size"=25165824 scope=spfile; alter system set "_smu_debug_mode"=134217728 scope=spfile; alter system set "_gc_policy_time"=0 scope=spfile; alter system set "_px_use_large_pool"=true scope=spfile; alter system set "_memory_imm_mode_without_autosga"=false scope=spfile; alter system set "_undo_autotune"=false scope=spfile; alter system set "_use_adaptive_log_file_sync"=false scope=spfile; alter system set "_gc_undo_affinity"=false scope=spfile; alter system set "_serial_direct_read"=never scope=spfile sid='*'; alter system set db_files=1000 scope=spfile sid='*'; alter system set open_cursors=2000 sid='*'; alter system set session_cached_cursors=300 scope=spfile sid='*'; alter system set processes=2000 scope=spfile sid='*'; alter system set control_file_record_keep_time=60 scope=spfile sid='*'; alter system set resource_limit=true scope=spfile sid='*'; alter system set audit_trail=none scope=spfile sid='*'; alter system set undo_retention=10800 scope=spfile sid='*'; alter system set event='28401 trace name context forever,level 1','10949 trace name context forever,level 1' scope=spfile; alter system set sec_case_sensitive_logon=true sid='*'; alter system set pre_page_sga=false scope=spfile sid='*'; alter system set parallel_force_local=true scope=spfile sid='*'; alter system set result_cache_max_size=0 scope=spfile sid='*'; alter system set deferred_segment_creation=false scope=spfile sid='*'; alter system set fast_start_parallel_rollback=high scope=spfile sid='*'; alter system set parallel_execution_message_size=16384 scope=spfile sid='*'; alter system set parallel_max_servers=80 scope=spfile sid='*'; alter system set parallel_min_servers=0 scope=spfile sid='*';
  • 增加redo log

    查看当前redo log大小和数量,每个线程共2组,每组1个100m日志成员 sys@orcl1>set lines 200 sys@orcl1>col member for a120 sys@orcl1>select group#,thread#,bytes/1024/1024 m,status from v$log; group# thread# m status ---------- ---------- ---------- ---------------- 1 1 100 current 2 1 100 inactive 3 2 100 current 4 2 100 unused sys@orcl1>select group#,member from v$logfile order by 1,2; group# member ---------- ------------------------------------------ 1 data/orcl/onlinelog/group_1.261.1103016185 2 data/orcl/onlinelog/group_2.262.1103016185 3 data/orcl/onlinelog/group_3.265.1103016289 4 data/orcl/onlinelog/group_4.266.1103016289 现在为每个线程增加1个日志组,每组1个100m的redo log sys@orcl1>alter database add logfile thread 1 group 5 (' data') size 100m; sys@orcl1>alter database add logfile thread 2 group 6 (' data') size 100m; sys@orcl1>select group#,thread#,bytes/1024/1024 m,status from v$log; group# thread# m status ---------- ---------- ---------- ---------------- 1 1 100 current 2 1 100 inactive 3 2 100 current 4 2 100 unused 5 1 100 unused 6 2 100 unused 6 rows selected. sys@orcl1>select group#,member from v$logfile order by 1,2; group# member ---------- ---------------------------------------------- 1 data/orcl/onlinelog/group_1.261.1103016185 2 data/orcl/onlinelog/group_2.262.1103016185 3 data/orcl/onlinelog/group_3.265.1103016289 4 data/orcl/onlinelog/group_4.266.1103016289 5 data/orcl/onlinelog/group_5.268.1103017997 6 data/orcl/onlinelog/group_6.269.1103018015
  • 增加控制文件

    建库后默认只有1个控制文件 sys@orcl1>show parameter control name type value ------------------------------------ ----------- ------------------------------ control_file_record_keep_time integer 7 control_files string data/orcl/controlfile/current .260.1103016183 control_management_pack_access string diagnostic tuning 停止数据库 [oracle@rac1:/home/oracle]$srvctl stop instance -d orcl -i orcl1,orcl2 -o immediate [root@rac1 ~]# crsctl status res -t ora.orcl.db 1 offline offline instance shutdown 2 offline offline instance shutdown 启动数据库到nomount [oracle@rac1:/home/oracle]$srvctl start instance -d orcl -i orcl1,orcl2 -o nomount; [root@rac1 ~]# crsctl status res -t ora.orcl.db 1 online intermediate rac1 dismounted 2 online intermediate rac2 dismounted sys@orcl1>col host_name for a10 sys@orcl1>col instance_name for a10 sys@orcl1>select instance_name,host_name,status from gv$instance; instance_n host_name status ---------- ---------- ------------------------ orcl1 rac1 started orcl2 rac2 started [oracle@rac1:/home/oracle]$rman target / nocatalog rman> restore controlfile to ' data' from ' data/orcl/controlfile/current.260.1103016183'; 进入asmcmd查看恢复出来的控制文件名称 [grid@rac1:/home/grid]$asmcmd asmcmd> cd data/orcl/controlfile asmcmd> ls current.260.1103016183 current.270.1103021121 登陆数据库修改spfile增加控制文件路径 sys@orcl1>alter system set control_files=' data/orcl/controlfile/current.260.1103016183',' data/orcl/controlfile/current.270.1103021121' scope=spfile; 重启数据库之后查看控制文件数量 [oracle@rac1:/home/oracle]$srvctl stop instance -d orcl -i orcl1,orcl2 -o immediate [oracle@rac1:/home/oracle]$srvctl start instance -d orcl -i orcl1,orcl2 sys@orcl1>show parameter control name type value ------------------------------------ ----------- ------------------------------ control_file_record_keep_time integer 60 control_files string data/orcl/controlfile/current .260.1103016183, data/orcl/co ntrolfile/current.270.11030211 21 control_management_pack_access string diagnostic tuning
  • 配置归档

    配置归档路径为asm磁盘组 fra sys@orcl1>alter system set log_archive_dest_1='location= fra' scope=spfile sid='*'; [oracle@rac1:/home/oracle]$srvctl stop instance -d orcl -i orcl1,orcl2 -o immediate [oracle@rac1:/home/oracle]$srvctl start instance -d orcl -i orcl1,orcl2 -o mount; sys@orcl1>alter system switch logfile; sys@orcl1>alter system switch logfile; sys@orcl2>alter system switch logfile; sys@orcl2>alter system switch logfile; sys@orcl1>archive log list; database log mode archive mode automatic archival enabled archive destination fra oldest online log sequence 2 next log sequence to archive 4 current log sequence 4 sys@orcl2>archive log list; database log mode archive mode automatic archival enabled archive destination fra oldest online log sequence 3 next log sequence to archive 5 current log sequence 5 asmcmd> pwd fra/orcl/archivelog/2022_04_26 asmcmd> ls thread_1_seq_4.258.1103023263 thread_1_seq_5.259.1103023265 thread_1_seq_6.260.1103023267 thread_2_seq_2.256.1103023243 thread_2_seq_3.257.1103023261 thread_2_seq_4.261.1103023267
「喜欢文章,快来给作者赞赏墨值吧」
7人已赞赏
o
【米乐app官网下载的版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

网站地图