How to recompile invalid PLSQL packages that have been encrypted using Oracle 10g's Wrap utility?
Solution 1
So it appears there is no "fix" for this issue, only workarounds, none of which are ideal.
- Redo the export and import using the old exp and imp programs (instead of data pump)
- If you have .SQL files containing the package definitions, you can manually compile them in SQL*Plus (might be thousands of files making this a big job).
- You can patch the database (see Metalink article 460267.1)
Solution 2
Try using the system DBMS_UTILITY.COMPILE_SCHEMA
procedure to compile your schema objects. This procedure will determine the order in which to compile your objects and even handles circular dependencies. After a scripted schema build it's a good procedure to call for clean up.
BEGIN
DBMS_UTILITY.COMPILE_SCHEMA('MYSCHEMA');
END;
/
I'd be curious to know how well it handles wrapped objects.
Mark
Updated on June 28, 2022Comments
-
Mark almost 2 years
So I've taken an export (using Data Pump) from an Oracle 10g schema where all the PLSQL packages were encrypted using Oracle's Wrap utility. The problem is when I do an import of this into a new schema, all my packages are invalid, and trying a manual compile doesn't work.
SQL> ALTER PACKAGE mypackage compile; Warning: Package altered with compilation errors. SQL> show errors Errors for PACKAGE MYPACKAGE: LINE/COL ERROR -------- ----------------------------------------------------------------- 36/2 PLS-00103: Encountered the symbol "2"
So what's the solution to recompiling all these invalid packages?