ORACLE PSU升级总结

首先,进行PSU,首要的事情就是认真的看readme.html,从里面我们可以知道很详细的升级步骤已经回退的方案。并且避免了很多的坑
在进行PSU之前,要首先确认你准备升级的版本以及你自己系统数据库的版本,就像我们这次,是从11.2.0.4.0升级到11.2.0.4.2版本,从MOS上去找到相应的PATCH
p18031668_112040_Linux-x86-64.zip

可以通过p后面的数字在mos上面很容易的查到该补丁包,从该版本的补丁包的readme.html 中。我们可以看到这样要求

2.1 OPatch Utility
You must use the OPatch utility version 11.2.0.3.6 or later to apply this patch. Oracle recommends that you use the latest released OPatch version for 11.2, which is available for download from My Oracle Support patch 6880880 by selecting the 11.2.0.0.0 release.

由于我们是用的系统盘直接装的,默认的版本是这个:


[sql]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. [oracle@storedb OPatch]$ ./opatch version  
  2. OPatch Version: 11.2.0.3.4  

版本是11.2.0.3.4 够不到PATCH的最低的安装版本,所以我们需要一个另外的PATCH来更新opatch的版本
Oracle 提供了这样的一个补丁包
p6880880_112000_Linux-x86-64.zip
用来把OPATCH提成到最新的版本
具体的单独升级ORACLE PSU的步骤:



