您的位置:首页 > 大数据 > 人工智能

OPatch failed with error code 2

2018-03-02 15:44 302 查看
在检查补丁冲突时报错code 2
[oracle@DBMONITOR01 ~]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /data/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /data/app/oraInventory
   from           : /data/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /data/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-03-02_14-12-21PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" is not executed.

The details are:
Unable to create Patch Object.
Exception occured : PatchObject constructor: Input file "/home/oracle/.cache/etc/config/actions" or "/home/oracle/.cache/etc/config/inventory" does not exist.

OPatch failed with error code 2
--冲突检查报错code 2

[oracle@DBMONITOR01 bin]$ opatch version
OPatch Version: 11.2.0.3.12

OPatch succeeded.
--OPatch版本是足够的,(readme自述文件:You must use the OPatch utility version 11.2.0.3.6 or later to apply this patch)

--使用绝对路径检测冲突
[oracle@DBMONITOR01 bin]$ opatch prereq CheckConflictAgainstOHWithDetail  -phBaseDir /home/oracle/26925576/
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /data/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /data/app/oraInventory
   from           : /data/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /data/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-03-02_14-22-04PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
--通过检测,然后我使用了相对路径再检测了一次
[oracle@DBMONITOR01 bin]$ cd
[oracle@DBMONITOR01 ~]$ cd 26925576/
[oracle@DBMONITOR01 26925576]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /data/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /data/app/oraInventory
   from           : /data/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /data/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-03-02_14-23-12PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
--所以OPatch failed with error code 2的错误原因很简单,因为没有进入到补丁目录中

--下面是我安装补丁的过程,打的是单节点db psu
[oracle@DBMONITOR01 26925576]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation.  All rights reserved.
...

Composite patch 26925576 successfully applied.
OPatch Session completed with warnings.
Log file location: /data/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-03-02_14-24-20PM_1.log

OPatch completed with warnings.

cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba

SQL>  @catbundle.sql psu apply
...
Updating registry...
SQL> INSERT INTO registry$history
  2    (action_time, action,
  3     namespace, version, id,
  4     bundle_series, comments)
  5  VALUES
  6    (SYSTIMESTAMP, 'APPLY',
  7     SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'),
  8     '11.2.0.4',
  9     180116,
 10     'PSU',
 11     'PSU 11.2.0.4.180116');

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/data/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_BTNPRO_APPLY_2018Mar02_15_22_21.log
SQL> 

SQL>  @utlrp.sql
...
PL/SQL procedure successfully completed.

Function dropped.

FAILED CHECK FOR PACKAGE BODY WWV_FLOW_HELP

PL/SQL procedure successfully completed.

SQL> SQL> 

--检查注册表中的psu版本,还可以使用opatch lsinv查看
SQL> col comments for a50
SQL> select namespace,version,comments  from dba_registry_history;

NAMESPACE                      VERSION                        COMMENTS
------------------------------ ------------------------------ --------------------------------------------------
SERVER                         11.2.0.4                       PSU 11.2.0.4.180116
SERVER                         11.2.0.4                       PSU 11.2.0.4.180116
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