06 March 2007

Fixing a 32-to-64-bit Migration with utlirp.sql

I plan to write up more about my big migration at work, but I wanted to drop one quick note. I'm using RMAN to duplicate my 32-bit production server to a 64-bit development server (I'll do the same thing for production migration). However, at the very end, RMAN puked this up:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-12005: error during channel cleanup
ORA-06544: PL/SQL: internal error, arguments: [56319], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56319]
But otherwise RMAN said the duplication was finished and the database was opened. I could log in locally as SYSDBA just fine, but logins through the listener gave me those two PL/SQL errors again, as did any attept to use PL/SQL.

Thankfully, my blogging rival hali in #oracle suggested ultirp.sql, which is one of the many provided scripts in your $ORACLE_HOME/rdbms/admin/ directory, along with its brother, utlrp.sql. From the comments of utlirp.sql:
This script can be used to invalidate and all pl/sql modules (procedures, functions, packages, types, triggers, views) in a database.

This script must be run when it is necessary to regenerate the compiled code because the PL/SQL code format is inconsistent with the Oracle executable (e.g., when migrating a 32 bit database to a 64 bit database or vice-versa).

Please note that this script does not recompile invalid objects automatically. You must restart the database and explicitly invoke utlrp.sql to recompile invalid objects.
That second paragraph described me to a tee. So I kicked it off (have to start the instance in upgrade mode):
SQL> shutdown immediate;
SQL> startup upgrade;
SQL> @utlirp
Once that finishes, it tells you to then restart in normal mode and run utlrp.sql to recompile the objects it just invalidated.
SQL> shutdown immediate;
SQL> startup;
SQL> @utlrp
and VOILA! Errors gone. Of course, we still have to do the rest of the application testing! Thanks to hali for the tip, and for agreeing to let me blog about it this time.

No comments:

Post a Comment