11.2通過資料庫鏈呼叫10.2過程報錯

yangtingkun發表於2011-09-13

測試中無意發現了這個bug,在11.2資料庫通過資料庫鏈,執行10.2.0.1上的過程,結果出現ORA-06553: PLS-801: internal error [55916]的錯誤。

 

 

錯誤可以通過下面的例子重現:

-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 12 23:12:47 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production

SQL> create user test identified by test default tablespace users;

User created.

SQL> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      XE

SQL> grant connect, resource, dba to test;

Grant succeeded.

SQL> conn test/test
Connected.
SQL> create procedure p1 as
  2  begin
  3  null;
  4  end;
  5  /

Procedure created.

首先在10.2.0.1環境中建立一個儲存過程。

SQL> create database link xe connect to test identified by test using '192.168.0.20:1522/XE';

Database link created.

SQL> exec p1@xe
BEGIN p1@xe; END;

*
ERROR at line 1:
ORA-04052: error occurred when looking up remote object TEST.P1@XE
ORA-00604: error occurred at recursive SQL level 1
ORA-06544: PL/SQL: internal error, arguments: [55916], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [55916]
ORA-02063: preceding 2 lines from XE

SQL> select * from dual@xe;

D
-
X

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 – Production

SQL> select * from v$version@xe;

BANNER
----------------------------------------------------------------
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

11.2中呼叫這個儲存過程報錯,嘗試使用同義詞或動態SQL,都無法繞過這個錯誤:

SQL> create synonym s1 for p1@xe;

Synonym created.

SQL> exec s1
BEGIN s1; END;

*
ERROR at line 1:
ORA-04052: error occurred when looking up remote object TEST.P1@XE
ORA-00604: error occurred at recursive SQL level 1
ORA-06544: PL/SQL: internal error, arguments: [55916], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [55916]
ORA-02063: preceding 2 lines from XE

SQL> begin
  2  execute immediate 'begin p1@xe; end;';
  3  end;
  4  /
begin
*
ERROR at line 1:
ORA-04052: error occurred when looking up remote object TEST.P1@XE
ORA-00604: error occurred at recursive SQL level 2
ORA-06544: PL/SQL: internal error, arguments: [55916], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [55916]
ORA-02063: preceding 2 lines from XE
ORA-06512: at line 2

metalink文件Bug 4511371中描述了這個問題:ORA-6544 / ORA-4052 using PLSQL between 10g and 11g。根據文件描述,在10.2.0.1中通過資料庫鏈訪問11.2的過程也會出現同樣的錯誤,而解決方法除了升級到10.2.0.2及以上版本外,沒有其他的解決方法。

 

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

相關文章