升级10.2.0.4RAC后,Spatial变成Invalid的解决办法

最近升级了一套RAC系统,AIX平台从10.2.0.3升级到10.2.0.4.升级的过程都很顺利,但是检查系统组件的时候发现如下问题:

COMP_NAME                                VERSION                        STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Enterprise Manager                10.2.0.4.0                     VALID
Spatial                                  10.2.0.4.0                     INVALID
OLAP Catalog                             10.2.0.4.0                     VALID
Oracle Text                              10.2.0.4.0                     VALID
Oracle Database Catalog Views            10.2.0.4.0                     VALID
Oracle Database Packages and Types       10.2.0.4.0                     VALID
JServer JAVA Virtual Machine             10.2.0.4.0                     VALID
Oracle XDK                               10.2.0.4.0                     VALID
Oracle Database Java Packages            10.2.0.4.0                     VALID
OLAP Analytic Workspace                  10.2.0.4.0                     VALID
Oracle OLAP API                          10.2.0.4.0                     VALID
Oracle Real Application Clusters         10.2.0.4.0                     VALID

检查了一下升级spool输出的文件,发现以下错误信息:

ORA-29521: referenced name com/sun/media/jai/codec/PNGEncodeParam$RGB could not be found
ORA-29521: referenced name com/sun/media/jai/codec/PNGEncodeParam$Gray could not be found

出现该问题的原因是因为在升级的过程中,可能没有足够的Java Pool来创建和编译JAVA类.解决这个问题的办法就是:

1.DROP掉这些JAVA类

connect / as sysdba
spool java-classes.lst
call dbms_java.grant_permission('SYSTEM', 'java.io.FilePermission','<>', 'read');
call dbms_java.grant_permission('MDSYS', 'SYS:java.io.FilePermission','md/lib/*', 'read');
call dbms_java.grant_permission('MDSYS', 'SYS:java.io.FilePermission','sdo/demos/georaster/jlibs/*', 'read');
call dbms_java.grant_permission('MDSYS','SYS:java.io.FilePermission','md\lib\*','read');
call dbms_java.grant_permission('MDSYS', 'SYS:java.io.FilePermission','sdo\demos\georaster\jlibs\*', 'read');
call dbms_java.grant_permission('MDSYS', 'SYS:java.lang.RuntimePermission','getClassLoader', null);
call dbms_java.grant_permission('ORDSYS', 'SYS:java.lang.RuntimePermission','getClassLoader', null);
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/sdoapi.jar');
call dbms_java.dropjava(' -force -synonym -schema MDSYS md/lib/sdoutl.jar');
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/sdotopo.jar');
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/sdonm.jar');
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/sdotype.jar');
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/sdogcdr.jar');
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/sdogr.jar');
call dbms_java.dropjava('-force -synonym -schema MDSYS md/lib/routepartition.jar');
call dbms_java.revoke_permission('MDSYS','SYS:java.io.FilePermission','md/lib/*','read');
call dbms_java.revoke_permission('MDSYS','SYS:java.io.FilePermission','sdo/demos/georaster/jlibs/*','read');
commit;
spool off

2.重新加载Java类

@?/md/admin/sdoloadj.sql

3.编译无效对象

@?/rdbms/admin/utlrp.sql

这个时候你会发现,MDSYS这个用户的无效对象都已经变成VALID了,但是Spatial仍然是INVALID的.

4.重新刷一遍数据字典

@?/rdbms/admin/catupgrd.sql
@?/rdbms/admin/utlrp.sql

最后,再次确认Spatial,可以看到Spatial的状态已经变成VALID.如果你不运行上述第1条而直接重刷数据字典,问题会依旧.

分享到: 更多