2

I am ready to upgrade the oracle 10g prod db to 11g, but we have 130 invalid objects in SYS (all are belong to JAVA CLASS object_type). And from the best practice of oracle upgrade from 10g to 11g, it said should not have any invalid objects in sys or system schema. But I already ran the utlrp.sql to recompile all invalid objects script multiple times, those invalid JAVA CLASS object_type objects are persistent in SYS user. And I tried to manually recompile each of those object as doing following,

alter java class "java class object name" compile; but got error: ORA-29521: referenced name balabala could not be found

You have any advice for either how to fix this error or can we go ahead to upgrade the db with those 130 invalid objects in the sys schema safely? Thanks!

1 Answer 1

5

From this blog you can try this on development first...

SQL> spool resolve.sql;

SQL> select ‘alter java class “‘||object_name||’” resolve;’
2 from user_objects
3 where object_type like ‘%JAVA%’;

SQL> spool off;

SQL> @resolve

The clean sweep approach would be to remove and reinstall the java JVM

The Java VM is created and populated with system classes during CREATE OR REPLACE JAVA SYSTEM command. Run rmjvm.sql to remove the JVM first, then bounce the database then initjvm.sql

I repeat, these should be tried on your development stack first!

3
  • thx Kevin! But we don't have this issue in our dev or stage env, so not able to test there first... this issue is only existing on prod db though. And your post is definitely helping me to move on the right direction, will see what I can do. Thanks, Maggie
    – magqq
    Sep 8, 2011 at 3:22
  • Then your next step is to remove and reinstall java. Or decide to do a fresh install of Oracle 11g and then do an import or data pump from the older version.I would add more but this expands the scope of the question beyond JAvA classes
    – kevinskio
    Sep 16, 2011 at 23:32
  • I ignored those invalid sys classes since oracle upgrade group told me, doing the upgrade may even fix those invalid java class objects. Which turned out somewhat true, 2 of those objects got fixed during the upgrade.
    – magqq
    Dec 14, 2011 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.