首先在alert log裡面頻繁的看見如下錯誤:

DBMS_STATS: GATHER_STATS_JOB encountered errors.  Check the trace file.
Errors in file /oracle/diag/rdbms/phalr/phalr/trace/phalr_j001_5306.trc:
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.

查看trc文件

oracle@phalrdb1: /oracle/diag/rdbms/phalr/phalr/trace> more /oracle/diag/rdbms/phalr/phalr/trace/phalr_j001_5306.trc
Trace file /oracle/diag/rdbms/phalr/phalr/trace/phalr_j001_5306.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /oracle/product/11.2.0
System name:    Linux
Node name:    phalrdb1
Release:    2.6.32-431.el6.x86_64
Version:    #1 SMP Sun Nov 10 22:19:54 EST 2013
Machine:    x86_64
Instance name: phalr
Redo thread mounted by this instance: 1
Oracle process number: 46
Unix process pid: 5306, image: oracle@phalrdb1 (J001)

*** 2016-11-19 06:00:13.568
*** SESSION ID:(2209.51473) 2016-11-19 06:00:13.568
*** CLIENT ID:() 2016-11-19 06:00:13.568
*** SERVICE NAME:(SYS$USERS) 2016-11-19 06:00:13.568
*** MODULE NAME:(DBMS_SCHEDULER) 2016-11-19 06:00:13.568
*** ACTION NAME:(ORA$AT_OS_OPT_SY_2339) 2016-11-19 06:00:13.568
 
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.

*** 2016-11-19 06:00:13.568
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"PHALWDA1"','"ET$081400230001"','""', ...)
DBMS_STATS: 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.

不太看得明白,去MOS搜索到一篇文章

ORA-20011 ORA-29913 and ORA-29400 with Associated KUP-XXXXX Errors from DBMS_STATS.GATHER_STATS_JOB (Doc ID 1274653.1)

该文详尽的描述了解决这个异常,我们在datadump导入导出的都是,都会产生一个类似SYS_EXPORT_TABLE_02的表,如果是正常导完oracle会自动清除这个表,那么如果导入导出的时候中断,那么这个表就不会被清除,这个ora错误的引起就与这个有关系。

Temporary Datapump external tables have not been cleaned up properly. The dictionary information should have been dropped when the DataPump jobs completed.

解决方案就是清除Datapump遗留的临时外部表,下面是详细过程

[BEGIN] 2016/11/25 下午 05:19:51
SET lines 200
COL owner_name FORMAT a10;
COL job_name FORMAT a20
COL state FORMAT a12
COL operation LIKE state
COL job_mode LIKE state
COL owner.object for a50
SQL>
-- locate Data Pump jobs:
SQL>
SELECT owner_name, job_name, rtrim(operation) "OPERATION",
       rtrim(job_mode) "JOB_MODE", state, attached_sessions
  FROM dba_datapump_jobs
WHERE job_name NOT LIKE 'BIN$%'
  5   ORDER BY 1,2;

OWNER_NAME JOB_NAME        OPERATION    JOB_MODE      STATE        ATTACHED_SESSIONS
---------- -------------------- ------------ ------------ ------------ -----------------
PHALWDA1   SYS_EXPORT_TABLE_01    EXPORT         TABLE      NOT RUNNING               0
PHALWDA1   SYS_EXPORT_TABLE_02    EXPORT         TABLE      NOT RUNNING               0
PHALWDA1   SYS_IMPORT_FULL_01    IMPORT         FULL      NOT RUNNING               0

SELECT o.status, o.object_id, o.object_type,
       o.owner||'.'||object_name "OWNER.OBJECT"
  FROM dba_objects o, dba_datapump_jobs j
WHERE o.owner=j.owner_name AND o.object_name=j.job_name
  5     AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;

STATUS               OBJECT_ID OBJECT_TYPE                           OWNER.OBJECT
--------------------- ---------- --------------------------------------------------------- --------------------------------------------------
VALID               76494 TABLE                               PHALWDA1.SYS_EXPORT_TABLE_01
VALID               76497 TABLE                               PHALWDA1.SYS_EXPORT_TABLE_02
VALID               81868 TABLE                               PHALWDA1.SYS_IMPORT_FULL_01

