熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

教你快速掌握如何使用Opatch打補丁

2022-06-13   來源: Oracle 

  在實際的工作和學習中很多人都會發現有些Patch沒有setup安裝程序本文中我們將詳細的介紹如何使用Oracle的opatch工具來進行安裝

  

  下載

  

  Opatch的最新版本可以從Metalink下載參考 Note:

  

  (Opatch Where Can I Find the Latest Version of Opatch?)

  

  

  准備工作

  

  # You must have Perl (or later)

  

  # installed under the ORACLE_HOME or elsewhere within the host

  

  # environment OPatch is no longer included in patches as of

  

  # Refer to the following link for details on Perl and OPatch:

  

  # tabase_id=NOT&p_id=

  

  下載Optach後上傳到$ORACLE_HOME

  

  [/app/oracle/product//OPatch]$chmod *

  

  [/app/oracle/product//OPatch]$ opatch version

  

  Invoking OPatch

  

  

  OPatch Version:

  

  

  OPatch succeeded

  

  

  [/app/oracle/product//OPatch]$ opatch lsinventory

  

  Invoking OPatch

  

  

  Oracle Interim Patch Installer version

  

  Copyright (c) Oracle Corporation All rights reserved

  

  

  Oracle Home : /app/oracle/product/

  

  Central Inventory : /app/oracle/oraInventory

  

  from : /var/opt/oracle/oraInstloc

  

  OPatch version :

  

  OUI version :

  

  OUI location : /app/oracle/product//oui

  

  Log file location : /app/oracle/product//cfgtoollogs/opatch/opatch_PMlog

  

  

  LsInventorySession failed:

  

  The Oracle Home does not meet OUI version requirement

  

  This OPatch (version ) detects OUI version in the home

  

  It requires OUI version or above

  

  

  OPatch failed with error code

  

  原因Opatch的版本過高

  

  下載新的Opatch重新執行opatch lsinventory

  

  [/app/oracle/product//OPatch]$ opatch lsinventory

  

  Oracle Interim Patch Installer version

  

  Copyright (c) Oracle Corporation All Rights Reserved

  

  

  We recommend you refer to the OPatch documentation under

  

  OPatch/docs for usage reference We also recommend using

  

  the latest OPatch version For the latest OPatch version

  

  and other support related issues please refer to document

  

   which is viewable from

  

  

  Oracle Home : /app/oracle/product/

  

  Oracle Home Inventory : /app/oracle/product//inventory

  

  Central Inventory : /app/oracle/oraInventory

  

  from : /var/opt/oracle/oraInstloc

  

  OUI location : /app/oracle/product//oui

  

  OUI shared library : /app/oracle/product//oui/lib/hpunix/liboraInstallersl

  

  Java location : /app/oracle/product//jre//bin/java

  

  Log file location : /app/oracle/product//patch_storage//*log

  

  

  Creating log file /app/oracle/product//patch_storage/LsInventory___log

  

  

  Result:

  

  

  

  There is no Interim Patch

  

  

  

  

  

  OPatch succeeded

  

  

  具體范例及遇到的問題

  

  下面以打補丁為例

  

  [/app/oracle/product//patches/]$opatch apply

  

  報錯

  

  Invoking fuser to check for active processes

  

  

  Invoking fuser on /app/oracle/product//bin/oracle

  

  Problems when checking for files that are active

  

  There were problems when checking for active processes on critical files

  

  

  The patch tool runs the command fuser to check that critical files are not in use Make sure fuser is available and executable on your PATH

  

  

  

  ERROR: OPatch failed during prereqs check

  

  原因為fuser沒有執行權限su root

  

  /usr/sbin#chmod +x fuser

  

  重新命令打Patch成功

  

  用opatch lsinventory顯示打patch結果

  

  [/app/oracle/product//OPatch]$ opatch lsinventory

  

  

  Oracle Interim Patch Installer version

  

  Copyright (c) Oracle Corporation All Rights Reserved

  

  

  We recommend you refer to the OPatch documentation under

  

  OPatch/docs for usage reference We also recommend using

  

  the latest OPatch version For the latest OPatch version

  

  and other support related issues please refer to document

  

   which is viewable from

  

  

  Oracle Home : /app/oracle/product/

  

  Oracle Home Inventory : /app/oracle/product//inventory

  

  Central Inventory : /app/oracle/oraInventory

  

  from : /var/opt/oracle/oraInstloc

  

  OUI location : /app/oracle/product//oui

  

  OUI shared library : /app/oracle/product//oui/lib/hpunix/liboraInstallersl

  

  Java location : /app/oracle/product//jre//bin/java

  

  Log file location : /app/oracle/product//patch_storage//*log

  

  

  Creating log file /app/oracle/product//patch_storage/LsInventory___log

  

  

  Result:

  

  

  

  Installed Patch List:

  

  =====================

  

  ) Patch applied on Wed Feb :: GMT+:

  

  [ Base Bug(s): ]

  

  OPatch succeeded

  

  

  最後通過opatch查看數據庫各組件版本

  

  [/app/oracle/product//OPatch]$ opatch lsinventory –details


From:http://tw.wingwit.com/Article/program/Oracle/201311/18427.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.