Large Memory Usage for Large Queries Using RBO and CURSOR_SHARING=FORCE or SIMILAR (Doc ID 462925.1)

Last updated on AUGUST 27, 2010

Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.7 and later   [Release: 9.2 and later ]
Information in this document applies to any platform.

Symptoms

One may notice that large queries with many literals in predicates using IN LISTs or OR clauses consume excessive memory. These queries can take up to several hundred of megabytes and they can lead to ORA-04031 errors.
This situation appears only under very particular circumstances:
1. 9.2 environment (to be more precise, an environment that can use RBO)
2. very large query using a large number of literals
3. no statistics on the base tables (so that RBO is used for these queries)
4. CURSOR_SHARING on FORCE or SIMILAR.
Without any of the above, the issue would not reproduce.

Errorstack for the ORA-04031 that is generated for such a query is:

ksedmp ksdxfdmp ksdxcb sspuser sigreturn kghsrch kghfnd kghprmalo kghalp kksalc qknAllocate qknsiAllocate qkaix qkatab qkajoi qkaqkn qkadrv opitca kkssbt kksfbc kkspfda kpodny kpoal8 opiodr
ttcpip opitsk opiino opiodr opidrv sou2o main

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