查看ORACLE数据库的版本以及补丁情况,可以通过opatch lsinventory命令来查看,Linux版本和Windows版本几乎差不多(测试的两台机器都没有打补丁。呵呵!):

先看一下Windows平台的设置:

首先转到ORACLE_HOME目录,然后切换到OPatch目录:(如下所示)

E:\>cd E:\app\kerry\product\11.2.0\dbhome_1

E:\app\kerry\product\11.2.0\dbhome_1>cd OPatch

如果首先没有设置ORACLE_HOME目录,则会报如下错误:

E:\app\kerry\product\11.2.0\dbhome_1\OPatch>opatch lsinventory

Oracle Home is not set. OPatch cannot proceed!

OPatch succeeded.
ORACLE查看数据库安装补丁情况-LMLPHP
ORACLE查看数据库安装补丁情况-LMLPHP



Linux平台查看版本补丁

首先查看一下ORACLE_HOME目录,如下所示:

[oracle@DB-Server ~]$ echo $ORACLE_HOME

/database/product/dbhome_1

[oracle@DB-Server ~]$

[oracle@DB-Server OPatch]$ ./opatch lsinventory

Invoking OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0

Copyright (c) 2005, Oracle Corporation. All rights reserved..

Oracle Home : /database/product/dbhome_1

Central Inventory : /database/oraInventory

from : /database/product/dbhome_1/oraInst.loc

OPatch version : 10.2.0.1.0

OUI version : 10.2.0.1.0

OUI location : /database/product/dbhome_1/oui

Log file location : /database/product/dbhome_1/cfgtoollogs/opatch/opatch-2012_Jun_02_10-00-07-CST_Sat.log

Lsinventory Outputfile location :/database/product/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory-2012_Jun_02_10-00-07-CST_Sat.txt

--------------------------------------------------------------------------------

Installed Top-level Products (1):

Oracle Database 10g 10.2.0.1.0

There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------------

OPatch succeeded.


*****************************************

OPatch cannot find a valid oraInst.loc file to locate Central Inventory - 516Forever713

命令:opatch lsinventory用于查看数据库所打Patch的列表。但运行的时候发现错误:
ORACLE查看数据库安装补丁情况-LMLPHP

解决方法:

原因是opatch在默认目录下找不到oraInst.loc文件,对于Unix系统来说 oraInst.loc的默认位置是: /etc/oraInst.loc 或者 /var/opt/oracle/oraInst.loc 

这里我们可以需要指定具体的oraInst.loc文件位置给opatch。

命令:opatch lsinventory -invPtrLoc /u01/oracle/mc3yd213/db/tech_st/11.1.0/oraInst.loc

(/u01/oracle/mc3yd213/db/tech_st/11.1.0为我数据库的ORACLE_HOME)
ORACLE查看数据库安装补丁情况-LMLPHP

09-19 18:22
查看更多