1、登陆mos站点下载最新版本的 OPatch补丁,这里以p6880880_102000_Linux-x86-64.zip补丁为例。

https://updates.oracle.com/download/6880880.html

如何下载并安装最新版本的 OPatch_第1张图片


2、上传补丁至服务器,并移动补丁至数据库软件安装目录。

#mv p6880880_102000_Linux-x86-64.zip $ORACLE_HOME


3、切换用户至oracle用户,进入$ORACLE_HOME安装补丁。

[oracle@server ~]$ cd /home/oracle/orahome/

[oracle@server orahome]$ mv OPatch OPatch.old

[oracle@server orahome]$ unzip p6880880_102000_Linux-x86-64.zip 

Archive:  p6880880_102000_Linux-x86-64.zip

   creating: OPatch/

   creating: OPatch/ocm/

 extracting: OPatch/ocm/ocm.zip      

   creating: OPatch/ocm/lib/

  inflating: OPatch/ocm/lib/osdt_jce.jar  

  inflating: OPatch/ocm/lib/osdt_core3.jar  

  inflating: OPatch/ocm/lib/emocmclnt-14.jar  

  inflating: OPatch/ocm/lib/emocmutl.jar  

   creating: OPatch/ocm/bin/

  inflating: OPatch/ocm/bin/emocmrsp  

  inflating: OPatch/ocm/ocm_platforms.txt  

   creating: OPatch/crs/

   creating: OPatch/crs/log/

  inflating: OPatch/crs/patch112.pl  

  inflating: OPatch/crs/crsdelete.pm  

  inflating: OPatch/crs/crspatch.pm  

  inflating: OPatch/crs/s_crsconfig_defs  

  inflating: OPatch/crs/crsconfig_lib.pm  

  inflating: OPatch/crs/oracss.pm    

  inflating: OPatch/crs/auto_patch.pl  

  inflating: OPatch/crs/s_crsconfig_lib.pm  

  inflating: OPatch/opatch           

   creating: OPatch/opatchprereqs/

   creating: OPatch/opatchprereqs/opatch/

  inflating: OPatch/opatchprereqs/opatch/runtime_prereq.xml  

  inflating: OPatch/opatchprereqs/opatch/opatch_prereq.xml  

  inflating: OPatch/opatchprereqs/opatch/rulemap.xml  

  inflating: OPatch/opatchprereqs/prerequisite.properties  

   creating: OPatch/opatchprereqs/oui/

  inflating: OPatch/opatchprereqs/oui/knowledgesrc.xml  

  inflating: OPatch/opatch.ini       

  inflating: OPatch/emdpatch.pl      

  inflating: OPatch/opatch.pl        

   creating: OPatch/jlib/

  inflating: OPatch/jlib/opatchprereq.jar  

  inflating: OPatch/jlib/opatchactions.jar  

  inflating: OPatch/jlib/opatchutil.jar  

  inflating: OPatch/jlib/opatchfmw.jar  

  inflating: OPatch/jlib/opatchext.jar  

  inflating: OPatch/jlib/opatch.jar  

  inflating: OPatch/opatch.bat       

   creating: OPatch/docs/

  inflating: OPatch/docs/Prereq_Users_Guide.txt  

  inflating: OPatch/docs/FAQ         

  inflating: OPatch/docs/Users_Guide.txt  

  inflating: OPatch/README.txt       

[oracle@server orahome]$ cd OPatch

[oracle@server OPatch]$ ./opatch version

Invoking OPatch 10.2.0.5.1

OPatch Version: 10.2.0.5.1

OPatch succeeded.

[oracle@server OPatch]$

4、可以使用绝对路径来启动 OPatch:

[oracle@server OPatch]$ $ORACLE_HOME/OPatch/opatch version

Invoking OPatch 10.2.0.5.1


OPatch Version: 10.2.0.5.1


OPatch succeeded.

[oracle@server OPatch]$


或者可以把 OPatch 所在的目录加到 PATH 这个环境变量中,之后就可以在任何目录运行 OPatch 命令(opatch )而不需要指定绝对路径

For Korn / Bourne shell:

$ export PATH=$PATH:$ORACLE_HOME/OPatch