Oracle 12c ORA-29548 報錯處理

xfhuangfu發表於2020-01-26

一、基礎環境介紹

OS:Red Hat Enterprise Linux Server release 6.6

GI:12.1.0.2

DB:12.1.0.2

PSU:12.1.0.2.180717

Opatch:12.2.0.1.14

二、處理過程

1、檢查作業系統jdk版本

cd $ORACLE_HOME/jdk/bin

./java –version

Java 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.sql

SQL> 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或資料泵都遇到過該報錯。

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28373936/viewspace-2674299/,如需轉載,請註明出處,否則將追究法律責任。

相關文章