第一种方法,使用linux命令:
[oracle@kel ~]$ find ./* -type f -name "opatch" ./product/10.2.0/db_1/OPatch/opatch
第二种方法,使用:
[oracle@kel ~]$ echo $ORACLE_HOME /home/oracle/product/10.2.0/db_1 [oracle@kel ~]$ cd $ORACLE_HOME [oracle@kel db_1]$ cd OPatch/ [oracle@kel OPatch]$ ls opatch opatch
2、查看数据库版本及补丁信息
进入到OPach目录之后,使用命令:
[oracle@kel OPatch]$ pwd /home/oracle/product/10.2.0/db_1/OPatch [oracle@kel 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 : /home/oracle/product/10.2.0/db_1 Central Inventory : /home/oracle/oraInventory from : /home/oracle/product/10.2.0/db_1/oraInst.loc OPatch version : 10.2.0.1.0 OUI version : 10.2.0.1.0 OUI location : /home/oracle/product/10.2.0/db_1/oui Log file location : /home/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2013_May_12_07-38-54-PDT_Sun.log Lsinventory Output file location : /home/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2013_May_12_07-38-54-PDT_Sun.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.
从而可以看到当前数据库的版本为10.2.0.1.0
3、使用opatch来给数据库打补丁
进入补丁目录之后,使用命令:
$ORACLE_HOME/OPatch/opach apply
会有询问是否要更新文件,选择Y,然后即可
最后可用用$ORACLE_HOME/OPatch/opach lsinventory来进行检查,看是否成功的给数据库打上补丁
4、什么叫Opatch?
Opatch是oracle支持的Oracle临时补丁的安装实用程序。是针对Oracle数据库第二版9.2.0后安装临时补丁。Opatch是一个基于Perl的程序。
5、对数据库进行升级
将升级文件上传到oracle服务器之后,进行解压
然后进入到解压之后的路径之后
直接输入命令:
./runInstaller即可进行数据库升级,然后利用
$ORACLE_HOME/OPatch/opatch lsinventory来进行数据库检查,看是否升级成功。