oracle11g升级PSU详细步骤

来源:互联网 发布:网络诈骗套路 编辑:程序博客网 时间:2024/04/30 20:58

1、关闭数据库

oracle的PSU升级不更新数据字典,风险较小,但是还是需要停库进行升级操作。

SQL> shutdown immediate

Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
suse11sp2:/oracle/product/11gR2/db/OPatch> lsnrctl stop


suse11sp2:/oracle/product/11gR2/db/OPatch>
suse11sp2:/oracle/product/11gR2/db/OPatch> ps aux | grep ora_
oracle    6922  0.0  0.0   5700   796 pts/3    S+   17:48   0:00 grep ora_
suse11sp2:/oracle/product/11gR2/db/OPatch> ps aux | grep tns
root        23  0.0  0.0      0     0 ?        S<   11:31   0:00 [netns]
oracle    6924  0.0  0.0   5704   796 pts/3    S+   17:48   0:00 grep tns

2、检查opatch版本信息,需要的话进行升级


suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch version
Invoking OPatch 11.2.0.1.7


OPatch Version: 11.2.0.1.7


OPatch succeeded.

suse11sp2:/oracle/product/11gR2/db/OPatch>

检查发现opatch版本较低,为默认版本,所以需要升级opatch。升级方法很简单,直接mv掉原来的opatch目录,然后解压最新版本的opatch软件到ORACLE_HOME下面即可



