ORA-04031 in Large Pool Executing DBMS_METADATA.GET_DDL Through Shared Server Connection (Doc ID 1271785.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.3 - Release: 11.1 to 11.2
Information in this document applies to any platform.

Symptoms

SELECT dbms_metadata.get_ddl('TABLE', 'TEST') FROM dual;


TEST CASE
=========
-- Create a test user
create user tc identified by tc default tablespace users;
grant dba to tc;

-- Connect to a shared server
connect tc/tc@XXX -- Replace XXX by a valid shared server service name.

-- Verify Session connectivity
select a.sid, a.serial#, a.server, b.spid
from v$session a, v$process b
where a.paddr=b.addr
and sid in (select sid from v$mystat where rownum=1);

  SID    SERIAL#    SERVER SPID
----- ---------- --------- -----------
   27         10    SHARED 20442    <== Shared Server


-- Create test table
create table TEST (col1 varchar2(20));

-- Reproduce the error
SELECT dbms_metadata.get_ddl('TABLE', 'TEST') FROM dual;

ORA-04031: unable to allocate 4194352 bytes of shared memory ("large
pool","unknown object","session heap","kuxLpxAlloc")
ORA-06512: at "SYS.UTL_XML", line 330
ORA-06512: at "SYS.DBMS_METADATA_INT", line 10569
ORA-06512: at "SYS.DBMS_METADATA_INT", line 10684
ORA-06512: at "SYS.DBMS_METADATA", line 3001
ORA-06512: at "SYS.DBMS_METADATA", line 3897
ORA-06512: at "SYS.DBMS_METADATA", line 5678
ORA-06512: at line 1



TRACE FILE
The resultant trace file confirms the following functions on the call stack:

CALL STACK
----------
Error: ORA-4031 [4194352] [large pool] [unknown object] [session heap]
[kuxLpxAlloc] [] [] [] [] [] [] []
...
[04]: kghnospc [KGH]<-- Signaling
[05]: kghalf [KGH]
[06]: LpxMemAlloc []
[07]: lpxlpaxdescendant []
[08]: lpxxpgetstrval []
[09]: lpxevalcomparenset []
[10]: lpxevalexprcont []
[11]: lpxevalexpr []
[12]: LpxsCondTestCondition []
[13]: LpxsCondProcessAction []
...


Error: ORA-600 [729] [69984] [space leak] [] [] [] [] [] [] [] [] []
...
[02]: ksmuhe [KSM]<-- Signaling
[03]: ksmugf [KSM]
[04]: ksuxds [ksu]
[05]: ksudel [ksu]
[06]: opilof []
[07]: opiodr []
...


Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms