`

了解Oracle补丁知识

 
阅读更多
Oracle软件版本是如何命名的
我们都在使用Oracle数据库,但不知大家有没有仔细关注过自己所使用的版本,或者更深入去了解这些版本是如何命名的。作为Oracle DBA,我觉得还是有必要略知一二的,但往往有着多年经验的DBA都对这些内容比较模糊。
首先,介绍如何从官方文档查找相关内容:HOME – > Administrator's Guide -> 1 Overview of Administering an Oracle Database -> Identifying Your Oracle Database Software Release。
我们拿11.2.0.1.0 这个版本举例,从中我们看到五个被句号所分开的数字,它们的含义如下:
  • 主数据库发布号 – Major Database Release Number
  • 数据库维护发布号 – Database Maintanence Release Number
  • 应用服务器发布号 – Application Server Release Number
  • 组建相关发布号 – Component Specific Release Number
  • 平台相关发布号 – Platform Specific Release Number
但事实上,经过我们补丁包升级之后,Oracle数据库软件版本中的第4位或第5位将进行变化,其中第4位是补丁集(Patch Set)号,第5位则是补丁集更新(Patch Set Update, PSU)号,比如,我有一个初始化安装之后的Oracle数据库,其版本如下:
SQL> SELECT * FROM PRODUCT_COMPONENT_VERSION;
 
PRODUCT                                  VERSION         STATUS
----------------------------------------------------------------------
NLSRTL                                   10.2.0.1.0ProductionOracleDatabase10gEnterpriseEdition10.2.0.1.064bi
PL/SQL                                   10.2.0.1.0Production
TNS forLinux:10.2.0.1.0Production
经过我补丁包升级之后如下:
SQL> SELECT * FROM PRODUCT_COMPONENT_VERSION;
 
PRODUCT                                  VERSION         STATUS
----------------------------------------------------------------------
NLSRTL                                   10.2.0.4.0ProductionOracleDatabase10gEnterpriseEdition10.2.0.4.064bi
PL/SQL                                   10.2.0.4.0Production
TNS forLinux:10.2.0.4.0Production
SQL>select action,comments from registry$history; 
 
ACTION               COMMENTS
--------------------------------------------------
UPGRADE              Upgradedfrom10.2.0.1.0
APPLY                PSU 10.2.0.4.4
APPLY                PSU 10.2.0.4.12
可见我这套数据库当前版本为10.2.0.4.12。

大家可能还不是很了解什么是Patch Set,什么叫Patch Set Update,下面会介绍。

了解补丁分类
下面了解一下相关术语的解释,O记罗敏的《品悟性能优化》中有介绍:
1) Version/版本
针对前一个版本的所有补丁进行整理,增加新的功能或对软件有较大的改动,进行整体测试,得到一个软件版本"包",称为版本Version。比如 11.2。
2) Patch Set/补丁集
在两次产品版本之间发布的一组经过全面测试的累计整体修复程序(一般每年发布一两次),如11.2.0.2 11.2.0.3。
3) Critical Patch Update(CPU)/关键补丁更新
指每季度提供一次的一组高优先级修复程序(往往针对安全性问题)。对于以前的安全性修复程序而言,这些CPU是累积的,但也可包含其他修复程序,目的是解决与非安全性补丁之间的补丁冲突问题(即降低合并请求的必要性)。目前已经更名为Security Patch Update (SPU)。
4) Patch Set Update(PSU)/补丁集更新
从10.2.0.4起,在两个补丁集之间发布,每年发布4次;
每个补丁集更新包含50~100个修复,经测试和集成后发布。如11.2.0.3.1,11.2.0.3.2。
5) CRS Bundle Patch/集群软件补丁集
专门修复Oracle Clusterware的补丁,以累计补丁的方式发布。
6)Composite Patch
从2012年4月份的Database PSU 11.2.0.3.2开始,推出一种新的概念叫Composite Patches。 这是一种新型的补丁包,它不同于其他的累积型补丁包。如果是第一次安装Composite Patches,那么该Composite Patches所包括的全部补丁都会被安装,后续安装的Composite Patches,只会安装对比前一次Composite Patches有变化的部分和新增加的补丁。
关于Composite Patch更多详细内容,请阅读Composite Patches for Oracle Products [Video] [ID 1376691.1]。
其他:
  • Diagnostic patch – 诊断补丁
  • Patch Set Exception – 个别补丁集(PSE)
  • Interim patch – 临时补丁
  • Merged patch – 合并补丁
  • Patch bundle – 补丁包
看到这里,大家可能迷糊了,原来补丁也有这么多的分类名称!其实,对于Oracle DBA来说,一般只要了解PSU(Patch Set Update)和CPU(Critical Patch Update)[现更名为SPU]就行。CPU是Oracle每个季度发布的安全补丁包,而PSU则是Oracle每个季度发布的包含Bug修复的补丁包,它也包含了最新的CPU。一般情况下,我们可能仅应用PSU即可。

在这里需要提醒一下,尽管应用PSU、CPU方法并不是很困难,官方在其补丁包里提供了详细的Readme,但在生产应用之前,还是希望咨询原厂工程师并在其支持下实施。

那如何查到目前最新的PSU呢?Oracle Support站点(我更喜欢叫MOS)中有个文档专门更新PSU的内容,其文档ID位756671.1,Oracle Recommended Patches — Oracle Database。类似如下: 

 
Upgrade与Update
首先,我们针对所使用的数据库可能会进行如下措施,版本升级或补丁包升级,那何为版本升级、何为补丁包升级呢?
比如我的当前数据库是10G R2版本,但公司最近有个升级计划,把这套数据库升级到当下最新的11G R2,这种大版本间升级动作即为Upgrade。根据公司计划在原厂工程师和DBA共同努力下,数据库已升级到11G R2,当下版本为11.2.0.3.0。这时候原厂工程师推荐把最新的PSU给打上,获得老板的批准之后,我们又把数据库进行补丁包的升级,应用了PSU Patch 14727310之后,数据库版本现在成为11.2.0.3.5,这个过程即是Update。
不得不再次提醒,Upgrade和Update都希望在获得原厂的支持下进行,尤其是Upgrade,这对于企业来说是个非常大的动作!
 
了解Opatch
Opatch是Oracle为了安装管理个别补丁而设计的工具,从Oracle 9.2版开始提供使用。通过Opatch工具,DBA可以方便安装、卸载补丁,也可以检测冲突等。
针对Oracle Database Server产品,包括CRS、ASM、RAC,Opatch对应版本如下表格:

Oracle 产品版本

下载 Opatch 版本

OPATCH 版本 

(截至 20121217)

9.2.0.x or 10.1.0.x

"10.1.0.0.0" (description "OPatch 9i, 10.1")

1.0.0.0.64

10.2.0.x

"10.2.0.0.0" (description "OPatch 10.2")

10.2.0.5.1

11.1.0.x

"11.1.0.0.0" (description "OPatch 11.1")

11.1.0.9.10

11.2.0.x

"11.2.0.0.0" (description "OPatch 11.2")

11.2.0.3.3

 
参考资料
关于补丁更多内容,请参考以下资料:
Oracle Recommended Patches — Oracle Database [ID 756671.1] 
Patch Set Updates for Oracle Products [ID 854428.1] 
Introduction To Oracle Database catbundle.sql [ID 605795.1] 
How to confirm that a Critical Patch Update (CPU) has been installed in Linux / UNIX [ID 821263.1]
Composite Patches for Oracle Products [Video] [ID 1376691.1]
OPatch – 可以在什么位置找到最新版本的 OPatch?[视频] [ID 1525335.1]
 
 
应用补丁示例
Apply PSU Patch 14727310
PSU补丁包:p14727310_112030_Linux-x86-64.zip
首先,请务必打开PSU包里面的Readme并详细阅读。
默认的Opatch版本过低导致无法Apply 最新PSU,需要进行Opatch更新
[oracle@khm7 install]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.bk
[oracle@khm7 install]$ unzip p6880880_112000_Linux-x86-64.zip-d $ORACLE_HOME/[oracle@khm7 ~]$ opatch version
OPatchVersion:11.2.0.3.3
 
OPatch succeeded.
可见opatch版本已升级到11.2.0.3.3。
下面需要解压PSU补丁包:
[oracle@khm7 install]$ unzip p14727310_112030_Linux-x86-64.zip -d patch
手动Apply PSU Patch,当然,我们也可以选择自动(但auto可能会出错):
[oracle@khm7 ~]$ opatch napply -oh $ORACLE_HOME -local/install/patch/14727310/OracleInterimPatchInstaller version 11.2.0.3.3Copyright(c)2012,OracleCorporation.All rights reserved.
 
 
OracleHome:/u01/app/oracle/product/11.2.0.3/dbhome_1
CentralInventory:/u01/app/oraInventory
   from:/u01/app/oracle/product/11.2.0.3/dbhome_1/oraInst.loc
OPatch version    :11.2.0.3.3
OUI version       :11.2.0.3.0Log file location :/u01/app/oracle/product/11.2.0.3/dbhome_1/cfgtoollogs/opatch/opatch2013-03-15_13-29-02PM_1.log
 
Verifying environment and performing prerequisite checks...OPatch continues with these patches:1334343813696216139233741427560514727310  
 
Do you want to proceed?[y|n]
y
UserRespondedwith: Y
All checks passed.Provide your email address to be informed of security issues, install and
initiate OracleConfigurationManager.Easierfor you if you use your MyOracleSupportEmail address/UserName.Visit http://www.oracle.com/support/policies.html for details.Email address/UserName: 
 
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.(OracleHome='/u01/app/oracle/product/11.2.0.3/dbhome_1')
 
 
Is the local system ready for patching?[y|n]
y
UserRespondedwith: Y
Backing up files...Applyingsub-patch '13343438' to OH '/u01/app/oracle/product/11.2.0.3/dbhome_1'
 
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...Applyingsub-patch '13696216' to OH '/u01/app/oracle/product/11.2.0.3/dbhome_1'
 
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...Applyingsub-patch '13923374' to OH '/u01/app/oracle/product/11.2.0.3/dbhome_1'ApplySession:Optional component(s)[ oracle.network.cman,11.2.0.3.0]not present in the OracleHomeor 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...Applyingsub-patch '14275605' to OH '/u01/app/oracle/product/11.2.0.3/dbhome_1'ApplySession:Optional component(s)[ oracle.precomp.lang,11.2.0.3.0]not present in the OracleHomeor 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...Applyingsub-patch '14727310' to OH '/u01/app/oracle/product/11.2.0.3/dbhome_1'
 
Patching component oracle.rdbms,11.2.0.3.0...
 
Patching component oracle.rdbms.dbscripts,11.2.0.3.0...
 
Patching component oracle.rdbms.deconfig,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...
 
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'
/u01/app/oracle/product/11.2.0.3/dbhome_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0.3/dbhome_1/precomp/lib/ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'/u01/app/oracle/product/11.2.0.3/dbhome_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'
 
 
Composite patch 14727310 successfully applied.
OPatch Session completed with warnings.
Log file location: /u01/app/oracle/product/11.2.0.3/dbhome_1/cfgtoollogs/opatch/opatch2013-03-15_13-29-02PM_1.log
 
OPatch completed with warnings.
上面结果显示OPatch completed with warnings,但这里并无大碍,你可以查看日志获得更多详细内容。
查看更新结果,可见已然是11.2.0.3.5了:[oracle@khm7 ~]$ opatch lspatches
14727310;DatabasePatchSetUpdate:11.2.0.3.5(14727310)查看更新补丁内容:[oracle@khm7 ~]$ opatch lsinventory
OracleInterimPatchInstaller version 11.2.0.3.3Copyright(c)2012,OracleCorporation.All rights reserved.
 
 
OracleHome:/u01/app/oracle/product/11.2.0.3/dbhome_1
CentralInventory:/u01/app/oraInventory
   from:/u01/app/oracle/product/11.2.0.3/dbhome_1/oraInst.loc
OPatch version    :11.2.0.3.3
OUI version       :11.2.0.3.0Log file location :/u01/app/oracle/product/11.2.0.3/dbhome_1/cfgtoollogs/opatch/opatch2013-03-15_13-40-00PM_1.log
 
LsinventoryOutput file location :/u01/app/oracle/product/11.2.0.3/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-03-15_13-40-00PM.txt
 
--------------------------------------------------------------------------------InstalledTop-level Products(1): 
 
OracleDatabase11g11.2.0.3.0There are 1 products installed inthisOracleHome.
 
 
Interim patches (1):
 
Patch14727310: applied on FriMar1513:35:43 CST 2013UniquePatch ID:15663328Patch description:"Database Patch Set Update : 11.2.0.3.5 (14727310)"Created on 27Dec2012,00:06:30 hrs PST8PDT
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)"Bugsfixed:13566938,13593999,10350832,14138130,12919564,13624984,1358824813080778,13804294,14258925,12873183,13645875,12880299,1466435514409183,12998795,14469008,13719081,13492735,12857027,1426303614263073,13742433,13732226,12905058,13742434,12849688,1295064413742435,13464002,12879027,13534412,14613900,12585543,1253534612588744,11877623,12847466,13649031,13981051,12582664,1279776514262913,12923168,13612575,13384182,13466801,13484963,1106319113772618,13070939,12797420,13041324,12976376,11708510,1374243713026410,13737746,13742438,13326736,13001379,13099577,1427560513742436,9873405,9858539,14040433,12662040,9703627,1261712312845115,12764337,13354082,13397104,12964067,13550185,1278098312583611,14546575,13476583,15862016,11840910,13903046,1586201713572659,13718279,13657605,13448206,13419660,14480676,1363271714063281,13430938,13467683,13420224,14548763,12646784,1403582512861463,12834027,15862021,13377816,13036331,14727310,1368554413499128,15862018,12829021,15862019,12794305,14546673,1279198113503598,13787482,10133521,12718090,13399435,14023636,1240111113257247,13362079,12917230,13923374,14480675,13524899,1355969714480674,13916709,14076523,13773133,13340388,13366202,1352855112894807,13343438,13454210,12748240,14205448,13385346,1585308112971775,13035804,13544396,13035360,14062795,12693626,1333243914038787,14062796,12913474,14841409,14390252,13370330,1406279713059165,14062794,12959852,13358781,12345082,12960925,965961413699124,14546638,13936424,13338048,12938841,12658411,1262082312656535,14062793,12678920,13038684,14062792,13807411,1259403213250244,15862022,9761357,12612118,13742464,14052474,1345758213527323,15862020,12780098,13502183,13705338,13696216,1026366815862023,13554409,15862024,13103913,13645917,14063280,13011409
 
 
 
--------------------------------------------------------------------------------
 
OPatch succeeded.
数据库启动,并加载修改SQL Files到数据库
[oracle@khm7 ~]$ sqlplus /as sysdba
 
SQL*Plus:Release11.2.0.3.0Production on FriMar1513:40:392013
 
Copyright(c)1982,2011,Oracle.All rights reserved.
 
Connected to an idle instance.
 
SQL> startup
ORACLE instance started.
 
TotalSystemGlobalArea417546240 bytes
FixedSize2228944 bytes
VariableSize272633136 bytes
DatabaseBuffers138412032 bytes
RedoBuffers4272128 bytes
Database mounted.Database opened.
SQL> show user
USER is"SYS"
SQL>@?/rdbms/admin/catbundle.sql psu apply
## 这个脚本执行时间跟大家的系统有关
… 输出略 …
执行完后我们可以查到PSU更新信息:
SQL>set line 150
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
-------------------------------------------------------------------------------------------17-SEP-1110.21.11.595816 AM   APPLY    SERVER   11.2.0.30 PSU   Patchset11.2.0.2.015-MAR-1310.40.00.705490 AM   APPLY    SERVER   11.2.0.30 PSU   Patchset11.2.0.2.015-MAR-1301.43.05.319842 PM   APPLY    SERVER   11.2.0.35 PSU   PSU 11.2.0.3.5
 
3 rows selected.
 
Apply PSU Patch 14727315
PSU补丁包:p14727315_112020_Linux-x86-64.zip
Apply PSU 14727315(11.2.0.2.0 to 11.2.0.9)方法与2.1的内容大同小异,因此这里只列出步骤:
[root@khm8 ~]# chown oracle.oinstall /install/p*Opatch更新:[oracle@khm7 install]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.bk
[oracle@khm7 install]$ unzip p6880880_112000_Linux-x86-64.zip-d $ORACLE_HOME/[oracle@khm7 ~]$ opatch version
OPatchVersion:11.2.0.3.3
 
OPatch succeeded.[oracle@khm8 install]$ unzip p14727315_112020_Linux-x86-64.zip-d patch
 
[oracle@khm8 ~]$ opatch napply -oh $ORACLE_HOME -local/install/patch/14727315/
 
[oracle@khm8 ~]$ opatch lspatches
14727315;DatabasePatchSetUpdate:11.2.0.2.9(14727315)执行catbundle.sql脚本之前,无法看到PSU更新信息:
SQL>set line 150
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
-------------------------------------------------------------------------------------------05-SEP-1006.22.14.370943 AM   APPLY    SERVER   11.2.0.20 PSU   Patchset11.2.0.2.015-MAR-1311.22.14.833238 AM   APPLY    SERVER   11.2.0.20 PSU   Patchset11.2.0.2.0执行脚本后,即可看到:
SQL>@?/rdbms/admin/catbundle.sql psu apply
 
SQL>select*from dba_registry_history;
 
ACTION_TIME                    ACTION   NAMESPAC VERSION            ID BUNDL COMMENTS
-------------------------------------------------------------------------------------------05-SEP-1006.22.14.370943 AM   APPLY    SERVER   11.2.0.20 PSU   Patchset11.2.0.2.015-MAR-1311.22.14.833238 AM   APPLY    SERVER   11.2.0.20 PSU   Patchset11.2.0.2.015-MAR-1302.14.09.659104 PM   APPLY    SERVER   11.2.0.29 PSU   PSU 11.2.0.2.9
 
 
Upgrade Oracle 10g R2 from 10201 to 10204 and Apply PSU Patch 9352164、12879933
Upgrade Oracle 10g R2 from 10201 to 10204
首先,我们需要将数据库升级到10.2.0.4版本,一切还是以Readme为参考资料,展开操作。
所需包:p6810189_10204_Linux-x86-64.zip
升级前,有几项准备动作。
确保参数shared_pool_sizejava_pool_size至少为150M大小:
SQL> alter system set shared_pool_size=150M scope=spfile;
SQL> alter system set java_pool_size=150M scope=spfile;如果SGA大小设置不够大,下次启动将会保证,所以也保证SGA足够:
SQL>  alter system set sga_target=400M scope=spfile;关闭数据库
SQL> shutdown immediate
以防万一,备份Database Software。
需要停止所有运行中的程序,如监听器、OEM、ISQLPLUS等。
下面就解压升级包,并通过OUI进行升级即可。
[oracle@khm11 install]$ unzip p6810189_10204_Linux-x86-64.zip[oracle@khm11 install]$ cd Disk1/[oracle@khm11 Disk1]$ export DISPLAY=192.168.1.1:0.0[oracle@khm11 Disk1]$ ./runInstaller 
– OUI交互设置的时候需要注意的地方:
Specify Home Details时,NAME和目录选择原安装路径,如果环境变量设置未改变,默认即可。
中间会提示用ROOT去执行脚本,执行完DATABASE SOFTWARE升级就算完成了。
接下来,需要启动到升级模式,然后更新数据字典
[oracle@khm11 ~]$ sqlplus /as sysdba
 
SQL*Plus:Release10.2.0.4.0-Production on FriMar1516:30:422013
 
Copyright(c)1982,2007,Oracle.AllRightsReserved.
 
Connected to an idle instance.
 
SQL> startup upgrade
ORACLE instance started.
 
TotalSystemGlobalArea390070272 bytes
FixedSize2084168 bytes
VariableSize322962104 bytes
DatabaseBuffers58720256 bytes
RedoBuffers6303744 bytes
Database mounted.Database opened.执行脚本,此过程非常缓慢,从下面的输出信息中可以看到,升级一共耗费了43分钟多,当然这根据不同的系统有快有慢。另外,按照README的要求,我们也可以将输出信息SPOOL到一个文件里,好方便查阅!
SQL>@?/rdbms/admin/catupgrd.sql
部分内容省略...TotalUpgradeTime:00:43:33
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>The above PL/SQL lists the SERVER components in the upgraded
DOC>   database, along with their current version and status.
DOC>
DOC>Please review the status and version columns and look for
DOC>   any errors in the spool log file.If there are errors in the spool
DOC>   file,or any components are not VALID ornot the current version,
DOC>   consult the OracleDatabaseUpgradeGuidefor troubleshooting
DOC>   recommendations.
DOC>
DOC>Next shutdown immediate, restart for normal operation,andthen
DOC>   run utlrp.sql to recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
数据字典更新完后重新正常启动,然后重编译失效对象
SQL> shutdown immediate
SQL> startup
SQL>@?/rdbms/admin/utlrp.sql
--输出内容略--
单实例的版本升级到这里就算完事了,当然有CATALOG恢复目录,也升级一下即可。
最后查看数据库组件的版本、状态等:
SQL> col comp_name format a30
SQL> col version format a30
SQL> col status format a10
SQL> SELECT comp_name, version, status FROM dba_registry;
 
COMP_NAME                      VERSION                        STATUS
----------------------------------------------------------------------OracleDatabaseCatalogViews10.2.0.4.0                     VALID
OracleDatabasePackagesand T 10.2.0.4.0                     VALID
ypes
 
OracleWorkspaceManager10.2.0.4.3                     VALID
JServer JAVA VirtualMachine10.2.0.4.0                     VALID
Oracle XDK                     10.2.0.4.0                     VALID
OracleDatabaseJavaPackages10.2.0.4.0                     VALID
OracleExpressionFilter10.2.0.4.0                     VALID
OracleDataMining10.2.0.4.0                     VALID
OracleText10.2.0.4.0                     VALID
Oracle XML Database10.2.0.4.0                     VALID
OracleRuleManager10.2.0.4.0                     VALID
Oracle interMedia              10.2.0.4.0                     VALID
OLAP AnalyticWorkspace10.2.0.4.0                     VALID
Oracle OLAP API                10.2.0.4.0                     VALID
OLAP Catalog10.2.0.4.0                     VALID
Spatial10.2.0.4.0                     VALID
OracleEnterpriseManager10.2.0.4.0                     VALID
 
17 rows selected.
 
Apply PSU Patch 9352164
首先,我们需要明白数据库无法直接打PSU Patch 12879933,在我们阅读PSU Patch 12879933 Readme的时候可以发现如下内容:
Patch Set Update PSU 10.2.0.4.12 is an overlay PSU whose base PSU is 10.2.0.4.4. This patch can only be applied in an Oracle home for which PSU 10.2.0.4.4 has already been installed.
这里明显的提示我们数据库先Update到10.2.0.4.4,然后才可以Update到10.2.0.4.12。
那Update到10.2.0.4.4会不会有其他要求呢?我们阅读PSU Patch 9352164的Readme会发现:
To install the PSU 10.2.0.4.4 patch, the Oracle home must have the 10.2.0.4.0 Database patch set installed. Subsequent PSU patches can be installed on Oracle Database 10.2.0.4.0 or any PSU with a lower 5th numeral version than the one being installed. For example, PSU 10.2.0.4.4 can be installed on 10.2.0.4.0, 10.2.0.4.1, 10.2.0.4.2, and 10.2.0.4.3.
我们当前版本为10.2.0.4.0,因此满足需求。
PSU补丁包:p9352164_10204_Linux-x86-64.zip
首先把所有活动程序包括OEM、监听器、数据库实例全部关闭:
操作略。
检查Opatch版本:
[oracle@khm11 install]$ opatch version
InvokingOPatch10.2.0.4.2
 
OPatchVersion:10.2.0.4.2
 
OPatch succeeded.
解压PSU补丁包,并进行应用:
[oracle@khm11 install]$ unzip p9352164_10204_Linux-x86-64.zip-d patch
[oracle@khm21 install]$ cd patch/9352164/[oracle@khm21 9352164]$ opatch apply
InvokingOPatch10.2.0.5.1
 
OracleInterimPatchInstaller version 10.2.0.5.1Copyright(c)2010,OracleCorporation.All rights reserved.
 
 
OracleHome:/u01/app/oracle/product/10.2.0/dbhome_1
CentralInventory:/u01/app/oracle/oraInventory
   from:/etc/oraInst.loc
OPatch version    :10.2.0.5.1
OUI version       :10.2.0.4.0
OUI location      :/u01/app/oracle/product/10.2.0/dbhome_1/oui
Log file location :/u01/app/oracle/product/10.2.0/dbhome_1/cfgtoollogs/opatch/opatch2013-03-17_00-24-14AM.log
 
Patch history file:/u01/app/oracle/product/10.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
 
ApplySession applying interim patch '9352164' to OH '/u01/app/oracle/product/10.2.0/dbhome_1'
 
Running prerequisite checks...Provide your email address to be informed of security issues, install and
initiate OracleConfigurationManager.Easierfor you if you use your MyOracleSupportEmail address/UserName.Visit http://www.oracle.com/support/policies.html for details.Email address/UserName: 
 
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 OracleHomefrom the inventory and will patch the local system only.
 
 
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.(OracleHome='/u01/app/oracle/product/10.2.0/dbhome_1')
 
 
Is the local system ready for patching?[y|n]
y
UserRespondedwith: Y
Backing up files and inventory (notforauto-rollback)for the OracleHomeBacking up files affected by the patch '9352164'for restore.This might take a while...Backing up files affected by the patch '9352164'for rollback.This might take a while...Execution of 'sh /install/patch/9352164/custom/scripts/pre -apply 9352164 ':
 
 
ReturnCode=0中间大量信息略Verifying the update...Inventory check OK:Patch ID 9352164is registered inOracleHome inventory with proper meta-data.Files check OK:FilesfromPatch ID 9352164 are present inOracleHome.
 
--------------------------------------------------------------------------------******************************************************************************************************************************************************************                                ATTENTION                                   ********Please note that the PatchSetUpdateInstallation(PSU Deinstallation)****isnot complete until all the PostInstallation(PostDeinstallation)**** instructions noted in the Readme accompanying this PSU, have been          **** successfully completed.**********************************************************************************************************************************************************************
 
--------------------------------------------------------------------------------
 
Execution of 'sh /install/patch/9352164/custom/scripts/post -apply 9352164 ':
 
 
ReturnCode=0
 
Thelocal system has been patched and can be restarted.
 
 
OPatch succeeded.
数据库启动,并执行脚本来加载修改SQL Files到数据库:
代码代码
因此,Apply PSU Patch完成,查看:
SQL> startup
SQL>@?/rdbms/admin/catbundle.sql psu apply
输出信息略因此,Apply PSU Patch完成,查看:
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 a40
SQL>select*from dba_registry_history;
 
ACTION_TIME                    ACTION   NAMESPAC VERSION            ID BUNDL COMMENTS
---------------------------------------------------------------------------------------------------------------16-MAR-1311.24.53.986137 PM   UPGRADE  SERVER   10.2.0.4.0Upgradedfrom10.2.0.1.017-MAR-1312.45.32.609861 AM   APPLY    SERVER   10.2.0.44 PSU   PSU 10.2.0.4.4

 

Apply PSU Patch 12879933
方法与Apply PSU Patch9352164类似,这里不做详细说明。
PSU补丁包:p12879933_10204_Linux-x86-64.zip
[oracle@khm11 install]$ unzip p12879933_10204_Linux-x86-64.zip-d patch
[oracle@khm21 install]$ cd patch/12879933/[oracle@khm21 12879933]$ opatch apply
启动数据库:[oracle@khm21 install]$ sqlplus /as sysdba
SQL> startup
将修改过的SQL文件应用到数据库:
SQL>@?/rdbms/admin/catbundle.sql opsu apply
注意:如果PSUoverlay PSU,比如10.2.0.4.8,则需要执行@catbundle.sql opsu apply编译失效对象:
SQL>@?/rdbms/admin/utlrp.sql
查看版本更新信息:
SQL>set line 150
SQL> col ACTION_TIME for a30
SQL> col ACTION for a8
SQL> col NAMESPACE for a20
SQL> col VERSION for a10
SQL> col BUNDLE_SERIES for a5
SQL> col COMMENTS for a30
SQL>select*from dba_registry_history;
 
ACTION_TIME                    ACTION   NAMESPACE            VERSION            ID BUNDL COMMENTS
-----------------------------------------------------------------------------------------------------------------16-MAR-1311.24.53.986137 PM   UPGRADE  SERVER               10.2.0.4.0Upgradedfrom10.2.0.1.017-MAR-1312.45.32.609861 AM   APPLY    SERVER               10.2.0.44 PSU   PSU 10.2.0.4.417-MAR-1301.37.02.320305 AM   APPLY    SERVER               10.2.0.48 OPSU  PSU 10.2.0.4.12
 
3 rows selected.打完PSU之后如下方式查看:
$ opatch lsinventory -bugs_fixed | grep -i 'DATABASE PSU'9654991    11724977  WedMay2516:37:17 CST 2011   DATABASE PSU 10.2.0.4.5(REQUIRES PRE-REQUISITE 
9952234    11724977  WedMay2516:37:17 CST 2011   DATABASE PSU 10.2.0.4.6(REQUIRES PRE-REQUISITE 
10248636   11724977  WedMay2516:37:17 CST 2011   DATABASE PSU 10.2.0.4.7(REQUIRES PRE-REQUISITE 
11724977   11724977  WedMay2516:37:17 CST 2011   DATABASE PSU 10.2.0.4.8(REQUIRES PRE-REQUISITE 
8576156    9352164   WedMay2515:10:48 CST 2011   DATABASE PSU 10.2.0.4.1(INCLUDES CPUJUL2009)8833280    9352164   WedMay2515:10:48 CST 2011   DATABASE PSU 10.2.0.4.2(INCLUDES CPUOCT2009)9119284    9352164   WedMay2515:10:48 CST 2011   DATABASE PSU 10.2.0.4.3(INCLUDES CPUJAN2010)9352164    9352164   WedMay2515:10:48 CST 2011   DATABASE PSU 10.2.0.4.4(INCLUDES CPUAPR2010)
 
Upgrade  Oracle 10g R2 from 10201 to 10205 and Apply PSU Patch 14727319
Upgrade Oracle 10g R2 from 10201 to 10205
首先,把数据库升级到10.2.0.5.0版本,操作和2.3雷同。
所需包:p8202632_10205_Linux-x86-64.zip
SQL> alter system set shared_pool_size=150M scope=spfile;
SQL> alter system set java_pool_size=150M scope=spfile;
SQL>  alter system set sga_target=400M scope=spfile;
SQL> shutdown immediate
[oracle@khm11 install]$ unzip p8202632_10205_Linux-x86-64.zip[oracle@khm11 install]$ cd Disk1/[oracle@khm11 Disk1]$ export DISPLAY=192.168.1.1:0.0[oracle@khm11 Disk1]$ ./runInstaller 
[oracle@khm11 ~]$ sqlplus /as sysdba
SQL> startup upgrade
SQL>@?/rdbms/admin/catupgrd.sql
SQL> shutdown immediate
SQL> startup
SQL>@?/rdbms/admin/utlrp.sql
SQL> col comp_name format a30
SQL> col version format a30
SQL> col status format a10
SQL> SELECT comp_name, version, status FROM dba_registry;
 
COMP_NAME                      VERSION                        STATUS
----------------------------------------------------------------------OracleEnterpriseManager10.2.0.5.0                     VALID
Spatial10.2.0.5.0                     VALID
Oracle interMedia              10.2.0.5.0                     VALID
OLAP Catalog10.2.0.5.0                     VALID
Oracle XML Database10.2.0.5.0                     VALID
OracleText10.2.0.5.0                     VALID
OracleExpressionFilter10.2.0.5.0                     VALID
OracleRuleManager10.2.0.5.0                     VALID
OracleWorkspaceManager10.2.0.5.0                     VALID
OracleDataMining10.2.0.5.0                     VALID
OracleDatabaseCatalogViews10.2.0.5.0                     VALID
OracleDatabasePackagesand T 10.2.0.5.0                     VALID
ypes
 
JServer JAVA VirtualMachine10.2.0.5.0                     VALID
Oracle XDK                     10.2.0.5.0                     VALID
OracleDatabaseJavaPackages10.2.0.5.0                     VALID
OLAP AnalyticWorkspace10.2.0.5.0                     VALID
Oracle OLAP API                10.2.0.5.0                     VALID
 
17 rows selected.
 
Apply PSU Patch 14727319
PSU补丁包:p6880880_102000_Linux-x86-64.zip 
Apply PSU Patch 14727319需要先升级Opatch.
[oracle@primary install]$ unzip p6880880_102000_Linux-x86-64.zip[oracle@primary install]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.bk
[oracle@primary install]$ mv OPatch/ $ORACLE_HOME/[oracle@primary install]$ $ORACLE_HOME/OPatch/opatch
关闭所有活动程序[oracle@khm22 install]$ unzip p14727319_10205_Linux-x86-64.zip-d patch
[oracle@khm22 install]$ cd patch/14727319/[oracle@khm22 12879933]$ opatch apply
[oracle@khm22 install]$ sqlplus /as sysdba
SQL> startup
SQL>@?/rdbms/admin/catbundle.sql psu apply
SQL>set line 150
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 a40
SQL>select*from dba_registry_history;
 
ACTION_TIME                    ACTION   NAMESPAC VERSION            ID BUNDL COMMENTS
---------------------------------------------------------------------------------------------------------------17-MAR-1312.09.03.762743 AM   VIEW REC                        8289601       view recompilation
                               OMPILE
 
17-MAR-1312.09.03.872147 AM   UPGRADE  SERVER   10.2.0.5.0Upgradedfrom10.2.0.1.017-MAR-1301.11.02.521324 AM   APPLY    SERVER   10.2.0.510 PSU   PSU 10.2.0.5.10
分享到:
评论

相关推荐

    oracle12c补丁 64位 for windows - p31210848_122010_MSWIN-x86-64

    #### 知识点二:Oracle 补丁的重要性 在数据库系统运行过程中,可能会遇到各种问题,如安全性漏洞、性能瓶颈、稳定性问题等。Oracle 官方会定期发布补丁来解决这些问题。安装补丁能够确保数据库系统的稳定性和安全...

    rhl5上安装oracle9i必备补丁包

    在RHL5上安装Oracle 9i之前,了解相关知识点至关重要。 首先,了解RHL5的系统要求。Oracle 9i对硬件和软件环境有一定的标准,比如处理器速度、内存大小、磁盘空间以及网络配置等。RHL5作为服务器级操作系统,应保证...

    oracle11.2.0.1补丁.zip

    9. **培训和技术支持**:理解并正确应用Oracle补丁需要一定的专业知识。确保团队接受适当的培训,或联系Oracle官方技术支持以获取帮助。 10. **自动化工具**:考虑使用自动化工具来简化补丁管理,如Oracle Database...

    ORACLE数据库基础知识

    要了解ORACLE数据库,需要先了解以下基本概念: * 数据库:是一个数据集合,包括物理数据和内存、进程对象的组合。 * 表空间(Tablespace):是数据库的逻辑划分,每个数据库至少有一个表空间(system表空间)。 * ...

    Bugs Fixed by this patch: 19692824 - DBCONTROL is not coming up on CentOS 7

    同时,查看Oracle的文档或知识库可以获取更多关于这个补丁的详细信息,以及可能的副作用和解决方法。对于大型企业而言,定期检查并安装最新的Bug补丁是维护数据库稳定运行的重要环节。 总的来说,Oracle 11gR2在...

    OracleClient-21C Oracle客户端,包括windows和Linux

    OracleClient-21C的安装和配置也是重要的知识点。在Windows上,通常通过安装向导进行,而在Linux下,可能需要手动配置环境变量和链接库。在部署过程中,需注意依赖库的安装,例如在Linux系统上可能需要安装libaio和...

    Oracle RAC 升级补丁.txt

    根据提供的文件信息,我们可以深入探讨Oracle RAC(Real Application Clusters)升级补丁的相关知识点,主要包括以下几个方面: ### Oracle RAC 升级补丁概述 #### 标题和描述解析 - **标题**:“Oracle RAC 升级...

    oracle10.2.4 CPU 补丁 p8290506_10204_Linux-x86.zip

    在安装这个补丁之前,用户需要了解以下关键知识点: 1. **补丁更新流程**:安装CPU补丁前,首先要确保数据库已经备份,以防万一出现问题可以恢复。然后,遵循Oracle的文档指导,使用`opatch apply`命令进行安装。在...

    Red Hat AS 55(64Bit)安装Oracle(10g-补丁升级10204)最新完整记录.docx

    ### Red Hat AS 55(64Bit)安装Oracle(10g-补丁升级10204)的知识点 #### 一、系统安装与配置 - **Swap大小设置**: - 根据系统内存大小来设定Swap空间大小至关重要。对于Red Hat AS 55(64Bit),推荐的Swap空间大小...

    Oracle DBA 面试题

    2. 创建和配置Oracle数据库(Creating and Configuring an Oracle Database):应聘者需要了解Oracle数据库的安装流程、初始化参数配置、网络配置、数据库字符集设置、创建数据库实例等。 3. 数据库状态与操作...

    oracle11g 百度盘下载

    通过下载并安装Oracle 11g,用户不仅可以学习数据库管理的基础知识,还可以深入了解企业级数据库的高级特性,提升在数据库设计、开发和维护方面的能力。对于IT专业人员来说,掌握Oracle 11g的使用和管理是一项重要的...

    Oracle 文档号搜集

    通过对给定文件的分析,我们不仅了解了Oracle Metalink作为Oracle技术支持资源的重要性,还深入探讨了在Oracle数据库管理中常见的问题,如数据泵导入错误的处理、补丁的应用以及ASM实例的升级策略。这些知识点对于...

    oracle相关知识

    - Oracle Support(My Oracle Support):注册用户可以访问故障排除指南、补丁和更新,以解决数据库问题。 4. 学习与实践: - 安装与配置:学习如何在不同的操作系统上安装和配置Oracle数据库,理解初始化参数...

    Oracle 入门级DBA必备

    Oracle作为数据库领域的重要产品,对于DBA(数据库管理员)来说,了解其基本操作和管理是必要的。同时,由于Oracle经常运行在特定的操作系统如AIX之上,DBA还需要对AIX系统进行维护和管理。此外,HACMP(High ...

    oracle10g 安装操作实用手册

    手册不仅是数据库管理员安装和使用Oracle 10g时的宝贵指南,也适合那些希望了解Oracle 10g数据库管理和操作的初学者。通过这份文档,读者可以系统地学习Oracle 10g的基本使用,为进一步学习高级特性和深入管理Oracle...

    oracle 11g ,10g软件资源 百度云下载

    ### Oracle 11g与10g软件资源百度云下载相关知识点 #### 一、Oracle数据库简介 Oracle数据库是美国甲骨文公司的一款关系型数据库管理系统,在市场上占有重要的份额。Oracle数据库以其高度的安全性、可靠性和灵活性...

    oracle 9.2.0.4.0补钉

    在安装Oracle for Linux的补丁之前,有几点关键的知识点需要注意: 1. **系统环境准备**:确保Linux操作系统版本与Oracle数据库兼容,通常推荐使用Red Hat Enterprise Linux或Oracle Linux。安装必要的开发工具、库...

    oracle opatch工具

    以下是对Oracle OPatch及其相关知识点的详细介绍: 1. **OPatch的作用**: - OPatch是OraclePatchInstaller的缩写,它的主要功能是安装、卸载和查询Oracle产品中的补丁。 - 它可以应用于Oracle数据库、Oracle ...

    EBS adpatch打补丁应用指南

    EBS adpatch打补丁应用指南 EBS adpatch打补丁应用指南是Oracle E-Business Suite(EBS)中的一个重要组件,用于管理和应用补丁到EBS系统中。...了解这些知识点可以帮助管理员更好地应用补丁,确保系统的稳定运行。

    oracle 需要的下载

    在进行Oracle相关的下载时,我们需要了解以下几个重要的知识点: 1. **Oracle版本选择**:Oracle提供了多种版本来满足不同的需求,包括个人版(Oracle Database Express Edition)、标准版(Oracle Database ...

Global site tag (gtag.js) - Google Analytics