Tuesday, August 5, 2014

ORA-20001: Latest xml inventory is not loaded into table

Version:

Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production

Issue:

April 2014 PSU - Patch 18522516 - 12.1.0.1.4 Patch Set Update is applied successfully to the DB Home. On the post patching step, to loadi modified SQL files into the database, datapatch is invoked and it results in the error.

Error:

bash-4.1$ ./datapatch -verbose
SQL Patching tool version 12.1.0.1.0 on Tue Aug  5 01:08:49 2014
Copyright (c) 2014, Oracle.  All rights reserved.

Connecting to database...OK
Determining current state...
Currently installed SQL Patches: 
DBD::Oracle::st execute failed: ORA-20001: Latest xml inventory is not loaded into table
ORA-06512: at "SYS.DBMS_QOPATCH", line 1011
ORA-06512: at line 4 (DBD ERROR: OCIStmtExecute) [for Statement "DECLARE
       x XMLType;
     BEGIN
       x := dbms_qopatch.get_pending_activity;
       ? := x.getStringVal();
     END;" with ParamValues: :p1=undef] at /u01/app/product/12.1.0/dbhome_1/sqlpatch/sqlpatch.pm line 1227.

Description:

An error lookup just shows that latest inventory file is not loaded. It could be due to some kind of permission issues with the QOpatch directory and files under it. Database uses two directories to pint to $ORACLE_HOME/QOPatch location, OPATCH_SCRIPT_DIR and OPATCH_LOG_DIR.

Solution:

Followed the Oracle support Doc (Doc ID 1602089.1) and tried workarounds mentioned there, like recreating OPATCH_SCRIPT_DIR and OPATCH_LOG_DIR from sqlplus. Also edited opatch script file as mentioned in the support doc. But both steps did not work.

1. Check the _disable_directory_link_check parameter value in the DB 
2. If its value is FALSE, set it to TRUE
3. Bounce the DB
4. Rinvoke datapatch command.

1. SQL> SELECT a.ksppinm "Parameter",b.ksppstvl "Session Value",c.ksppstvl "Instance Value" FROM x$ksppi a, x$ksppcv b, x$ksppsv c  WHERE a.indx = b.indx AND a.indx = c.indx AND a.ksppinm LIKE '/_disable_direc%' escape '/';   

Parameter                      Session Value Instance Value
------------------------------ ------------- ---------------
_disable_directory_link_check   FALSE         FALSE

2. SQL> alter system set "_disable_directory_link_check"=TRUE scope=spfile;

System altered.

3. SQL> Shutdown immediate
    SQL> startup;

4. ./datapatch -verbose
.....................
.....................
     Installing patches...
     Patch installation complete.  Total patches installed: 1
     Validating logfiles...
     Patch 18522516 apply: SUCCESS

1 comment: