一、基础环境介绍
OS:Red Hat Enterprise Linux Server release 6.6GI:12.1.0.2DB:12.1.0.2PSU:12.1.0.2.180717Opatch:12.2.0.1.14
二、处理过程
1、检查操作系统jdk版本
cd $ORACLE_HOME/jdk/bin./java –versionJava version “1.6.0_75”Java(TM) SE Runtime Environment (build 20.75-b01,mixed mode)
2、检查OPATCH版本
cd $ORACLE_HOME/Opatch./opatch lsinv
3、检查数据库中的JDK版本
SQL> select dbms_java.get_jdk_version() from dual;ERROR at line 1: ORA-29548: Java system class reported: release of classes.bin in the database(12.1.0.2.0.1.6) does not match that of the oracle executable(12.1.0.2.180717.1.6)
4、修复数据库中的java对象
SQL> @?/javavm/install/update_javavm_db.sqlSQL> SET FEEDBACK 1 SQL> SET NUMWIDTH 10 SQL> SET LINESIZE 80 SQL> SET TRIMSPOOL ON SQL> SET TAB OFF SQL> SET PAGESIZE 100 SQL> SQL> alter session set “_ORACLE_SCRIPT”=true;Session altered.SQL> — If Java is installed, do CJS. SQL> SQL> — If CJS can deal with the SROs inconsistent with the new JDK, SQL> — the drop_sros() call here can be removed. SQL> call initjvmaux.drop_sros();Call completed.SQL> create or replace java system; 2 /Java created.SQL> update dependency$ 2 set p_timestamp=(select stime from obj$ where obj#=p_obj#) 3 where (select stime from obj$ where obj#=p_obj#)!=p_timestamp and 4 (select type# from obj$ where obj#=p_obj#)=29 and 5 (select owner# from obj$ where obj#=p_obj#)=0;0 rows updated.SQL> commit;Commit complete.SQL> SQL> alter session set “_ORACLE_SCRIPT”=false;Session altered.
5、验证
CDB中可以检查数据库jdk版本,pdb中仍然报错SQL> select dbms_java.get_jdk_version() from dual;ERROR at line 1: ORA-29548: Java system class reported: release of classes.bin in the database(12.1.0.2.0.1.6) does not match that of the oracle executable(12.1.0.2.180717.1.6)-解决办法在pdb再次执行SQL> @?/javavm/install/update_javavm_db.sql 生产环境进行Oracle 12c数据库迁移和升级时如应用系统使用了数据库中的java对象,ORA-29548是常见报错,本人在12.1和12.2迁移和升级过程中使用rman或数据泵都遇到过该报错。