SQL> drop table PHALWDA1.SYS_EXPORT_TABLE_01;

Table dropped.

SQL> drop table PHALWDA1.SYS_EXPORT_TABLE_02;

Table dropped.

SQL> drop table PHALWDA1.SYS_IMPORT_FULL_01;

Table dropped.

SQL> purge dba_recyclebin;

DBA Recyclebin purged.

SET lines 200
COL owner_name FORMAT a10;
COL job_name FORMAT a20
COL state FORMAT a12
COL operation LIKE state
COL job_mode LIKE state
COL owner.object for a50
SQL>
-- locate Data Pump jobs:
SQL>
SELECT owner_name, job_name, rtrim(operation) "OPERATION",
       rtrim(job_mode) "JOB_MODE", state, attached_sessions
  FROM dba_datapump_jobs
WHERE job_name NOT LIKE 'BIN$%'
  5   ORDER BY 1,2;

no rows selected

spool obj.out
set linesize 200 trimspool on
set pagesize 2000
col owner form a30
col created form a25
col last_ddl_time form a25
col object_name form a30
col object_type form a25
SQL>
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

OWNER                   OBJECT_NAME              OBJECT_TYPE        STATUS              CREATED            LAST_DDL_TIME
------------------------------ ------------------------------ ------------------------- --------------------- ------------------------- -------------------------
PHALWDA1               ET$081400230001              TABLE            VALID              01-oct-2016 08:35:49    01-oct-2016 08:35:49

from dba_external_tables
order by 1,2
/

OWNER                   TABLE_NAME
------------------------------ ------------------------------------------------------------------------------------------
DEFAULT_DIRECTORY_NAME                                       ACCESS_TYPE
------------------------------------------------------------------------------------------ ---------------------
PHALWDA1               ET$081400230001
BACKUP                                               CLOB

SQL> SQL> spool off
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@phalrdb1: /home/oracle> ls
cc  chk_cmd  chk_lst  dba_cmd  obj.out
oracle@phalrdb1: /home/oracle> more obj.out
SQL> set linesize 200 trimspool on
SQL> set pagesize 2000
SQL> col owner form a30
SQL> col created form a25
SQL> col last_ddl_time form a25
SQL> col object_name form a30
SQL> col object_type form a25
SQL>
SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE, status,
  2  to_char(CREATED,'dd-mon-yyyy hh24:mi:ss') created
  3  ,to_char(LAST_DDL_TIME , 'dd-mon-yyyy hh24:mi:ss') last_ddl_time
  4  from dba_objects
  5  where object_name like 'ET$%'
  6  /

OWNER                          OBJECT_NAME                    OBJECT_TYPE               STATUS                CREATED                   LAST_DDL_TIME
------------------------------ ------------------------------ ------------------------- --------------------- ------------------------- --------------------
-----
PHALWDA1                       ET$081400230001                TABLE                     VALID                 01-oct-2016 08:35:49      01-oct-2016 08:35:49

SQL>
SQL> select owner, TABLE_NAME, DEFAULT_DIRECTORY_NAME, ACCESS_TYPE
  2  from dba_external_tables
  3  order by 1,2
  4  /

OWNER                          TABLE_NAME
------------------------------ ------------------------------------------------------------------------------------------
DEFAULT_DIRECTORY_NAME                                                                     ACCESS_TYPE
------------------------------------------------------------------------------------------ ---------------------
PHALWDA1                       ET$081400230001
BACKUP                                                                                     CLOB

SQL>
SQL> spool off
oracle@phalrdb1: /home/oracle> sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Nov 25 17:33:55 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> drop table PHALWDA1.ET$081400230001 purge;

Table dropped.

[END] 2016/11/25 下午 05:35:40

参考:

ORA-20011 ORA-29913 and ORA-29400 with Associated KUP-XXXXX Errors from DBMS_STATS.GATHER_STATS_JOB (Doc ID 1274653.1)

How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ? (Doc ID 336014.1)

