6)打补丁
6.1)补丁安装 创建目录 mkdir -p /u01/orasoft/orasoft scp C:\oracle\软件包\p6880880_190000_Linux-x86-64.zip root@192.168.1.63:/u01/app/oracle/product/19.0/db_1 scp C:\oracle\软件包\p6880880_190000_Linux-x86-64.zip root@192.168.1.52:/u01/app/oracle/product/19c/db_1 scp C:\oracle\软件包\p6880880_190000_Linux-x86-64.zip root@192.168.1.61:/u01/app/19c/grid/ scp C:\oracle\软件包\p6880880_190000_Linux-x86-64.zip root@192.168.1.52:/u01/app/19c/grid/ scp C:\oracle\软件包\p32545008_190000_Linux-x86-64.zip root@192.168.1.61:/u01/orasoft/orasoft scp C:\oracle\软件包\p32545008_190000_Linux-x86-64.zip root@192.168.1.63:/u01/orasoft/orasoft
节点1上和节点2 root用户 cd /u01/app/oracle/product/19.0/db_1 rm -rf OPatch unzip p6880880_190000_Linux-x86-64.zip chmod 775 -R OPatch
cd /u01/app/19c/grid/ rm -rf OPatch unzip p6880880_190000_Linux-x86-64.zip chmod 775 -R OPatch
cd /u01/orasoft/orasoft unzip p32545008_190000_Linux-x86-64.zip
chown -R grid:oinstall /u01/app/19c/grid/OPatch chown -R oracle:oinstall /u01/app/oracle/product/19.0/db_1/OPatch chown -R grid:oinstall /u01/orasoft chmod 777 -R /u01/orasoft chown -R oracle:oinstall /u01/orasoft 冲突检查 GI $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
GI
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/orasoft/32545008/32545013
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/orasoft/32545008/32579761
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/orasoft/32545008/32576499
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/orasoft/32545008/32584670
DB
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/orasoft/32545008/32545013
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/orasoft/32545008/32579761
6.2)检查空间是否足够 su - grid vi /tmp/patch_list_gihome.txt /u01/orasoft/32545008/32545013 /u01/orasoft/32545008/32579761 /u01/orasoft/32545008/32576499 /u01/orasoft/32545008/32584670 $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
su - oracle vi /tmp/patch_list_dbhome.txt /u01/orasoft/32545008/32545013 /u01/orasoft/32545008/32579761 $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
6.3)冲突分析 root用户 /u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008 -analyze
自动opatch root用户 export PATH=$PATH:/u01/app/19c/grid/OPatch opatchauto apply /u01/orasoft/32545008
6.4)创建补丁 root用户 /u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008
/u01/app/oracle/product/19c/db_1/OPatch/opatchauto apply /u01/orasoft/32545008/32545013 -oh /u01/app/oracle/product/19c/db_1
/u01/app/oracle/product/19c/db_1/OPatch/opatchauto apply /u01/orasoft/32545008/32579761 -oh /u01/app/oracle/product/19c/db_1
/u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008 -oh /u01/app/19c/grid/ ? /u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008 -oh /u01/app/19c/grid/ /u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008 -oh /u01/app/19c/grid/ /u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008 -oh /u01/app/19c/grid/
/u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008/32545013
chmod 660 /u01/app/oraInventory/ContentsXML/oui-patch.xml
6.5)将补丁中的sql文件加载到数据库中 oracle用户 sqlplus /nolog Connect / as sysdba; startup; alter pluggable database all open; quit;
cd $ORACLE_HOME/OPatch ./datapatch -verbose
cd $ORACLE_HOME/rdbms/admin sqlplus /nolog CONNECT / AS SYSDBA @utlrp.sql
col action_time format a30; col comments format a30; select action_time,action,version,comments,bundle_series from dba_registry_history;
[root@node2 ~]# /u01/app/19c/grid/OPatch/opatchauto apply /soft/29708769 -oh /u01/app/19c/grid
? /u01/app/19c/grid/OPatch/opatchauto apply /u01/orasoft/32545008 -oh /u01/app/19c/grid/
回退 /u01/app/19c/grid/OPatch/opatchauto rollback /u01/orasoft/32545008/32545013
安装后检查 [grid@rac01 OPatch]$ ./opatch lspatches 32585572;DBWLM RELEASE UPDATE 19.0.0.0.0 (32585572) 32584670;TOMCAT RELEASE UPDATE 19.0.0.0.0 (32584670) 32579761;OCW RELEASE UPDATE 19.11.0.0.0 (32579761) 32576499;ACFS RELEASE UPDATE 19.11.0.0.0 (32576499) 32545013;Database Release Update : 19.11.0.0.210420 (32545013)
打补丁的一般流程: 下载补丁并上传到服务器,使用不同的用户解压 停止应用和服务 生产环境一定要备份(停止数据库和集群/备份安装代码/备份数据库) 安装补丁工具opatch 在线打补丁(把数据库停止,但集群一定要打开) 停止数据库是因为担心数据库卡死. 验证补丁 启动应用,测试应用;
|