suse11sp2:/oracle/product/11gR2/db> unzip /oracle/soft/*64.zip  -d $ORACLE_HOME



再次检查版本,发现已经升级成功。
suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch version
OPatch Version: 11.2.0.3.4


OPatch succeeded.
suse11sp2:/oracle/product/11gR2/db/OPatch>





3、应用PSU补丁


1)插曲一、安装程序错误

suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch apply /oracle/product/11gR2/                                                                       db/16619892/
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.




Oracle Home       : /oracle/product/11gR2/db
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11gR2/db/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.3.0
Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22                                                                       _18-22-06PM_1.log


Verifying environment and performing prerequisite checks...
Prerequisite check "CheckPatchApplicableOnCurrentPlatform" failed.
The details are:
Patch ( 13343438 ) is not applicable on current platform.

Platform ID needed is : 226
Platform IDs supported by patch are: 209 211 Patch ( 13696216 ) is not applicabl                                                                       e on current platform.
Platform ID needed is : 226
Platform IDs supported by patch are: 209 Patch ( 13923374 ) is not applicable on                                                                        current platform.
Platform ID needed is : 226
Platform IDs supported by patch are: 209 Patch ( 14275605 ) is not applicable on                                                                        current platform.
Platform ID needed is : 226
Platform IDs supported by patch are: 209 Patch ( 14727310 ) is not applicable on                                                                        current platform.
Platform ID needed is : 226
Platform IDs supported by patch are: 209 Patch ( 16056266 ) is not applicable on                                                                        current platform.
Platform ID needed is : 226
Platform IDs supported by patch are: 209 Patch ( 16619892 ) is not applicable on                                                                        current platform.
Platform ID needed is : 226
Platform IDs supported by patch are: 209
UtilSession failed: Prerequisite check "CheckPatchApplicableOnCurrentPlatform" f                                                                       ailed.
Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_                                                                       18-22-06PM_1.log


OPatch failed with error code 73
suse11sp2:/oracle/product/11gR2/db/OPatch>


仔细查看,发现下载的软件压缩包是ibm system z系列的,应该是oracle网站打开得太慢,默认是这个版本,需要下拉菜单再次选择linux-x86-64对应的软件,结果我动作太快,出错了。




检查看看PSU应用的结果, 未成功:
suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch version
OPatch Version: 11.2.0.3.4


OPatch succeeded.
suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch lspatches
There are no Interim patches installed in this Oracle Home.



2)插曲二、error code 73

重新下载软件,再次重新应用PSU

suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch apply /oracle/soft/16619892/
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.




Oracle Home       : /oracle/product/11gR2/db
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11gR2/db/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.3.0
Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-40-42PM_1.log


Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:




Following executables are active :
/oracle/product/11gR2/db/lib/libclntsh.so.11.1
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-40-42PM_1.log


OPatch failed with error code 73




不使用自动模式,手工运行,一样报错:


suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch napply -oh $ORACLE_HOME -local /oracle/soft/16619892/
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.




Oracle Home       : /oracle/product/11gR2/db
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11gR2/db/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.3.0
Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-42-08PM_1.log


Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:




Following executables are active :
/oracle/product/11gR2/db/lib/libclntsh.so.11.1
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-42-08PM_1.log


OPatch failed with error code 73




上网goole,关键词为“ OPatch failed with error code 73”, 很快就查到解决办法,明确了其实就是因为有用户进程占用了文件libclntsh.so.11




suse11sp2:/oracle/soft>
suse11sp2:/oracle/soft>
suse11sp2:/oracle/soft> /sbin/fuser /oracle/product/11gR2/db/lib/libclntsh.so.11                                                                       .1
/oracle/product/11gR2/db/lib/libclntsh.so.11.1:  5473m
suse11sp2:/oracle/soft> ps -ef | grep 5473
oracle    5473  5399  0 14:45 pts/2    00:00:00 sqlplus   as sysdba
oracle    7780  6617  0 18:47 pts/3    00:00:00 grep 5473
suse11sp2:/oracle/soft> kill -9  5473
suse11sp2:/oracle/soft> /sbin/fuser /oracle/product/11gR2/db/lib/libclntsh.so.11                                                                       .1
suse11sp2:/oracle/soft>








3)再次重新应用PSU补丁,成功


suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch apply /oracle/soft/16619892/
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.




Oracle Home       : /oracle/product/11gR2/db
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11gR2/db/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.3.0
Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-49-54PM_1.log


Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   13343438  13696216  13923374  14275605  14727310  16056266  16619892


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 = '/oracle/product/11gR2/db')




Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '13343438' to OH '/oracle/product/11gR2/db'


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '13696216' to OH '/oracle/product/11gR2/db'


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.sysman.oms.core, 10.2.0.4.4...


Verifying the update...
Applying sub-patch '13923374' to OH '/oracle/product/11gR2/db'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.network.listener, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '14275605' to OH '/oracle/product/11gR2/db'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.network.client, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms.util, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '14727310' to OH '/oracle/product/11gR2/db'


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.sysman.oms.core, 10.2.0.4.4...


Verifying the update...
Applying sub-patch '16056266' to OH '/oracle/product/11gR2/db'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.network.listener, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.ovm, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.rdbms.deconfig, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '16619892' to OH '/oracle/product/11gR2/db'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.marvel, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sysman.agent, 10.2.0.4.3...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.sysman.repository.core, 10.2.0.4.4...


Patching component oracle.xdk, 11.2.0.3.0...


Patching component oracle.xdk.parser.java, 11.2.0.3.0...


Patching component oracle.xdk.rsf, 11.2.0.3.0...


Verifying the update...


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:
ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/oracle/product/11gR2/db/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'
/oracle/product/11gR2/db/precomp/lib/ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/oracle/product/11gR2/db/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'






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:
ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'
/oracle/product/11gR2/db/sysman/lib/ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
/oracle/product/11gR2/db/sysman/lib/ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'




Composite patch 16619892 successfully applied.
OPatch Session completed with warnings.
Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-49-54PM_1.log


OPatch completed with warnings.
suse11sp2:/oracle/soft>
最后只是显示有警告,无错误或严重错误,忽略之,继续检查。



4、检查应用之后的结果

suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch lspatches
16619892;Database Patch Set Update : 11.2.0.3.7 (16619892)
suse11sp2:/oracle/soft>




suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.




Oracle Home       : /oracle/product/11gR2/db
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/11gR2/db/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.3.0
Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-58-53PM_1.log


Lsinventory Output file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/lsinv/lsinventory2013-07-22_18-58-53PM.txt


--------------------------------------------------------------------------------
Installed Top-level Products (1):


Oracle Database 11g                                                  11.2.0.3.0
There are 1 products installed in this Oracle Home.




Interim patches (1) :


Patch  16619892     : applied on Mon Jul 22 18:54:52 CST 2013
Unique Patch ID:  16346737
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"
   Created on 23 Jun 2013, 09:03:20 hrs PST8PDT
Sub-patch  16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)"
Sub-patch  14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)"
Sub-patch  14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Sub-patch  13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch  13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch  13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
   Bugs fixed:
     13593999, 13566938, 10350832, 14138130, 12919564, 13561951, 13624984
     13588248, 13080778, 13914613, 13804294, 14258925, 12873183, 13645875
     14472647, 12880299, 14664355, 12998795, 14409183, 13719081, 14469008
     13492735, 14263036, 12857027, 13496884, 13015379, 14263073, 13742433
     13732226, 16314469, 16368108, 12905058, 6690853, 13742434, 12849688
     12950644, 13742435, 13464002, 13063120, 13534412, 12879027, 13958038
     14613900, 12585543, 13790109, 12535346, 16382448, 12588744, 11877623
     12395918, 13814739, 13786142, 12847466, 13649031, 13855490, 13981051
     12582664, 12797765, 14262913, 12923168, 16279401, 12912137, 13612575
     13384182, 13466801, 13484963, 14207163, 13724193, 13772618, 11063191
     16694777, 13070939, 12797420, 15869211, 13041324, 16279211, 16314467
     16314468, 12976376, 11708510, 13680405, 13742437, 13026410, 14589750
     13737746, 13742438, 14644185, 15841373, 13326736, 13596521, 14398795
     13579992, 13001379, 16344871, 13099577, 9873405, 13742436, 14275605
     9858539, 14841812, 11715084, 16231699, 14040433, 9703627, 12662040
     12617123, 16530565, 14207317, 12845115, 12764337, 13354082, 14459552
     13397104, 13913630, 12964067, 12983611, 13550185, 12780983, 13810393
     12583611, 14546575, 15862016, 13476583, 13489024, 11840910, 13903046
     15862017, 13572659, 16294378, 13718279, 14088346, 13657605, 13448206
     16314466, 14480676, 13419660, 13632717, 14668670, 14063281, 14110275
     13430938, 13467683, 13420224, 13812031, 14548763, 16299830, 12646784
     14512189, 12755116, 14035825, 13616375, 13427062, 12861463, 12834027
     15862021, 13632809, 13377816, 13036331, 14727310, 16619892, 13685544
     13499128, 15862018, 13584130, 16175381, 12829021, 15862019, 12794305
     14546673, 12791981, 13561750, 13503598, 13787482, 10133521, 12718090
     13848402, 13399435, 14023636, 9095696, 13860201, 12401111, 13257247
     13362079, 14176879, 12917230, 16014985, 13923374, 14220725, 13524899
     14480675, 16306019, 13559697, 12974860, 9706792, 12940620, 14480674
     13916709, 13098318, 14076523, 13773133, 15905421, 16794244, 13340388
     12731940, 13528551, 13366202, 12894807, 13343438, 13454210, 12748240
     14205448, 13385346, 14127231, 15853081, 14273397, 14467061, 12971775
     13923995, 14571027, 13582702, 13907462, 10242202, 13493847, 13857111
     13035804, 13544396, 16382353, 8547978, 14226599, 16794241, 14062795
     13035360, 12925089, 12693626, 13332439, 14038787, 11071989, 14062796
     16794243, 12913474, 14841409, 14390252, 16314470, 13370330, 13059165
     14062797, 14062794, 12959852, 12345082, 13358781, 12960925, 16703112
     9659614, 14546638, 13699124, 13936424, 14301592, 16794240, 13338048
     12938841, 12658411, 12620823, 12656535, 14062793, 12678920, 13038684
     14062792, 13807411, 16742095, 16794238, 15862022, 12594032, 13250244
     12612118, 9761357, 14053457, 13742464, 14052474, 13911821, 13457582
     7509451, 13527323, 13791364, 15862020, 13910420, 12780098, 13502183
     13696216, 13705338, 10263668, 14841558, 16794242, 15862023, 16056266
     16794239, 15862024, 13554409, 13645917, 13103913, 12772404, 13011409, 14063280






--------------------------------------------------------------------------------


OPatch succeeded.



suse11sp2:/oracle/soft>




suse11sp2:$ sqlplus / as sysdba
SQL> startup
SQL> show user
USER is "SYS"
SQL> @?/rdbms/admin/catbundle.sql psu apply
会生成一大堆屏幕输出,不管他。





执行一系列对sql环境变量的设置。然后查询下结果。
SQL>  set line 150
SQL>
SQL> col ACTION_TIME for a30
SQL> col ACTION for a8
SQL> col NAMESPACE for a8
SQL> col VERSION for a10
SQL> col BUNDLE_SERIES for a5
SQL> col COMMENTS for a20

SQL> select * from dba_registry_history;


ACTION_TIME                    ACTION   NAMESPAC VERSION            ID BUNDL COMMENTS
------------------------------ -------- -------- ---------- ---------- ----- --------------------
08-JUL-13 03.16.02.413948 PM   APPLY    SERVER   11.2.0.3            0 PSU   Patchset 11.2.0.2.0
22-JUL-13 07.01.42.999336 PM   APPLY    SERVER   11.2.0.3            7 PSU   PSU 11.2.0.3.7



2 rows selected.


本来以为20分钟就可以做完的操作,结果最后做了1个小时,脑瓜里再次响起来那句话:纸上得来终觉浅,绝知此事要躬行.



___________________________________________________________________________________

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Author:   laven54 (lurou)

Email:    laven54@163.com

Blog:      http://blog.csdn.net/laven54

QQ群: 164734649  可以到群里来提问,Oracle相关的问题我都很感兴趣



原创粉丝点击