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 to [Release 11.1]
Information in this document applies to any platform.
***Checked for relevance on 13-Nov-2013***


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 ...


The table has a function based index and the problem can be reproduced in 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

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


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