如何如何打oracle psu补丁丁

博客访问: 2169005
博文数量: 275
注册时间:
10g/11g OCP,11g OCM,YEP成员(Oracle Young Expert Program,Oracle用户组年轻专家项目),我不是DBA,但我的爱好是Oracle,微信公众号:bisal的个人杂货铺
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Oracle
Oracle作为大型商用关系型数据库,从其补丁体系就可以看出其考虑的全面性。首先我们看下Oracle Patch的主要类型[参考1和2]:
Version/维护版本&
针对前一个维护版本的所有补丁进行整理,增加新的功能或对软件有较大的改动,进行整体测试,得到一个软件版本”包”,称为版本Version。比如 11.2。
One-off patches (e.g. a bug fix)&
One-off patches也称之为一次性补丁,通常针对特定的版本数据库或运行平台。此类补丁通常较小,使用的最为频繁。One-off patch只需要用Opatch工具apply即可,不需要升级/修正数据字典。如在数据库使用过程中出现某些异常后如较常见的ORA-00600、ORA-07445错误等可以通过一次性补丁来搞定。
Critical Patch Update (CPU)&
简称CPU,一般来说CPU包含了Oracle产品安全漏洞的修复补丁集(set of security bug fix),通常一年发布四期,一般是每季度提供一次的一组高优先级修复程序(往往针对安全性问题),对于以前的安全性修复程序而言,这些CPU是累积的,只需要安装最近最后一个就可以,它就包含了之前的所有CPU补丁,但也可包含其他修复程序,目的是解决与非安全性补丁之间的补丁冲突问题(即降低合并请求的必要性)。该类patch的安装和安装one-off patch一样,同样使用”opatch apply”命令来完成。安装完成后应针对既有的数据库(已经创建在使用的数据库),应在数据库级别运行数据字典升级脚本。
Bundled patches (For Windows and Exadata only)&
用于解决在Windows平台无法利用替换共享库文件后relink的方式来更新Oracle binary,所以Oracle特别针对Windows发布区别于Unix上Normal/Molecular CPU的CPU Bundle patch。通常情况下,Bundle Patch会别较大,Windows bundle patches通常每一个季度都会发布。
PSR(Patch Set Release)/Patch Set Update(PSU)&
PSR就是大家常见的大补丁合集,通常1GB左右,也就是oracle版布号的第四位即为PSR号。也就是说oracle版布号的第四位会被修改。每一个PSR是都整合了之前的一些bug,并且经过了严格的测试,通常更新PSR风险相对较小。10.2,10.2.0.1.0是基础发行版,至今已有五个PSR发布,最新10.2的PSR为10.2.0.5.0。&
PSU就是在每个PSR发布之间的补丁,由于新旧PSR之间周期较长,而数据库在运行期间难以保证不会出现新的bug,因此有了PSU。PSU是对于PSR的一个重要补充,每个PSU修改5位版本号的第5位。如,11.1版本升级为11.1.0.7.1;10.2版本为10.2.0.4.2。PSU包含CPU,所以建议尽量安装PSU,PSU通常也是增量的,大部分PSU可以直接安装,但有些PSU则必须要求安装了上一 个版本的PSU之后才能继续安装,要仔细看各个PSU的Readme文档。PSU与CPU一样,定期发布,计划一年发布四次,发布日期与CPU发布日期相同。PSU同样使用Opatch工具安装/删除,命令仍是apply和rollback。一个PSU可视作一个个别补丁,安装和删除操作同样简便。&
[参考3]PSU有三个优势,&
(1) 低风险高价值,PSU包括:
1.测试安装如下PSU,&
- 11.2.0.4.161018 (Oct 2016) Database Patch Set Update (DB PSU) (文档 ID )&
选择操作系统版本进行下载,进入目录中执行opatch apply,
提示patch安装需要OPatch的版本是11.2.0.3.5,使用OPatch version查看当前版本是11.2.0.3.4,所以第一步需要升级OPatch。
[oracle@emrep11 ~]$ /u01/app/oracle/11.2.0.4/dbhome_1/OPatch/opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
2.升级OPatch,
如下选择对应操作系统版本,下载OPatch,p000_Linux-x86-64.zip,
补丁程序: OPatch patch of version 11.2.0.3.5 for Oracle software releases 11.2.0.x (NOV 2013)&
解压缩,并复制至$ORACLE_HOME下,可以提前备份下旧版的OPatch。再执行OPatch version,
[oracle@emrep11 ~]$ /u01/app/oracle/11.2.0.4/dbhome_1/OPatch/opatch version
OPatch Version: 11.2.0.3.6
OPatch succeeded.
升级至11.2.0.3.6。
3.继续安装,
执行失败,从错误信息看,有下面三个可执行程序处于激活状态,
Following executables are active :
/u01/app/oracle/11.2.0.4/dbhome_1/bin/oracle
/u01/app/oracle/11.2.0.4/dbhome_1/lib/libclntsh.so.11.1
/u01/app/oracle/11.2.0.4/dbhome_1/lib/libsqlplus.so
需要停止这些激活的可执行程序,首先查找sqlplus,
接下来需要关闭数据库,以确保libclntsh.so.11.1停止,
仍旧不行,说明仍有进程使用,尝试关闭监听,可参考这篇文章:《opatch error code 73: Prerequisite check “CheckActiveFilesAndExecutables” failed. (文档 ID )》
此时再次执行opatch apply,
4.验证安装,
可以看出已安装了相应的patch。
1.要了解Oracle Patch补丁体系中,各种类型补丁的关系、适用范围,这样才能在需要打补丁的时候选择正确的补丁并完成安装步骤了。&
2.某些补丁要求最低的OPatch版本,OPatch的升级仅需要下载对应操作系统版本的OPatch压缩包,直接解压缩至$ORACLE_HOME即可,以防万一可以备份之前的OPatch。&
3.OPatch有一系列的命令参数,可以查看帮助继续了解,例如有些补丁可以不用停机,在线打使用online参数。
参考文章:&
Patch Set Updates for Oracle Products (文档 ID )&
opatch error code 73: Prerequisite check “CheckActiveFilesAndExecutables” failed. (文档 ID )&
Quick Reference to Patch Numbers for Database PSU, SPU(CPU), Bundle Patches and Patchsets (文档 ID )
阅读(602) | 评论(0) | 转发(1) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。数据恢复、性能优化、迁移升级、故障诊断
今天新装了一套11.2.0.4的RAC,在两个节点同时打GI PSU 11.2.0.4.161018时,节点2顺利过去了,但是节点1却hang住了。
故障如下:
[root@xxxxxxdb01 ~]# opatch auto /tmp/36338 -ocmrf /tmp/ocm.rsp
Executing /oracle/product/11.2.0/grid/perl/bin/perl /oracle/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp/ -patchn
-ocmrf /tmp/ocm.rsp -paramfile /oracle/product/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /oracle/product/11.2.0/grid/cfgtoollogs/opatchauto_08-42-37.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/product/11.2.0/grid/cfgtoollogs/opatchauto_08-42-37.report.log
08:42:37: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/product/11.2.0/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /tmp/11
apply successful for home
/oracle/product/11.2.0/grid
patch /tmp/19
apply successful for home
/oracle/product/11.2.0/grid
patch /tmp/05
apply successful for home
/oracle/product/11.2.0/grid
Starting CRS...
Installing Trace File Analyzer
--& hang住了
2. 处理过程
找了下oracle用户下的进程,发现有个unzip进程比较奇怪
[root@xxxxxxdb01 xxxxxxdb01]# ps -ef | grep oracle
0 08:55 pts/0
00:00:00 tail -f /oracle/product/11.2.0/grid/cfgtoollogs/opatchauto_08-42-37.log
0 09:08 pts/4
00:00:00 grep oracle
00:02:11 /oracle/product/11.2.0/grid/jdk/jre/bin/java -Xms64m -Xmx256m -classpath /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jar/RATFA.jar:/oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jar/je-4.0.103.jar:/oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jar/ojdbc6.jar oracle.rat.tfa.TFAMain /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home
0 08:42 pts/1
00:00:00 /bin/sh /oracle/product/11.2.0/grid/OPatch/opatch auto /tmp/36338 -ocmrf /tmp/ocm.rsp
0 08:42 pts/1
00:00:00 /usr/bin/perl /oracle/product/11.2.0/grid/OPatch/crs/auto_patch.pl -patchdir /tmp/ -patchn
-ocmrf /tmp/ocm.rsp
0 08:42 pts/1
00:00:00 /oracle/product/11.2.0/grid/perl/bin/perl /oracle/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp/ -patchn
-ocmrf /tmp/ocm.rsp -paramfile /oracle/product/11.2.0/grid/crs/install/crsconfig_params
0 08:47 pts/1
00:00:00 /bin/sh /oracle/product/11.2.0/grid/crs/install/tfa_setup.sh -silent -crshome /oracle/product/11.2.0/grid
0 08:47 pts/1
00:00:00 /usr/bin/unzip -q /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_install.29976.zip
进入了/oracle/product/11.2.0/grid/tfa/xxxxxxdb01/目录,测试了下unzip -q tfa_install.29976.zip,发现可以解压。
现在Patch已经在打TFA了,TFA目前的设计是脱离RDBMS和CRS进行设计的。所以就想着先处理了,让GI patch lock掉,后面再处理TFA
[root@xxxxxxdb01 xxxxxxdb01]# kill -9 30100
杀掉这个unzip进程后,OPatch就继续进行下去了,并且CRS也顺利启动
Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.
查看OPatch日志:/oracle/product/11.2.0/grid/cfgtoollogs/opatchauto_08-42-37.log
09:08:47: Command output:
TFA Installation Log will be written to File : /tmp/tfa_install__02_09-08_47_37.log
Starting TFA installation
TFA Build Version: 121270 Build Date:
Installed Build Version: 0 Build Date:
TFA is already installed. Patching /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home...
tfahome_full.tar:
write error (disk full?).
Continue? (y/n/^C) /oracle/product/11.2.0/grid/crs/install/tfa_setup.sh: line
$UNZIP -q $ZFILE
/bin/tar: ./tfa_home/resources/file_type_patterns_internal.xml: Wrote only 9728 of 10240 bytes
/bin/tar: ./tfa_home/resources/components_saas.xml: Cannot write: No space left on device
/bin/tar: ./tfa_home/resources/collect_all_directories.xml: Cannot open: No space left on device
/bin/tar: ./tfa_home/resources/ignorefiles.txt: Cannot open: No space left on device
/bin/tar: ./tfa_home/resources/directory_patterns.xml: Cannot open: No space left on device
/bin/tar: ./tfa_home/resources/directory_patterns_jcs.xml: Cannot open: No space left on device
/bin/tar: ./tfa_home/resources/date_patterns.xml: Cannot open: No space left on device
/bin/tar: ./tfa_home/resources/gdb_commands: Cannot open: No space left on device
可能是磁盘满了,检查文件系统,确实/tmp满了
[grid@xxxxxxdb01 ~]$ df -h
Filesystem
Used Avail Use% Mounted on
/dev/mapper/VolGroup-LogVol00
1% /dev/shm
/dev/mapper/VolGroup-LogVol02
/dev/mapper/VolGroup-LogVol05
/dev/mapper/VolGroup-LogVol04
20M 100% /tmp
/dev/mapper/VolGroup-LogVol01
/dev/mapper/VolGroup-LogVol03
/dev/mapper/VolGroup-lv_oracle
63% /oracle
0% /dev/vx
/dev/vx/dsk/xxxxxxdg/oradata
1% /oradata
/dev/vx/dsk/xxxxxxdg/ocrvote
3% /ocrvote
查看正常节点的OPatch日志:
08:47:39: Installing Trace File Analyzer
08:47:39: Executing cmd: /oracle/product/11.2.0/grid/crs/install/tfa_setup.sh -silent -crshome /oracle/product/11.2.0/grid
08:48:31: Command output:
TFA Installation Log will be written to File : /tmp/tfa_install__02_09-08_47_39.log
Starting TFA installation
TFA Build Version: 121270 Build Date:
Installed Build Version: 0 Build Date:
TFA is already installed. Patching /oracle/product/11.2.0/grid/tfa/xxxxxxdb02/tfa_home...
TFA patching CRS or DB from zipfile is written to /oracle/product/11.2.0/grid/tfa/xxxxxxdb02/tfapatch.log
TFA will be Patched on Node xxxxxxdb02:
Applying Patch on xxxxxxdb02:
Stopping TFA Support Tools...
Shutting down TFA for Patching...
检查TFA的状态,节点1没有tfactl命令
[grid@xxxxxxdb01 ~]$ tfactl print status
-bash: tfactl: command not found
节点2的TFA正常
[grid@xxxxxxdb02 ~]$ tfactl print status
.--------------------------------------------------------------------------------------------------.
| Status of TFA | PID
| Port | Version
| Build ID
| Inventory Status |
+------------+---------------+-------+------+------------+----------------------+------------------+
| xxxxxxdb02 | RUNNING
| 19403 | 5000 | 12.1.2.7.0 |
| COMPLETE
'------------+---------------+-------+------+------------+----------------------+------------------'
3. 处理TFA
TFA Collector – TFA with Database Support Tools Bundle (文档 ID )
从MOS 文档上下载TFA安装包p020_Generic.zip,上传到节点1的/tmp目录。
升级过程如下:只要在节点1上执行,会自动升级节点2的TFA
[root@xxxxxxdb01 tmp]# unzip -q p020_Generic.zip -d ./tfa
[root@xxxxxxdb01 tmp]# cd tfa
[root@xxxxxxdb01 tfa]# ls -l
total 63228
-rwxr-xr-x 1 root root
7 03:12 installTFALite
-rw-r--r-- 1 root root
2096 Nov 23 04:27 README.txt
-rw-r--r-- 1 root root
1577349 Nov 21 12:26 TFA_User_Guide_12.1.2.8.4.pdf
[root@xxxxxxdb01 tfa]# ./installTFALite
TFA Installation Log will be written to File : /tmp/tfa_install__02_09-09_28_24.log
Starting TFA installation
TFA HOME : /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home
TFA Build Version: 121284 Build Date:
Installed Build Version: 0 Build Date:
TFA is already installed. Patching /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home...
TFA patching CRS or DB from zipfile extracted to /tmp/.19751.tfa
TFA patching CRS or DB from zipfile is written to /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfapatch.log
TFA will be Patched on:
xxxxxxdb01
xxxxxxdb02
Do you want to continue with patching TFA? [Y|N] [Y]: Y
Checking for ssh equivalency in xxxxxxdb02
xxxxxxdb02 is configured for ssh user equivalency for root user
Creating ZIP: /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/internal/tfapatch.zip
Using SSH to patch TFA to remote nodes :
Applying Patch on xxxxxxdb02:
TFA_HOME: /oracle/product/11.2.0/grid/tfa/xxxxxxdb02/tfa_home
Stopping TFA Support Tools...
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Shutting down TFA
oracle-tfa stop/waiting
Killing TFA running with pid 19403
Successfully shutdown TFA..
Copying files from xxxxxxdb01 to xxxxxxdb02...
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Current version of Berkeley DB in
is 5.0.84, so no upgrade required
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Running commands to fix init.tfa and tfactl in xxxxxxdb02...
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Updating init.tfa in xxxxxxdb02...
Authorized only. All activity will be monitored and reported
Starting TFA in xxxxxxdb02...
Authorized only. All activity will be monitored and reported
Starting TFA..
oracle-tfa start/running, process 13859
Waiting up to 100 seconds for TFA to be started..
Successfully started TFA Process..
TFA Started and listening for commands
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Authorized only. All activity will be monitored and reported
Enabling Access for Non-root Users on xxxxxxdb02...
Authorized only. All activity will be monitored and reported
Applying Patch on xxxxxxdb01:
Stopping TFA Support Tools...
Shutting down TFA for Patching...
Shutting down TFA
oracle-tfa stop/waiting
Killing TFA running with pid 16513
Successfully shutdown TFA..
Renaming /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jar to /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jlib
Adding INSTALL_TYPE = GI to tfa_setup.txt
Copying /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/output/ to /oracle/grid/tfa/xxxxxxdb01/
The current version of Berkeley DB is 4.0.103
Copying je-4.1.27.jar to /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jlib/
Copying je-5.0.84.jar to /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jlib/
Running DbPreUpgrade_4_1 utility
Output of upgrade : Pre-upgrade succeeded
Copying TFA Certificates...
Moving config.properties.bkp to config.properties
Running commands to fix init.tfa and tfactl in localhost
Starting TFA in xxxxxxdb01...
Creating Sym Link /etc/rc.d/rc0.d/K17init.tfa to /etc/init.d/init.tfa
Creating Sym Link /etc/rc.d/rc1.d/K17init.tfa to /etc/init.d/init.tfa
Creating Sym Link /etc/rc.d/rc2.d/K17init.tfa to /etc/init.d/init.tfa
Creating Sym Link /etc/rc.d/rc4.d/K17init.tfa to /etc/init.d/init.tfa
Creating Sym Link /etc/rc.d/rc6.d/K17init.tfa to /etc/init.d/init.tfa
Starting TFA..
oracle-tfa start/running, process 21014
Waiting up to 100 seconds for TFA to be started..
Successfully started TFA Process..
TFA Started and listening for commands
Removing /oracle/product/11.2.0/grid/tfa/xxxxxxdb01/tfa_home/jlib/je-4.0.103.jar
Enabling Access for Non-root Users on xxxxxxdb01...
Adding default users to TFA Access list...
.------------------------------------------------------------------.
| TFA Version | TFA Build ID
| Upgrade Status |
+------------+-------------+----------------------+----------------+
| xxxxxxdb01 |
12.1.2.8.4 |
| UPGRADED
| xxxxxxdb02 |
12.1.2.8.4 |
| UPGRADED
'------------+-------------+----------------------+----------------'
升级完检查两个节点的TFA状态,确认没有问题
[grid@xxxxxxdb01 ~]$ tfactl print status
.--------------------------------------------------------------------------------------------------.
| Status of TFA | PID
| Port | Version
| Build ID
| Inventory Status |
+------------+---------------+-------+------+------------+----------------------+------------------+
| xxxxxxdb01 | RUNNING
| 21071 | 5000 | 12.1.2.8.4 |
| COMPLETE
| xxxxxxdb02 | RUNNING
| 13916 | 5000 | 12.1.2.8.4 |
| COMPLETE
'------------+---------------+-------+------+------------+----------------------+------------------'
[grid@xxxxxxdb02 ~]$ tfactl print status
.--------------------------------------------------------------------------------------------------.
| Status of TFA | PID
| Port | Version
| Build ID
| Inventory Status |
+------------+---------------+-------+------+------------+----------------------+------------------+
| xxxxxxdb02 | RUNNING
| 13916 | 5000 | 12.1.2.8.4 |
| COMPLETE
| xxxxxxdb01 | RUNNING
| 21071 | 5000 | 12.1.2.8.4 |
| COMPLETE
'------------+---------------+-------+------+------------+----------------------+------------------'
4. 检查软件状态
这毕竟不是正常的Patch过程,处理完后,检查一下两个节点的软件安装包
[grid@xxxxxxdb01 ~]$ cluvfy comp software -n xxxxxxdb01,xxxxxxdb02 -verbose
Verifying software
Check: Software
1178 files verified
Software check passed
Verification of software was successful.
[grid@xxxxxxdb02 ~]$ cluvfy comp software -n xxxxxxdb01,xxxxxxdb02 -verbose
Verifying software
Check: Software
1178 files verified
Software check passed
Verification of software was successful.
检查PSU补丁信息
[grid@xxxxxxdb01 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory | grep &Patch&
Oracle Interim Patch Installer version 11.2.0.3.12
OPatch version
: 11.2.0.3.12
: applied on Thu Feb 09 08:47:32 CST 2017
Unique Patch ID:
Patch description:
&ACFS Patch Set Update : 11.2.0.4.502505)&
: applied on Thu Feb 09 08:47:09 CST 2017
Unique Patch ID:
Patch description:
&OCW Patch Set Update : 11.2.0.4.054319)&
: applied on Thu Feb 09 08:46:24 CST 2017
Unique Patch ID:
Patch description:
&Database Patch Set Update : 11.2.0.4.006111)&
; &Database Patch Set Update : 11.2.0.4.054359)&
; &Database Patch Set Update : 11.2.0.4.502456)&
; &Database Patch Set Update : 11.2.0.4.948347)&
; &Database Patch Set Update : 11.2.0.4.8 ()&
; &Database Patch Set Update : 11.2.0.4.7 ()&
; &Database Patch Set Update : 11.2.0.4.6 ()&
; &Database Patch Set Update : 11.2.0.4.5 ()&
; &Database Patch Set Update : 11.2.0.4.4 ()&
; &Database Patch Set Update : 11.2.0.4.3 ()&
; &Database Patch Set Update : 11.2.0.4.2 ()&
; &Database Patch Set Update : 11.2.0.4.1 ()&
OPatch succeeded.
cluvfy和OPatch检查都正常,所以应该没有问题
关于紫砂壶
感悟技术人生
此条目发表在分类目录,贴了标签。将加入收藏夹。
网站计数器11780总阅览数:40今天阅读数量:110昨天阅读数量:1062上周阅读数量:2708每月阅读量:8821总访问数:如何联系我
2017年二月[Oracle] CPU/PSU补丁安装详细教程
字体:[ ] 类型:转载 时间:
Oracle CPU的全称是Critical Patch Update, Oracle对于其产品每个季度发行一次安全补丁包,通常是为了修复产品中的安全隐患,以下是对CPU/PSU补丁安装的具体操作步骤进行了详细的分析介绍,需要的朋友可以参考
什么是CPU/PSUOracle CPU的全称是Critical Patch Update, Oracle对于其产品每个季度发行一次安全补丁包,通常是为了修复产品中的安全隐患。Oracle PSU的全称是Patch Set Update,Oracle对于其产品每个季度发行一次的补丁包,包含了bug的修复。Oracle选取被用户下载数量多,且被验证过具有较低风险的补丁放入到每个季度的PSU中。在每个PSU中不但包含Bug的修复而且还包含了最新的CPU。PSU通常随CPU一起发布。
CPU是累积的(Cumulative),即最新的CPU补丁已经包含以往的CPU补丁,所以只要安装最新的CPU补丁即可。PSU通常也是增量的,大部分PSU可以直接安装,但有些PSU则必须要求安装了上一 个版本的PSU之后才能继续安装,要仔细看各个PSU的Readme文档。
如何下载CPU/PSU
注意:要下载CPU/PSU,必须要有Oracle Support账号才行!到Oracle CPU主页 ,可以看到每个季度发布的CPU补丁列表(如下图所示),根据你的需要选择相应的CPU补丁即可,这里选择July2011年的补丁。每个补丁只针对特定的数据库版本,你要找到对应的数据库版本(如下图所示),这里的数据库版本为11.2.0.1,如果找不到,说明该补丁不支持该版本数据库。
右边点击Database链接,就是该补丁的一个详细说明文档,找到3.1.3 Oracle Database,并点击相应的数据库版本(如下图所示)
在相应的数据库版本里,可以看到各个平台下CPU和PSU版本号,前面已经说过,PSU包含CPU,所以建议尽量安装PSU,注意:这里的UNIX平台也包括Linux
点击上面的版本号,会自动跳到Oracle Support下载页面,如下图所示。选择相应的平台后,点击Readme可以查看Readme文档,点击Download下载
阅读Readme文档每个CPU/PSU都有一个Readme文档,关于该CPU/PSU的所有信息都在Readme文档里,一定要仔细阅读。有两个部分要特别注意:1)OPatch的版本,你可以通过opatch version命令查看Oracle Home当前的OPatch版本,如果低于Readme规定的最低版本,一定要先升级OPatch才能打补丁。2)打Patch步骤:基本上所有的CPU/PSU都大同小异,具体步骤将在下面的例子中展示。安装CPU/PSU补丁1)事先检查:查看数据库打补丁前信息,保留现场在打补丁前最好把数据库的一些基本信息保留下来,以备不时之需。 代码如下:set line 150set pagesize 99col action_time for a30col action for a30col comments for a90col object_name for a30col object_type for a30col comp_name for a50col comp_id for a20--查看实例名sys@ORCL&select instance_name,status from v$INSTANCE_NAME&&& STATUS---------------- ------------orcl&&&&&&&&&&&& OPEN--查看数据库版本sys@ORCL&select * from v$BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE&&& 11.2.0.1.0&&&&& ProductionTNS for Linux: Version 11.2.0.1.0 - ProductionNLSRTL Version 11.2.0.1.0 - Production--查看数据库大小sys@ORCL&select sum(bytes)/||'M' from dba_SUM(BYTES)/||'M'-----------------------------------------M--查看组件信息sys@ORCL&select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;COMP_ID&&&&&&&&&&&&& COMP_NAME&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& VERSION&&&&&&&&&&&&&&&&&&&&&&& STATUS-------------------- -------------------------------------------------- ------------------------------ ----------------------OWB&&&&&&&&&&&&&&&&& OWB&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDAPEX&&&&&&&&&&&&&&&& Oracle Application Express&&&&&&&&&&&&&&&&&&&&&&&& 3.2.1.00.10&&&&&&&&&&&&&&&&&&& VALIDEM&&&&&&&&&&&&&&&&&& Oracle Enterprise Manager&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDAMD&&&&&&&&&&&&&&&&& OLAP Catalog&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDSDO&&&&&&&&&&&&&&&&& Spatial&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDORDIM&&&&&&&&&&&&&&& Oracle Multimedia&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDXDB&&&&&&&&&&&&&&&&& Oracle XML Database&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDCONTEXT&&&&&&&&&&&&& Oracle Text&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDEXF&&&&&&&&&&&&&&&&& Oracle Expression Filter&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDRUL&&&&&&&&&&&&&&&&& Oracle Rules Manager&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDOWM&&&&&&&&&&&&&&&&& Oracle Workspace Manager&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDCATALOG&&&&&&&&&&&&& Oracle Database Catalog Views&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDCATPROC&&&&&&&&&&&&& Oracle Database Packages and Types&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDJAVAVM&&&&&&&&&&&&&& JServer JAVA Virtual Machine&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDXML&&&&&&&&&&&&&&&&& Oracle XDK&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDCATJAVA&&&&&&&&&&&&& Oracle Database Java Packages&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDAPS&&&&&&&&&&&&&&&&& OLAP Analytic Workspace&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALIDXOQ&&&&&&&&&&&&&&&&& Oracle OLAP API&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 11.2.0.1.0&&&&&&&&&&&&&&&&&&&& VALID18 rows selected.--查看补丁情况sys@ORCL&select ACTION_TIME, ACTION, COMMENTS from sys.DBA_REGISTRY_HISTORY;no rows selected--查看无效对象sys@ORCL&select count(*) from dba_objects where status&&'VALID';& COUNT(*)----------&&&&&& 123sys@ORCL& select object_name,object_type,owner,status from dba_objects where status&&'VALID';sys@ORCL&spool off2)备份数据库这里对全库进行备份,以防打补丁出现意外,可以从备份集中恢复数据。先关闭监听器,关闭数据库实例,将其启到mount状态,然后用rman进行冷备。3)备份Oracle软件把Oracle软件打包备份4)安装Opatch 代码如下:--首先,查看当前的OPatch版本[oracle@data ~]$ opatch versionInvoking OPatch 11.1.0.6.6OPatch Version: 11.1.0.6.6OPatch succeeded.--如果当前的Opatch版本不够,下载最新的Opatch,覆盖原来的opatch即可[oracle@data psu_jul_2011]$ unzip p000_Linux-x86-64.zip--unzip之后,在当前文件夹下出现OPatch文件夹[oracle@data psu_jul_2011]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_[oracle@data psu_jul_2011]$ cp -r ./OPatch $ORACLE_HOME[oracle@data psu_jul_2011]$ opatch versionOPatch Version: 11.2.0.3.4OPatch succeeded.5)安装补丁(Oracle软件部分)首先,通过opatch lsinventory 查看之前打过的补丁信息。然后解压缩补丁文件: 代码如下:[oracle@data psu_jul_2011]$ unzip p010_Linux-x86-64.zip[oracle@data psu_jul_2011]$ cd 最后在补丁的主目录下执行opatch apply,等待5~10分钟即可(注意:一定要先完全关闭数据库和监听器) 代码如下:[oracle@data ]$ pwd/home/oracle/psu_jul_8[oracle@data ]$ opatch apply如果最后有warnings一般都没什么问题,只要不是error就好。6)安装补丁(数据库部分)这步比较简单,就是跑catbundle脚本,但时间比较长,10分钟左右(视机器性能而定) 代码如下:cd $ORACLE_HOME/rdbms/adminsqlplus /nologSQL& CONNECT / AS SYSDBASQL& STARTUPSQL& @catbundle.sql psu applySQL& QUIT7)重新编译CPU相关视图 (如果是PSU可略过次步骤)该步骤在一个数据库上永远只需要执行一次,是为了完成在2008年1月份第一次发布CPU补丁时的后续工作,如果在安装以前的PSU或者CPU时执行过这个步骤那么就可以无需再次执行,另外,即使不执行该步骤,数据库也是正常运行的,只不过意味着2008年1月份的 CPU补丁没有正常结束安装。 代码如下:SQL& SELECT * FROM registry$history where ID = '6452863';上面这条语句用于判断是否已经执行过,如果有行数返回,说明已经执行过,可跳过该步骤;如果没有行数返回,则可根据以下步骤重新编译CPU/PSU相关视图: 代码如下:cd $ORACLE_HOME/cpu/view_recompile sqlplus / as sysdba SQL& @recompile_precheck_jan2008cpu.sql SQL& SHUTDOWN IMMEDIATE SQL& STARTUP UPGRADE SQL& @view_recompile_jan2008cpu.sql SQL& SHUTDOWN; SQL& STARTUP; SQL& QUIT8)事后检查该步骤可以和第1)步的事先检查对照先编译无效对象: 代码如下:@?/rdbms/admin/utlrp.sql 代码如下:set line 150set pagesize 99col action_time for a30col action for a30col comments for a90col object_name for a30col object_type for a30col comp_name for a50col comp_id for a20SQL& spool post_check.logSQL& select instance_name,status from v$SQL& select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;SQL& select ACTION_TIME, ACTION, COMMENTS from DBA_REGISTRY_HISTORY;SQL& select owner,object_name,object_type,status from dba_objects where status&&'VALID';SQL& select count(*) from dba_objects where status&&'VALID';SQL& spool off
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具}

我要回帖

更多关于 psu补丁 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信