ORA-20011 ORA-29913 and ORA-29400 with Associated KUP-XXXXX Errors from DBMS_STATS.GATHER_STATS_JOB(Doc ID 1274653.1)的更多相关文章

  1. Oracle的tnsnames.ora配置(PLSQL Developer)

    首先打开tnsnames.ora的存放目录,一般为D:\app\Administrator\product\11.2.0\client_1\network\admin,就看安装具体位置了. 步骤阅读 ...

  2. listener.ora/sqlnet.ora/tnsnames.ora配置文件详解

    oracle网络配置 三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下. 英文说明: The ...

  3. ORACLE配置tnsnames.ora文件实例

    ORACLE配置tnsnames.ora文件实例客户机为了和服务器连接,必须先和服务器上的监听进程联络.ORACLE通过tnsnames.ora文件中的连接描述符来说明连接信息.一般tnsnames. ...

  4. ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)

    不论是单实例还是RAC,对于非缺省端口下(1521)的监听器,pmon进程不会将service/instance注册到监听器,即不会实现动态注册.与单实例相同,RAC非缺省端口的监听器也是通过设置参数 ...

  5. 在TNSNAMES.ORA文件中配置本机装的oracle

    首先,感谢这两位网友:http://zhidao.baidu.com/link?url=eGYeoEa-EhQdVitSGqjE36uNfVmEsryXH1WUjPue6YvArDSx-Y1N9_rd ...

  6. oracle的sqlnet.ora , tnsnames.ora , Listener.ora 文件的作用(转)

    oracle网络配置三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下.1. sqlnet.o ...

  7. init.ora, pfile, spfile

    实例启动时,查找初始化参数文件的顺序为: spfile<sid>.oraspfile.orainit<sid>.ora 如果以上3个文件都不存在,则实例无法启动. init.o ...

  8. ORA-19566: exceeded limit of 0 corrupt blocks for file E:\xxxx\<datafilename>.ORA.

    How to Format Corrupted Block Not Part of Any Segment (Doc ID 336133.1) To BottomTo Bottom In this D ...

  9. Orace 12.2 ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_21"

    一个测试环境的12.2.0.1数据库后台alert不断报出以下错误信息: Errors in file /d12/app/oracle/diag/rdbms/test/test/trace/test_ ...

随机推荐

  1. c#.NET微信自定义菜单

    private void customMenu() { //获取access_token string access_token = GetAccessToken(); StringBuilder s ...

  2. nginx中将POST数据写到日志里面的正确方式

    http://www.cnblogs.com/meteorx/p/3188647.html

  3. 【Beta】第四次任务发布

    PM 日常管理&dev版宣传(周日开始). 后端 #99 服务发布 验收条件:使dev版能在www.buaaphylab.com下运行. 前端 #87 登录后能够查看与下载用户收藏的报告.生成 ...

  4. CodeForces 165E Compatible Numbers(位运算 + 好题)

    wo integers x and y are compatible, if the result of their bitwise "AND" equals zero, that ...

  5. 作为一名前端er,从武汉来到深圳三个月有感

    来到深圳已经三个月了,从最开始的担心自己的能力不够怕不能够在深圳这个互联网产品及其发达的城市立足下来,到现在已经慢慢地拾起了一丁点的信心了 (虽然还有很多知识是不够的.但是相当于之前我的,我是觉得我已 ...

  6. postgresql是如何处理死连接(转)

    在数据库postgresql中,一个客户端到服务器连接实际上是一个tcp socket连接,tcp连接是虚连接,一方非正常退出(如断电),另一方会继续维持这个连接.   举个例子,一个客户端电脑正常连 ...

  7. undefined method `environment' for nil:NilClass when importing Bootstrap into rails

    今天做项目时往Gemfile里加了各gem, 然后bundle update了一下, 然后悲剧了,出现了undefined method `environment' for nil:NilClass ...

  8. 【Go入门教程6】interface(interface类型、interface值、空interface{}、嵌入interface、反射)

    interface Go语言里面设计最精妙的应该算interface,它让面向对象,内容组织实现非常的方便,当你看完这一章,你就会被interface的巧妙设计所折服. 什么是interface 简单 ...

  9. C和指针 第六章 指针6.2 6.3字符串中查找的两个版本

    int find_char(char **strings, char ch) { char *string; while ((string = *strings++) != NULL) { while ...

  10. 交叉编译中的build、host和target

    build.host和target    在交叉编译中比较常见的一些参数就是build.host和target了,正确的理解这三者的含义对于交叉编译是非常重要的,下面就此进行解释 --build=编译 ...