[sql]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. 1.把Opatch的环境变量配置  
  2. export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH  
  3. 2.查看数据库的版本  
  4. opatch version  
  5. [oracle@<span style="font-family: Arial, Helvetica, sans-serif;">storedb OPatch]$ opatch version  
  6. OPatch Version: 11.2.0.3.4  
  7. OPatch succeeded.  
  8. opatch lsinventory  
  9. [oracle@kadora4 OPatch]$ opatch lsinventory  
  10. Oracle Interim Patch Installer version 11.2.0.3.4  
  11. Copyright (c) 2012, Oracle Corporation.  All rights reserved.  
  12. Oracle Home       : /opt/app/oracle/product/11.2.0/db_1  
  13. Central Inventory : /opt/oraInventory  
  14.    from           : /opt/app/oracle/product/11.2.0/db_1/oraInst.loc  
  15. OPatch version    : 11.2.0.3.4  
  16. OUI version       : 11.2.0.4.0  
  17. Log file location : /opt/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-07-07_10-44-39AM_1.log  
  18. Lsinventory Output file location : /opt/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-07-07_10-44-39AM.txt  
  19. --------------------------------------------------------------------------------  
  20. Installed Top-level Products (1):  
  21. Oracle Database 11g                                                  11.2.0.4.0  
  22. There are 1 products installed in this Oracle Home.  
  23. There are no Interim patches installed in this Oracle Home.  
  24. --------------------------------------------------------------------------------  
  25. 3.更新补丁工具包  
  26. cd $ORACLE_HOME/  
  27. mv OPatch OPath_bak  
  28. unzip p6880880_112000_LINUX.zip  
  29. cd OPatch  
  30. [oracle@racdb1 db_1]$ cd OPatch  
  31. [oracle@racdb1 OPatch]$ ls  
  32. crs  docs  emdpatch.pl  jlib  ocm  opatch  opatch.bat  opatchdiag  opatchdiag.bat  opatch.ini  opatch.pl  opatchprereqs  oplan  README.txt  version.txt  
  33. [oracle@racdb1 OPatch]$  
  34. [oracle@racdb1 OPatch]$ opatch version  
  35. OPatch Version: 11.2.0.3.6  
  36. OPatch succeeded.  
  37. 4.检查你需要打的补丁是否与现有的补丁有冲突  
  38. unzip p18031668_112040_Linux-x86-64.zip  
  39. cd 18031668  
  40. [oracle@racdb1 18031668]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./  
  41. Oracle Interim Patch Installer version 11.2.0.3.6  
  42. Copyright (c) 2013, Oracle Corporation.  All rights reserved.  
  43. PREREQ session  
  44. Oracle Home       : /u01/app/oracle/product/11.2.0/db_1  
  45. Central Inventory : /u01/app/oraInventory  
  46.    from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc  
  47. OPatch version    : 11.2.0.3.6  
  48. OUI version       : 11.2.0.4.0  
  49. Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-07-09_01-59-50AM_1.log  
  50. Invoking prereq "checkconflictagainstohwithdetail"  
  51. Prereq "checkConflictAgainstOHWithDetail" passed.  
  52. OPatch succeeded.  
  53. 5.关闭数据库并更新最新的补丁  
  54. sqlplus / as sysdba  
  55. shutdown immediate  
  56. cd 18031668  
  57. opatch apply  
  58. opatch apply  
  59. Oracle Interim Patch Installer version 11.2.0.3.6  
  60. Copyright (c) 2013, Oracle Corporation.  All rights reserved.  
  61.    
  62. Oracle Home       : /u01/app/oracle/product/11.2/db_1  
  63. Central Inventory : /u01/app/oraInventory  
  64.    from           : /u01/app/oracle/product/11.2/db_1/oraInst.loc  
  65. OPatch version    : 11.2.0.3.6  
  66. OUI version       : 11.2.0.4.0  
  67. Log file location : /u01/app/oracle/product/11.2/db_1/cfgtoollogs/opatch/17478514_Apr_02_2014_15_38_28/apply2014-04-02_15-38-28PM_1.log  
  68.    
  69.    
  70. You have not provided an email address for notification of security issues.  
  71. Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y  
  72.    
  73. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.  
  74. (Oracle Home = '/u01/app/oracle/product/11.2/db_1')  
  75.    
  76. Is the local system ready for patching? [y|n]  
  77. y  
  78. User Responded with: Y  
  79. Backing up files...  
  80.    
  81.    
  82. Patching component oracle.nlsrtl.rsf, 11.2.0.4.0...  
  83.    
  84. Patching component oracle.xdk.rsf, 11.2.0.4.0...  
  85.    
  86. Patching component oracle.rdbms.rman, 11.2.0.4.0...  
  87.    
  88. OPatch found the word "warning" in the stderr of the make command.  
  89. Please look at this stderr. You can re-run this make command.  
  90. Stderr output:  
  91. ins_emagent.mk:113: warning: overriding commands for target `nmosudo'  
  92. ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'  
  93. /u01/app/oracle/product/11.2/db_1/sysman/lib/ins_emagent.mk:113: warning: overriding commands for target `nmosudo'  
  94. /u01/app/oracle/product/11.2/db_1/sysman/lib/ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'  
  95.    
  96. Verifying the update...  
  97. Patch 17478514 successfully applied  
  98. OPatch Session completed with warnings.  
  99. Log file location: /u01/app/oracle/product/11.2/db_1/cfgtoollogs/opatch/17478514_Apr_02_2014_15_38_28/apply2014-04-02_15-38-28PM_1.log  
  100.    
  101. OPatch completed with warnings.  
  102. 6.查看补丁:  
  103. opatch lsinventory  
  104. oracle@racdb1 OPatch]$   opatch lsinventory  
  105. Oracle Interim Patch Installer version 11.2.0.3.6  
  106. Copyright (c) 2013, Oracle Corporation.  All rights reserved.  
  107. Oracle Home       : /u01/app/oracle/product/11.2.0/db_1  
  108. Central Inventory : /u01/app/oraInventory  
  109.    from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc  
  110. OPatch version    : 11.2.0.3.6  
  111. OUI version       : 11.2.0.4.0  
  112. Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-07-09_02-10-23AM_1.log  
  113. Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-07-09_02-10-23AM.txt  
  114. --------------------------------------------------------------------------------  
  115. Installed Top-level Products (1):  
  116. Oracle Database 11g                                                  11.2.0.4.0  
  117. There are 1 product(s) installed in this Oracle Home.  
  118. Interim patches (1) :  
  119. Patch  18031668     : applied on Wed Jul 09 00:16:43 EDT 2014  
  120. Unique Patch ID:  17255543  
  121. Patch description:  "Database Patch Set Update : 11.2.0.4.2 (18031668)"  
  122.    Created on 20 Feb 2014, 05:15:58 hrs PST8PDT  
  123. Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"  
  124.    Bugs fixed:  
  125.      17288409, 16399083, 17205719, 17811429, 10136473, 16472716, 17614227  
  126.      17050888, 17040764, 17865671, 17325413, 14010183, 17726838, 13364795  
  127.      17389192, 17612828, 17080436, 16613964, 17284817, 17441661, 17761775  
  128.      17721717, 16721594, 17390431, 18203837, 17551709, 17344412, 16043574  
  129.      17446237, 16863422, 18139690, 17071721, 17501491, 17610798, 17239687  
  130.      17752121, 17468141, 17602269, 18203835, 17375354, 17313525, 17811456  
  131.      16731148, 14133975, 18203838, 16956380, 17385178, 17235750, 13866822  
  132.      17394950, 17478514, 17027426, 12905058, 14338435, 16450169, 13944971  
  133.      18094246, 16929165, 16785708, 17265217, 17465741, 16220077, 16180763  
  134.      16069901, 17546973, 16285691, 17323222, 18180390, 17088068, 16875449  
  135.      17016369, 17443671, 16228604, 17811438, 17811447, 16837842, 18031668  
  136.      16912439, 17332800, 17393683, 17622427, 17545847, 17186905, 16943711  
  137.      16850630, 17082359, 17346671, 14852021, 17783588, 17437634, 16618694  
  138.      17341326, 17296856, 17546761, 17716305  
  139. --------------------------------------------------------------------------------  
  140. 7.执行catbundle.sql将补丁信息反射到数据库中,使数据库知道你最后一次打了什么补丁或者回滚了哪些补丁:  
  141. SQL> @?/rdbms/admin/catbundle.sql psu apply  
  142. SQL> Rem  
  143. SQL>  
  144. SQL> SET TERMOUT on  
  145. SQL> SET ECHO off  
  146. PL/SQL procedure successfully completed.  
  147. PL/SQL procedure successfully completed.  
  148. PL/SQL procedure successfully completed.  
  149. 1 row selected.  
  150. 1 row selected.  
  151. Generating apply and rollback scripts...  
  152. Check the following file for errors:  
  153. /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_FTDB_GENERATE_2014Apr02_17_20_18.log  
  154. Apply script: /u01/app/oracle/product/11.2/db_1/rdbms/admin/catbundle_PSU_FTDB_APPLY.sql  
  155. Rollback script: /u01/app/oracle/product/11.2/db_1/rdbms/admin/catbundle_PSU_FTDB_ROLLBACK.sql  
  156.    
  157. PL/SQL procedure successfully completed.  
  158.    
  159. Executing script file...  
  160.    
  161. 1 row selected.  
  162.    
  163. SQL> COLUMN spool_file NEW_VALUE spool_file NOPRINT  
  164. SQL> SELECT '/u01/app/oracle/cfgtoollogs/catbundle/' || 'catbundle_PSU_' || name || '_APPLY_' || TO_CHAR(SYSDATE, 'YYYYMonDD_hh24_mi_ss''NLS_DATE_LANGUAGE=''AMERICAN''') || '.log' AS spool_file FROM v$database;  
  165.    
  166. 1 row selected.  
  167.    
  168. SQL> SPOOL &spool_file  
  169. SQL> exec dbms_registry.set_session_namespace('SERVER')  
  170.    
  171. PL/SQL procedure successfully completed.  
  172.    
  173. SQL> PROMPT Skipping Spatial because it is not installed or versions mismatch...  
  174. Skipping Spatial because it is not installed or versions mismatch...  
  175. SQL> ALTER SESSION SET current_schema = SYS;  
  176.    
  177. Session altered.  
  178.    
  179. SQL> PROMPT Updating registry...  
  180. Updating registry...  
  181. SQL> INSERT INTO registry$history  
  182.   2    (action_time, action,  
  183.   3     namespace, version, id,  
  184.   4     bundle_series, comments)  
  185.   5  VALUES  
  186.   6    (SYSTIMESTAMP, 'APPLY',  
  187.   7     SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'),  
  188.   8     '11.2.0.4',  
  189.   9     1,  
  190.  10     'PSU',  
  191.  11     'PSU 11.2.0.4.1');  
  192. 1 row created.  
  193. SQL> COMMIT;  
  194. Commit complete.  
  195. SQL> SPOOL off  
  196. SQL> SET echo off  
  197. Check the following log file for errors:  

