Monday, April 3, 2017

ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout

ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
KUP-11024: This external table can only be accessed from within a Data Pump job.

Alert Log details: 


Trace file details:


Cause:
The primary cause of this issue is that an external table existed at some point in time but does not now. However, the database still believes the table exists since the dictionary information about the object has not been modified to reflect the change. When DBMS_STATS is run against the table in question, it makes a call out to the external table which fails because the object is not there.

There are many reasons that an external table may not exist including:
  • - Temporary Datapump external tables have not been cleaned up properly. The dictionary information should have been dropped when the DataPump jobs completed.
  • - An OS file for an External table has been removed without clearing up the corresponding data dictionary information. 
  • Solution:
  • Essentially the solution to this issue is to clean up the orphaned dictionary entries.
  • SELECT owner_name, job_name, operation, job_mode, state, attached_sessions FROM dba_datapump_jobs WHERE job_name NOT LIKE 'BIN$%' ORDER BY 1,2;
  • or 
  • select OWNER,OBJECT_NAME,OBJECT_TYPE, status,
    to_char(CREATED,'dd-mon-yyyy hh24:mi:ss') created
    ,to_char(LAST_DDL_TIME , 'dd-mon-yyyy hh24:mi:ss') last_ddl_time
    from dba_objects
    where object_name like 'ET$%'
    /

    select owner, TABLE_NAME, DEFAULT_DIRECTORY_NAME, ACCESS_TYPE
    from dba_external_tables
    order by 1,2
    /
  • Drop external temporary table
  • Ref. Doc: ID 1274653.1

No comments: