My Oracle Support Banner

Ora-01000 Using Xmlelement/Xmltype Over Dblink (Doc ID 1369617.1)

Last updated on FEBRUARY 19, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.7 to 11.2.0.3 [Release 11.1 to 11.2]
Information in this document applies to any platform.

Symptoms


In 11g, encountering ORA-01000 in queries that use xmltype/xmlelement over database links.
The ora-1000 error comes from the remote site.

The following reproduces this problem:

alter session set session_cached_cursors=1600;

declare
  v_xmltype XMLTYPE;
  v_SQLQuery varchar2(4000);
begin
  for rec in (select * from dba_objects where rownum<=5000) loop
   v_SQLQuery:='SELECT xmlelement ("TEST",object_name) FROM DBA_OBJECTS@dbl1
   where owner='''||rec.owner||''' and
   object_name='''||rec.object_name||''' and
   rownum=1';
   EXECUTE IMMEDIATE v_SQLQuery INTO v_xmltype;
  end loop;
end;
/




ERROR at line 1:
ORA-02063: preceding 2 lines from <dblink>
ORA-06512: at line 7

In remote site: ora-1000

Workaround:
Set session_cached_cursors=0 but this may lead to performance decrease


Changes

Upgraded to 11g, the problem does not reproduce with earlier releases.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.