这个是手动升级db的方法,对于有grid结构的数据库,我们可以通过OPATCH AUTO的方式来进行数据库的自动升级



[sql]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. 1,更新gird和oracle用户的Opatch文件  
  2. unzip p6880880_112000_Linux-x86-64.zip -d /oracle/11.2.0/grid  
  3. unzip p6880880_112000_Linux-x86-64.zip -d /oracle/app/oracle/product/11.2.0/db_1  
  4.   
  5. 2.生成响应文件  
  6. cd /oracle/11.2.0/grid/OPatch/ocm/bin  
  7. ./emocmrsp  
  8.   
  9. 3,自动打补丁,打补丁的时候grid会自动重启  
  10. 数据库启动状态 su -root  
  11. /oracle/11.2.0/grid/OPatch/opatch auto /oracle/media/psu -ocmrf /oracle/11.2.0/grid/OPatch/ocm/bin/ocm.rsp  
  12.   
  13. 此步操作我们需要注意几个问题  
  14. (1) 补丁集的属组需要为oracle:oinstall  
  15. (2) 我们需要断开一切的数据库的连接,不然的话在进行升级的时候会报错  
  16. optach auto的过程中我们是看不到具体的错误内容的  
  17. 它的安装日志在/u01/app/11.2.0/grid/cfgtoollogs这个文件夹下来,如果遇到错误,我们可以看到详细的错误日志,从而分析出错误的原因  
  18. (3) 进行opatch auto的时候我们需要关闭掉数据库,grid可以不用关闭,在升级的时候会自动的进行关闭  
  19.   
  20. 4. 安装完成进行验证  

[sql]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. col action format a6                  
  2. col namespace format a10              
  3. col version format a10                
  4. col comments format a15               
  5. col action_time format a30            
  6. col bundle_series format a15          
  7. select * from dba_registry_history;   
  8.   
  9. opatch lsinventory  

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25462274/viewspace-2125134/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25462274/viewspace-2125134/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值