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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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