首页 > 数据库 > Oracle > 使用Oracle Opatch打补丁 even
在opatch目录下,可以使用指南文件(Users_Guide.txt),其中有详细的命令格式和使用示例,读者可以参考。Opatch执行操作时,除在屏幕输出结果外,还生成日志文件。日志文件的路径和文件名格式如下:
下面介绍下具体的操作步骤:
准备工作:
1: MOS上下载对应的补丁(support.oracle.com);
2:
检查数据库环境:
每个补丁的应用都有一定的环境,包含数据库版本,Opatch版本,我们通过命令opatch
进入补丁文件目录(以6544463为例)
使用opatch Isinventory检查环境
[oracle@even 6544463]$ opatch lsinventory
Invoking OPatch 10.2.0.4.2
Lsinventory Output file location :
/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-02-24_16-32-18PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database
10g
Oracle Database 10g Release 2 Patch Set
3
There are 2 products installed in
this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
安装补丁:
补丁的安装非常简单,直接运行下opatch apply即可。
[oracle@even 6544463]$ opatch
apply
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
OPatch
version
OUI
version
OUI
location
Log file location :
/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2014-02-24_16-34-26PM.log
ApplySession applying interim
patch 6544463to OH /u01/app/oracle/product/10.2.0/db_1
Running prerequisite checks...
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)
Is the local system ready for patching?
[y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the
Oracle Home
Backing up files affected by the patch 6544463 for restore. This
might take a while...
Backing up files affected by the patch 6544463 for rollback. This
might take a while...
Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file
"/u01/app/oracle/product/10.2.0/db_1/lib/libn10.a"
Updating archive file
"/u01/app/oracle/product/10.2.0/db_1/lib32/libn10.a"
Running make for target client_sharedlib
Running make for target ioracle
ApplySession adding interim patch 6544463 to inventory
Verifying the update...
Inventory check OK: Patch ID 6544463 is registered in Oracle Home
inventory with proper meta-data.
Files check OK: Files from Patch ID 6544463 are present in Oracle
Home.
The local system has been patched and can be restarted.
OPatch
succeeded.
核实是否安装成功
[oracle@even 6544463]$ opatch lsinventory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, 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.4.2
OUI version : 10.2.0.4.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/opatch2014-02-24_16-32-18PM.log
Lsinventory Output file location :
/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-02-24_16-32-18PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database
10g
Oracle Database 10g Release 2 Patch Set
3
There are 2 products installed in this Oracle Home.
Interim patches (1) :
Patch
最后,有些补丁在安装完成后,需要将数据库重启下。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21390491/viewspace-1114774/ ,如需转载,请注明出处,否则将追究法律责任。