【前言】保证数据库的稳定与安全运行是DBA的价值所在,Oracle Database本身也是一个软件,随着系统的使用场景和使用深度的增加一些原本没被发现的漏洞或BUG就会逐渐被发现。
所以成熟的IT企业,往往会定期对数据库进行安全检查和补丁的更新;
【一】Oracle版本命名规则
在进行Oracle更新补丁之前,先对Oracle的版本命名有个认识。
从9i之后,oracle版本命名规则定义如下:
A.B.C.D
其中第一位A表示大版本号,第二位表示小版本号,前两位合称主版本号;如9.2、10.1、11.2等。
对于数据库产品而言,第三为C永远为0,该位是给其他ORACLE数据库产品使用的。第四位则表示补丁集(Patche Set)号,例如11.2.0.1、11.2.0.4、12.1.0.1、12.2.0.1等。
【二】补丁体系介绍
Critical Patch Update (CPU):每季度发布一次,用来修复安全方面的一些补丁,是累积型的。目前已经更名为Security Patch Update (SPU)。
点击下面的链接查看各个CPU所修复的具体问题:
http://www.oracle.com/technetwork/topics/security/alerts-086861.html
Patch Set Update (PSU):每季度发布一次,修复比较严重的一些问题,包含每季的CPU,是累积型的。虽然在描述PSU的时候会用到数据库版本第5位,比如Database PSU 11.2.0.3.5,但实际上打完PSU后并不会真正改变数据库的版本,从v$version中看到的版本还是4位的(11.2.0.3.0),第5位仍然是0。注意,Windows上没有CPU和PSU,Oracle的集群软件和数据库软件使用不同的PSU。
可以参考下面的MOS文档了解每个季度的CPU、PSU、Windows Bundle Patch的具体补丁号:
Note 1454618.1 Quick Reference to Patch Numbers for Database PSU, SPU(CPU), Bundle Patches and Patchsets
Patch set: 是在大版本上发布的补丁集,修复了较多的Bug,可能会包含一些增强功能(Enhancement)。比如11.2是一个大版本,那么11.2.0.2就是一个Patch set。这种补丁集经过了严格的集成测试,也是累积型的。所以我们总是推荐安装最新的Patch Set。
Diagnostic patch:诊断补丁。有的时候诊断一个问题的时候,为了获得更多的诊断信息,Oracle的开发部门会提供一个Diagnostic Patch,这种补丁不是为了修复问题,而是诊断问题。
Composite Patch:从2012年4月份的Database PSU 11.2.0.3.2开始,推出一种新的概念叫Composite Patches。 这是一种新型的补丁包,它不同于其他的累积型补丁包。如果是第一次安装Composite Patches,那么该Composite Patches所包括的全部补丁都会被安装,后续安装的Composite Patches,只会安装对比前一次Composite Patches有变化的部分和新增加的补丁。
【三】补丁的更新
下载需要的补丁后,会有个README.html的文件,该文件有补丁信息的介绍、补丁工具要求、安装、回滚操作等介绍。
操作如下:
cd $ORACLE_HOME/OPatch
./opatch --help
========================================================
GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY
========================================================
Oracle Interim Patch Installer version 11.2.0.3.1
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Usage: opatch [ -help ] [ -report ] [ command ]
command := apply
lsinventory
lspatches
napply
nrollback
rollback
query
version
prereq
util
<global_arguments> := -help Displays the help message for the command.
-report Print the actions without executing.
example:
'opatch -help'
'opatch -help -fmw'
'opatch auto -help'
'opatch apply -help'
'opatch lsinventory -help'
'opatch lspatches -help'
'opatch napply -help'
'opatch nrollback -help'
'opatch rollback -help'
'opatch prereq -help'
'opatch util -help'
apply | Installs an interim patch. Refer to "apply Command" for more information. |
napply | Installs n number of patches (hence napply). Refer to "napply Command" for more information. |
auto | Applies Oracle Clusterware patches. Refer to "auto Command" for more information. |
lsinventory | Lists what is currently installed on the system. Refer to "lsinventory Command" for more information. |
query | Queries a given patch for specific details. Refer to "query Command" for more information. |
rollback | Removes an interim patch. Refer to "rollback Command" for more information. |
nrollback | Removes n number of patches (hence nrollback). Refer to "nrollback Command" for more information. |
version | Prints the current version of the patch tool. Refer to "version Command" for more information. |
【总结】以上的这些只是也才是补丁刚入门了,后面会继续整理补丁的下载和补丁的更新步骤。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12679300/viewspace-2213412/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12679300/viewspace-2213412/