安装Oracle11g最新补丁


1、根据readme要求,升级OPatch
oracle@costdb:/oracle/11.2.0.4/OPatch$ ./opatch version --查看当前版本
OPatch Version: 11.2.0.3.4

cd /arch/ora11g
unzip p6880880_112000_Linux-x86-64-11.2.0.3.27.zip -d $ORACLE_HOME

oracle@costdb:/oracle/11.2.0.4/OPatch$ ./opatch version --查看已经升级后的版本
OPatch Version: 11.2.0.3.27


2、停DB,停监听;打最新PSU补丁31537677:
cd /oracle
unzip p31537677_112040_Linux-x86-64.zip
cd 31537677

oracle@costdb:/oracle/31537677$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2022, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /oracle/11.2.0.4
Central Inventory : /oraInventory
from : /oracle/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /oracle/11.2.0.4/cfgtoollogs/opatch/opatch2022-05-31_04-38-30AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.

验证通过后,打补丁:
opatch apply
输入2次 y 确认;

oracle@costdb:/oracle/31537677$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2022, Oracle Corporation. All rights reserved.

Oracle Home : /oracle/11.2.0.4
Central Inventory : /oraInventory
from : /oracle/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /oracle/11.2.0.4/cfgtoollogs/opatch/opatch2022-05-31_04-39-48AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 17478514 18031668 18522509 19121551 19769489 20299013 20760982 21352635 21948347 22502456 23054359 24006111 24732075 25869727 26609445 26392168 26925576 27338049 27734982 28204707 28729262 29141056 29497421 29913194 30298532 30670774 31103343 31537677

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/11.2.0.4')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/oracle/11.2.0.4'
...........
Patching component oracle.buildtools.rsf, 11.2.0.4.0...

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
/usr/bin/ld: warning: -z lazyload ignored.
/usr/bin/ld: warning: -z nolazyload ignored.

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
/usr/bin/ld: warning: -z lazyload ignored.
/usr/bin/ld: warning: -z nolazyload ignored.

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
/usr/bin/ld: warning: -z lazyload ignored.
/usr/bin/ld: warning: -z nolazyload ignored.

  • dir2=/oracle/11.2.0.4/sysman/lib/
  • '[' '' '!=' '' ']'
  • make -f /oracle/11.2.0.4/sysman/lib/ins_emagent.mk new_ld_shlib _FULL_LIBNAME=/oracle/11.2.0.4/sysman/lib/libnmcfsga.so _LIBNAME=libnmcfsga _LIBDIR=/oracle/11.2.0.4/sysman/lib/ '_LIBNAME_LIBS=$(libnmcfsgaLIBS)' '_LIBNAME_EXTRALIBS=$(libnmcfsgaEXTRALIBS)'
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.
    /usr/bin/ld: warning: -z lazyload ignored.
    /usr/bin/ld: warning: -z nolazyload ignored.

Composite patch 31537677 successfully applied.
OPatch Session completed with warnings.
Log file location: /oracle/11.2.0.4/cfgtoollogs/opatch/opatch2022-05-31_04-39-48AM_1.log

OPatch completed with warnings.

打补丁有告警,不影响;

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply ----将修改后的SQL文件加载到数据库中;Oracle用户更新数据库字典表信息

SQL>@utlrp.sql ----编译无效对象


打补丁报错:
Following active executables are not used by opatch process :
/oracle/11.2.0.4/lib/libsqlplus.so

Following active executables are used by opatch process :

UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /oracle/11.2.0.4/cfgtoollogs/opatch/opatch2020-07-17_14-24-35PM_1.log

OPatch failed with error code 73

oracle@costdb:/oracle/28204707$ ps -ef | grep oracle
oracle 10637 13046 0 10:09 pts/1 00:00:00 sqlplus as sysdba
root 13045 12990 0 Jul16 pts/1 00:00:00 su - oracle
oracle 13886 13885 0 Jul16 pts/4 00:00:00 -bash
oracle 13949 13762 0 Jul16 pts/2 00:00:00 sqlplus as sysdba
oracle 13952 13824 0 Jul16 pts/3 00:00:00 sqlplus as sysdba
oracle 13955 13886 0 Jul16 pts/4 00:00:00 sqlplus as sysdba
root 25658 25459 0 14:21 pts/5 00:00:00 su - oracle
oracle 27302 25663 0 14:30 pts/5 00:00:00 ps -ef

检查DB,监听都停了,但是有之前连接的进程未退;退出后,执行补丁正常;


然后打OJVM补丁:31668908

停DB;监听还没有起;
cd /oracle
unzip p31668908_112040_Linux-x86-64.zip
cd 31668908

oracle@costdb:/oracle/31668908$ opatch apply

Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2022, Oracle Corporation. All rights reserved.

Oracle Home : /oracle/11.2.0.4
Central Inventory : /oraInventory
from : /oracle/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /oracle/11.2.0.4/cfgtoollogs/opatch/opatch2022-05-31_04-53-48AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 31668908

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/11.2.0.4')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '31668908' to OH '/oracle/11.2.0.4'
ApplySession: Optional component(s) [ oracle.sqlj, 11.2.0.4.0 ] , [ oracle.sqlj.companion, 11.2.0.4.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.javavm.server, 11.2.0.4.0...
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.javavm.client, 11.2.0.4.0...
Patching component oracle.dbjava.jdbc, 11.2.0.4.0...
Patching component oracle.dbjava.ic, 11.2.0.4.0...
Patch 31668908 successfully applied.
Log file location: /oracle/11.2.0.4/cfgtoollogs/opatch/opatch2022-05-31_04-53-48AM_1.log

OPatch succeeded.

OJVM补丁完成;

cd $ORACLE_HOME/sqlpatch/31668908
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> startup upgrade
SQL> @postinstall.sql ----在end / 处,时间略长
SQL> shutdown
SQL> startup
SQL> exit

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

opatch lsinv
可以看到ojvm补丁和psu补丁;
补丁完成

posted @ 2026-07-26 12:30  秋之枫叶  阅读(3)  评论(0)    收藏  举报