Compilation Error in 19.14 datapatch

We were migrating a non-cdb 19.7 database from Solaris x86 to 19.14 pdb on Linux. datapatch threw the compilation error while executing prvthadoop.plb:

Validating logfiles...done
Patch 33515361 apply (pdb DB11): WITH ERRORS
  logfile: /u00/oracle/orabase/cfgtoollogs/sqlpatch/33515361/24589353/33515361_apply_DB1C_DB11_2022Jan24_12_28_40.log (errors)
  -> Error at line 274912: script rdbms/admin/prvthadoop.plb
      - Warning: Package Body created with compilation errors.

prvthadoop.plb is a wrapper for prvthadoop1:

:execfile := 'prvthadoop1.plb';

prvthadoop1 creates the DBMS_HADOOP_INTERNAL package:

CREATE OR REPLACE PACKAGE BODY DBMS_HADOOP_INTERNAL wrapped

The compilation of DBMS_HADOOP_INTERNAL failed because a table or view was missing:

select name, text from dba_errors

NAME
--------------------------------------------------------------------------------
TEXT
--------------------------------------------------------------------------------
DBMS_HADOOP_INTERNAL
PL/SQL: ORA-00942: table or view does not exist

dba_errors doesn’t show which tables or views are missing, just the program line. But this information is to no avail because the package body is wrapped.

I queried dba_dependencies on a healthy database to see which objects are referenced in DBMS_HADOOP_INTERNAL:

select referenced_name from dba_dependencies where name = 'DBMS_HADOOP_INTERNAL'

REFERENCED_NAME
--------------------------------------------------------------------------------
...
DBA_HIVE_TABLES
DBA_HIVE_COLUMNS
DBA_HIVE_TAB_PARTITIONS
DBA_HIVE_PART_KEY_COLUMNS
...

The referenced DBA_HIVE* views exist on Linux:

SQL> select object_name from dba_objects where object_name like 'DBA_HIVE%' ;

OBJECT_NAME
--------------------------------------------------------------------------------
DBA_HIVE_TABLES
DBA_HIVE_TABLES
DBA_HIVE_COLUMNS
DBA_HIVE_COLUMNS
DBA_HIVE_DATABASES
DBA_HIVE_DATABASES
DBA_HIVE_TAB_PARTITIONS
DBA_HIVE_TAB_PARTITIONS
DBA_HIVE_PART_KEY_COLUMNS
DBA_HIVE_PART_KEY_COLUMNS

but are missing on Solaris x86:

select object_name from dba_objects where object_name like 'DBA_HIVE%' ;

no rows selected

These views are created by the script cathive1:

grep -il DBA_HIVE *
...
cathive1.sql
dbmshadp1.sql
...

cathive1.sql is called by cathive.sql only on Linux (platform_id=13) and Solaris SPARC (platform_id=2), but not on Solaris x86 (platform_id=20):

IF (:pfid = 13 OR :pfid = 2) THEN
  :execfile := 'cathive1.sql';
ELSE
  :execfile := 'nothing.sql';
END IF;
select platform_id, platform_name from v$transportable_platform where platform_id in (13,2,20);

PLATFORM_ID
-----------
PLATFORM_NAME
--------------------------------------------------------------------------------
          2
Solaris[tm] OE (64-bit)

         13
Linux x86 64-bit

         20
Solaris Operating System (x86-64)

Simply put, datapatch on Linux expect Hadoop objects, but they won’t be there if the database was migrated from another platform.

Workaround

You can first migrate to 19.13 PDB on Linux and than apply the 19.14 RU.

I also tried the following unsupported way: created the Hadoop objects on Solaris x86 (in the lab) prior to migrating to 19.14 on Linux.

@?/rdbms/admin/dbmshadp1
@?/rdbms/admin/cathive1
@?/rdbms/admin/prvthadoop1.plb

datapatch ran without errors. You’d need to clarify with Oracle support before using it in the production.

Update January 31, 2022

Oracle Support confirmed the workaround with creating the views on the source database.

Thanks for sharing

Nenad Noveljic

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.