Oracle Home : /u02/app/oracle/product/11.2.4/db1 Central Inventory : /u01/app/oraInventory from : /u02/app/oracle/product/11.2.4/db1/oraInst.loc OPatch version : 11.2.0.3.12 OUI version : 11.2.0.4.0 Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-45-47AM_1.log
-------------------------------------------------------------------------------- Local Machine Information:: Hostname: rhel6 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.
There are no Interim patches installed in this Oracle Home.
OPatch succeeded.4、升级前检查是否有冲突[oracle@rhel6 psu]$ cd 24006111/ [oracle@rhel6 24006111]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./ Oracle Interim Patch Installer version 11.2.0.3.12 Copyright (c) 2016, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u02/app/oracle/product/11.2.4/db1 Central Inventory : /u01/app/oraInventory from : /u02/app/oracle/product/11.2.4/db1/oraInst.loc OPatch version : 11.2.0.3.12 OUI version : 11.2.0.4.0 Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-49-53AM_1.log
OPatch succeeded.5、安装Patch包,单实例的数据库按如下方法打patch就可以了,如果是RAC则需要详细查看README.html[oracle@rhel6 psu]$ cd 24006111/ [oracle@rhel6 24006111]$ opatch apply Oracle Interim Patch Installer version 11.2.0.3.12 Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /u02/app/oracle/product/11.2.4/db1 Central Inventory : /u01/app/oraInventory from : /u02/app/oracle/product/11.2.4/db1/oraInst.loc OPatch version : 11.2.0.3.12 OUI version : 11.2.0.4.0 Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-53-13AM_1.log
Verifying environment and performing prerequisite checks... Prerequisite check "CheckActiveFilesAndExecutables" failed. The details are:
Following executables are active : /u02/app/oracle/product/11.2.4/db1/bin/oracle /u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1 UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed. Log file location: /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-53-13AM_1.log
OPatch failed with error code 73 #打补丁报错,查看日志 [oracle@rhel6 24006111]$ more /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-53-13AM_1.log ...... [Dec 20, 2016 10:53:21 AM] Following executables are active : /u02/app/oracle/product/11.2.4/db1/bin/oracle /u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1 [Dec 20, 2016 10:53:21 AM] Prerequisite check "CheckActiveFilesAndExecutables" failed. The details are:
Following executables are active : /u02/app/oracle/product/11.2.4/db1/bin/oracle /u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1 ...... #这个错误的意思是检测到有命令正在运行,不能进行升级,停止数据库和监听 [oracle@rhel6 24006111]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 10:57:16 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
sys@ORCL>shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. sys@ORCL>exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@rhel6 24006111]$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-DEC-2016 10:58:32
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) The command completed successfully [oracle@rhel6 24006111]$ ps -ef |grep ora root 2361 2342 0 10:11 pts/0 00:00:00 su - oracle oracle 2362 2361 0 10:11 pts/0 00:00:01 -bash oracle 3409 2362 0 10:59 pts/0 00:00:00 ps -ef oracle 3410 2362 0 10:59 pts/0 00:00:00 grep ora #重新打补丁 [oracle@rhel6 24006111]$ opatch apply Oracle Interim Patch Installer version 11.2.0.3.12 Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /u02/app/oracle/product/11.2.4/db1 Central Inventory : /u01/app/oraInventory from : /u02/app/oracle/product/11.2.4/db1/oraInst.loc OPatch version : 11.2.0.3.12 OUI version : 11.2.0.4.0 Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_11-18-32AM_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
Do you want to proceed? [y|n] y User Responded with: Y
All checks passed. Provide your email address to be informed of security issues, install and initiate Oracle Configuration Manager. Easier for you if you use your My Oracle Support Email address/User Name. Visit http://www.oracle.com/support/policies.html for details. Email address/User Name: You have not provided an email address for notification of security issues. Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = "/u02/app/oracle/product/11.2.4/db1")
Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files... Applying sub-patch "17478514" to OH "/u02/app/oracle/product/11.2.4/db1" ...... Composite patch 24006111 successfully applied. Log file location: /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_11-18-32AM_1.log
OPatch succeeded.6、升级数据字典并重新编译无效对象[oracle@rhel6 24006111]$ sqlplus / as sysdba idle>startup ...... idle>@?/rdbms/admin/catbundle.sql psu apply ....... idle>SPOOL off idle>SET echo off Check the following log file for errors: /u02/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ORCL_APPLY_2016Dec20_11_30_47.log #检查??志没有报错 #编译失效对象 sys@ORCL>@?/rdbms/admin/utlrp.sql #检查升级情况 sys@ORCL>col action_time for a30 sys@ORCL>col action for a10 sys@ORCL>col namespace for a20 sys@ORCL>col version for a20 sys@ORCL>col bundle_series for a30 sys@ORCL>col comments for a30 sys@ORCL>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 11.2.0.2.0 07-JUL-16 11.03.29.165250 AM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0 20-DEC-16 11.32.28.671654 AM APPLY SERVER 11.2.0.4 161018 PSU PSU 11.2.0.4.161018 #使用opatch命令查看补丁情况 [oracle@rhel6 24006111]$ opatch lsinventory Oracle Interim Patch Installer version 11.2.0.3.12 Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /u02/app/oracle/product/11.2.4/db1 Central Inventory : /u01/app/oraInventory from : /u02/app/oracle/product/11.2.4/db1/oraInst.loc OPatch version : 11.2.0.3.12 OUI version : 11.2.0.4.0 Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_11-52-01AM_1.log
-------------------------------------------------------------------------------- Local Machine Information:: Hostname: rhel6 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.