ORA-04063: package body “SYS.DBMS_PREUP” has errors during DBUA

Database upgrade DBUA getting error ORA-04063: package body “SYS.DBMS_PREUP” has errors

Error: ORA-04063: package body “SYS.DBMS_PREUP” has errors

I am upgrading the database from 12.2.0.1 to 19.3.0 with the DBUA utility. I am getting the following error.

Cause: One of the package DBMS_PREUP is invalid.

Solution:

  1. We tried to compile the package but its remains invalid.
SQL> select object_name,object_type from dba_objects where status='INVALID';

OBJECT_NAME  OBJECT_TYPE
-----------  ------------ 
DBMS_PREUP   PACKAGE BODY

SQL> alter package sys.dbms_preup compile body;

Warning: Package Body altered with compilation errors.

SQL> show errors;
Errors for PACKAGE BODY SYS.DBMS_PREUP:

LINE/COL ERROR
-------- -----------------------------------------------------------------
6646/24  PLS-00103: Encountered the symbol ")" when expecting one of the
         following:

2. We run the preupgrade.jar file for preupgrade utility then it automatically compile the package. our issue is fixed with preupgrade.jar file present in 19c Oracle home.


Syntax:
<oldhome>\jdk\bin>java -jar <newhome>\rdbms\admin\preupgrade.jar TERMINAL TEXT

-- Executed following command to fixed the issue:
D:\oracle\12.2.0\dbhome_1\jdk\bin>java -jar E:\oracle\19.3.0\dbhome_1\rdbms\admin\preupgrade.jar TERMINAL TEXT

After executing we getting the suggestion for pre or post upgrade.

3. After executing the pre steps and check the invalid object but its automatically compliled by preupgrade utility

SQL> select object_name from dba_objects where status='INVALID';
no rows selected

SQL> select count(*) from dba_objects where status='INVALID';
  COUNT(*)
----------
         0
This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply