ORACLE10.2.0.5.7补丁安装
最近一个客户发邮件说负责维护数据库的第三方公司,为解决SCN headroom BUG,为数据库打补丁时遇到很多问题,熬了几个通宵才将HP UNIX环境的数据库搞定搞定,而他们也需要要为AIX环境打相应的补丁,由于没有AIX环境,我在LINUX环境上做了相关补丁的安装测试,并为发现问题,试验环境如下:
操作系统:OEL5.7 X86_64
数据库:ORACLE 10.2.0.5.0
Opatch版本要求:10.2.0.5.0
PATCH号:13343471(10.2.0.5.6)、13632743(10.2.0.5.7)、13916709(10.2.0.5.7单独补丁)
实验步骤如下:
1.更新Opatch
由于安装13343471(10.2.0.5.6)PSU需要Opatch版本不低于10.2.0.5.0,而当前Opatch版本为10.2.0.4.9,需要更新下Opatch。(以下是readme.html相关提示)
2.1 OPatch Utility You must use the OPatch 10.2 version 10.2.0.5.0 or later to apply this patch. Oracle recommends that you use the latest released OPatch 10.2, which is available for download from My Oracle Support patch 6880880 by selecting the 10.2.0.0.0 release.
更新Opatch很简单,只需要将新的Opatch解压到原来的Opatch路径就可以,Opatch路径为$ORACLE_HOME/OPatch
更新完Opatch之后就可以安装13343471(10.2.0.5.6)PSU了。
2.关闭数据库
3.安装13343471(10.2.0.5.6)PSU
由于客户的数据库版本是10.2.0.5.6,首先先安装13343471(10.2.0.5.6)PSU。安装PSU也很简单,PSU带的redeme.html会有详细的安装指导,进入PSU的解压后的文件夹(我解压的路径是$ORACLE_HOME/OPatch)。
[oracle@10205 13343471]$ ../opatch apply Invoking OPatch 10.2.0.5.1 Oracle Interim Patch Installer version 10.2.0.5.1 Copyright (c) 2010, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/10.2.0/db_1 Central Inventory : /u01/app/oracle/oraInventory from : /etc/oraInst.loc OPatch version : 10.2.0.5.1 OUI version : 10.2.0.5.0 OUI location : /u01/app/oracle/product/10.2.0/db_1/oui Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2012-11-15_16-48-44PM.log Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt ApplySession applying interim patch '13343471' to OH '/u01/app/oracle/product/10.2.0/db_1' Running prerequisite checks... Patch 13343471: Optional component(s) missing : [ oracle.rdbms.dv, 10.2.0.5.0 ] , [ oracle.rdbms.dv.oc4j, 10.2.0.5.0 ] , [ oracle.network.cman, 10.2.0.5.0 ] 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]: 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 OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1') ... ...(省略)
如果在屏幕显示的日志结尾看到以下信息,说明PUS成功安装。
ApplySession adding interim patch '13343471' to inventory Verifying the update... Inventory check OK: Patch ID 13343471 is registered in Oracle Home inventory with proper meta-data. Files check OK: Files from Patch ID 13343471 are present in Oracle Home. The local system has been patched and can be restarted. OPatch succeeded.
4.打开数据库,执行脚本
此时可以启动数据库,但是还需要运行2个脚本,这在PSU自带的readme.html文件里也有提示。(以下是readme.html相关提示)
3.3.2 Loading Modified SQL Files into the Database The following steps load modified SQL files into the database. For a RAC environment, perform these steps on only one node. 1.For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows: cd $ORACLE_HOME/rdbms/admin sqlplus /nolog SQL> CONNECT / AS SYSDBA SQL> STARTUP SQL> @catbundle.sql psu apply SQL> -- Execute the next statement only if this is the first PSU applied for 10.2.0.5 or this is the first PSU applied since 10.2.0.5.3. SQL> @utlrp.sql SQL> QUIT For information about the catbundle.sql script, see My Oracle Support Note 605795.1 Introduction to Oracle Database catbundle.sql.
按照要求,打开数据库
[oracle@10205 13343471]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 15 16:53:51 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 390070272 bytes Fixed Size 2096504 bytes Variable Size 159384200 bytes Database Buffers 222298112 bytes Redo Buffers 6291456 bytes Database mounted. Database opened.
运行需要的脚本
SQL> @?/rdbms/admin/catbundle.sql psu apply SQL> @?/rdbms/admin/utlrp.sql
此时在数据库内已经可以查询到PUS的信息。
SQL> select ACTION_TIME,ACTION,VERSION,ID,BUNDLE_SERIES,COMMENTS from DBA_REGISTRY_HISTORY; ACTION_TIME ACTION VERSION ID BUN COMMENTS ----------------------------- -------------- ---------- ------- --- ----------------- 15-NOV-12 02.52.43.581095 PM VIEW RECOMPILE 8289601 view recompilation 15-NOV-12 02.52.43.646084 PM UPGRADE 10.2.0.5.0 Upgraded from 10.2.0.1.0 15-NOV-12 04.54.57.533392 PM APPLY 10.2.0.5 6 PSU PSU 10.2.0.5.6
5.安装PSU 13632743
现在环境基本和客户一样,接下来需要安装PSU 13632743(10.2.0.5.7),安装这个PSU后,数据库版本将变更为10.2.0.5.7。
这就是客户说难搞的PSU,安装过程和上文一样,在我安装时并为遇到问题。
SQL> SHUTDOWN IMMEDIATE Database closed. Database dismounted. ORACLE instance shut down. [oracle@10205 ~]$ ls Desktop p13632743_10205_Linux-x86-64.zip p13916709_102057_Linux-x86-64.zip [oracle@10205 ~]$ unzip p13632743_10205_Linux-x86-64.zip [oracle@10205 ~]$ cp -R 13632743/ /u01/app/oracle/product/10.2.0/db_1/OPatch [oracle@10205 ~]$ cd /u01/app/oracle/product/10.2.0/db_1/OPatch/13632743 [oracle@10205 OPatch]$ ./opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./13632743 [oracle@10205 13632743]$ ../opatch apply
以下是部分日志内容:
ApplySession adding interim patch '13632743' to inventory Verifying the update... Inventory check OK: Patch ID 13632743 is registered in Oracle Home inventory with proper meta-data. Files check OK: Files from Patch ID 13632743 are present in Oracle Home. The local system has been patched and can be restarted. -------------------------------------------------------------------------------- The following warnings have occurred during OPatch execution: 1) OUI-67620:Interim patch 13632743 is a superset of the patch(es) [ 13343471 ] in the Oracle Home -------------------------------------------------------------------------------- OPatch Session completed with warnings. OPatch completed with warnings.
PSU 13343471(10.2.0.5.6)和13632743(10.2.0.5.7)都是全量补丁,13632743是13343471的超集。
6.打开数据库,运行需要的脚本
[oracle@10205 13632743]$ sqlplus / as sysdba SQL> startup SQL> @?/rdbms/admin/catbundle.sql psu apply SQL> @?/rdbms/admin/utlrp.sql
7.查询PUS信息
SQL> select ACTION_TIME,ACTION,VERSION,ID,BUNDLE_SERIES,COMMENTS from DBA_REGISTRY_HISTORY; ACTION_TIME ACTION VERSION ID BUN COMMENTS ----------------------------- ---------- ---------- ------- --- ----------------- 15-NOV-12 02.52.43.581095 PM VIEW RECOMPILE 8289601 view recompilation 15-NOV-12 02.52.43.646084 PM UPGRADE 10.2.0.5.0 Upgraded from 10.2.0.1.0 15-NOV-12 04.54.57.533392 PM APPLY 10.2.0.5 6 PSU PSU 10.2.0.5.6 15-NOV-12 05.19.57.207585 PM APPLY 10.2.0.5 7 PSU PSU 10.2.0.5.7
8.安装Patch 13916709
SQL> SHUTDOWN IMMEDIATE Database closed. Database dismounted. ORACLE instance shut down. [oracle@10205 ~]$ unzip p13916709_102057_Linux-x86-64.zip [oracle@10205 ~]$ cp -R 13916709/ /u01/app/oracle/product/10.2.0/db_1/OPatch [oracle@10205 ~]$ cd /u01/app/oracle/product/10.2.0/db_1/OPatch/13916709 [oracle@10205 13916709]$ ../opatch apply
以下是补丁安装成功信息:
ApplySession adding interim patch '13916709' to inventory Verifying the update... Inventory check OK: Patch ID 13916709 is registered in Oracle Home inventory with proper meta-data. Files check OK: Files from Patch ID 13916709 are present in Oracle Home. The local system has been patched and can be restarted. OPatch succeeded.
9.打开数据库,该PATCH不需要运行脚本
[oracle@10205 13916709]$ sqlplus / as sysdba SQL> startup
该PATCH不需要运行脚本,该PATCH的信息在数据库中查询不到。
SQL> select ACTION_TIME,ACTION,VERSION,ID,BUNDLE_SERIES,COMMENTS from DBA_REGISTRY_HISTORY; ACTION_TIME ACTION VERSION ID BUN COMMENTS ----------------------------- ---------- ---------- ------- --- ----------------- 15-NOV-12 02.52.43.581095 PM VIEW RECOMPILE 8289601 view recompilation 15-NOV-12 02.52.43.646084 PM UPGRADE 10.2.0.5.0 Upgraded from 10.2.0.1.0 15-NOV-12 04.54.57.533392 PM APPLY 10.2.0.5 6 PSU PSU 10.2.0.5.6 15-NOV-12 05.19.57.207585 PM APPLY 10.2.0.5 7 PSU PSU 10.2.0.5.7
也可以通过opatch lsinventory命令查询PUS信息,但是如果没有运行需要的脚本,opatch lsinventory命令可以查询到,但是在数据库中查询不到。
Hi, I’m from Russia and I have a problem with the patch 13343471. Could you give us your Skype. I really need help in this matter. we could talk about it on Skype
2014-04-22 09:21