DBMS_STATS.GATHER_TABLE_STATS fails with ORA-20011 ORA-600 [Kghsrs_printf:Len]

(Doc ID 741560.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.1.0.6 [Release 11.1]
Information in this document applies to any platform.
***Checked for relevance on 13-Nov-2013***

Symptoms

You are gathering statistics on a table

For example:

exec dbms_stats.gather_table_stats(ownname=>'NAME',tabname=> 'NAME',cascade=>TRUE);

and it fails with:

ORA-20011: Approximate NDV failed:
ORA-600 [kghsrs_printf:len], [18446744073709551615], [1024], [], [], [], [], []
ORA-06512: at "SYS.DBMS_STATS", line 17806
ORA-06512: at "SYS.DBMS_STATS", line 17827


The stack trace is similar to the following:

... $cold_kghsrs_vprint qksanProcessWritef qerandvGatherSqlSta kestsGatherSqlStats ...

Changes

The table has a function based index and the problem can be reproduced in 11.1.0.6 by a simple testcase:

1) Create Table

2) Create functional index

3) Insert

4) exec dbms_stats.gather_table_stats(USER,'NAME',cascade=>TRUE);

However, the problem does not occur in 11.1.0.7.

Also, if the index is dropped, the problem does not occur. 

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