My Oracle Support Banner

Ora-1476 When Collecting Statistics On Empty Table with Granularity = Approx_Global (Doc ID 1389394.1)

Last updated on FEBRUARY 25, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

ORA-1476 during GATHER_TABLE_STATS with granularity = APPROX_GLOBAL AND PARTITION.

The error occurs only when no rows in the table. If a row is inserted in to the table, then the error no longer occurs.

Example:

SQL> exec dbms_stats.gather_table_stats ( ownname => 'SCHEMA',tabname => 'T1' ,partname =>'P201107', granularity => 'APPROX_GLOBAL AND PARTITION' ,force => true);

BEGIN dbms_stats.gather_table_stats ( ownname => 'SCHEMA',tabname => 'T1' ,partname =>'P201107', granularity => 'APPROX_GLOBAL AND PARTITION' ,force => true); END;

*
ERROR at line 1:
ORA-01476: divisor is equal to zero
ORA-06512: at "SYS.DBMS_STATS", line 23154
ORA-06512: at "SYS.DBMS_STATS", line 23205
ORA-06512: at line 1

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