ITPub博客

首页 > 数据库 > Oracle > oracle expdp作业外表报错ORA-20011&KUP-11024&ORA-29913

oracle expdp作业外表报错ORA-20011&KUP-11024&ORA-29913

原创 Oracle 作者:清风艾艾 时间:2018-01-11 10:54:58 0 删除 编辑
      2018年1月份第一次巡检中,某地市oracle数据库告警ORA-20011&KUP-11024&ORA-29913,
相关处理如下:

操作系统版本:rhel 2.6.39-400.17.1.el6uek.x86_64 
操作系统内核:rhel 2.6.39-400.17.1.el6uek.x86_64

数据库版本:oracle 11.2.0.4

问题描述:数据库对数据泵作业残余外部表收集统计信息报错:ORA-20011&KUP-11024&ORA-29913 

告警日志报错信息如下: 
09/01/2018 22:00:10 DBMS_STATS: GATHER_STATS_JOB encountered errors. Check the trace file. 
ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout 
Tue Jan 09 22:00:10 2018 
KUP-11024: This external table can only be accessed from within a Data Pump job. 
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_j003_333.trc 

查看告警日志提示的trc跟踪文件orcl_j003_333.trc 
Trace file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_j003_333.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 = /u01/app/oracle/product/11.2.0/db_1 
System name: Linux 
Node name: cis.db 
Release: 2.6.39-400.17.1.el6uek.x86_64 
Version: #1 SMP Fri Feb 22 18:16:18 PST 2013 
Machine: x86_64 
Instance name: orcl 
Redo thread mounted by this instance: 1 
Oracle process number: 57 
Unix process pid: 333, image: oracle@cis.db (J003) 
*** 2018-01-09 22:00:10.612 
*** SESSION ID:(634.22947) 2018-01-09 22:00:10.612 
*** CLIENT ID:() 2018-01-09 22:00:10.612 
*** SERVICE NAME:(SYS$USERS) 2018-01-09 22:00:10.612 
*** MODULE NAME:(DBMS_SCHEDULER) 2018-01-09 22:00:10.612 
*** ACTION NAME:(ORA$AT_OS_OPT_SY_152) 2018-01-09 22:00:10.612 
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. 
*** 2018-01-09 22:00:10.612 
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"EXPDP"','"ET$01B7017F0001"','""', ...) 
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. 
*** 2018-01-09 22:00:10.656 
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"EXPDP"','"ET$01C303530001"','""', ...) 
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. 
*** 2018-01-09 22:00:10.686 
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"EXPDP"','"ET$01982C090001"','""', ...) 
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. 
*** 2018-01-09 22:00:10.711 
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"EXPDP"','"ET$01D400370001"','""', ...) 
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. 
*** 2018-01-09 22:00:10.735 
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"EXPDP"','"ET$01D3186F0001"','""', ...) 
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. 
*** 2018-01-09 22:00:10.759 
DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"EXPDP"','"ET$00251AEF0001"','""', ...) 
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. 

处理方法: 
1、DBMS_STATS job 运行时,没有DataPump job运行 
SQL> !ps -ef|grep expdp 
oracle 28440 28067 0 09:49 pts/0 00:00:00 /bin/bash -c ps -ef|grep expdp 
oracle 28442 28440 0 09:49 pts/0 00:00:00 grep expdp 

2、确定外部表属于datapump job 
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, 
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$%'; 
OWNER OBJECT_NAME OBJECT_TYPE STATUS CREATED LAST_DDL_TIME 
------------------------------ ------------------------------ ------------------------- ------- ------------------------- ------------------------- 
EXPDP ET$01D400370001 TABLE VALID 09-oct-2015 23:11:41 09-oct-2015 23:11:41 
EXPDP ET$01D3186F0001 TABLE VALID 18-dec-2015 02:20:04 18-dec-2015 02:20:04 
EXPDP ET$01C303530001 TABLE VALID 15-mar-2015 00:45:46 15-mar-2015 00:45:46 
EXPDP ET$01B7017F0001 TABLE VALID 15-mar-2015 00:42:03 15-mar-2015 00:42:03 
EXPDP ET$01982C090001 TABLE VALID 08-oct-2015 23:51:06 08-oct-2015 23:51:06 
EXPDP ET$00251AEF0001 TABLE VALID 29-dec-2015 00:50:20 29-dec-2015 00:50:20 

6 rows selected. 
SQL> select owner, TABLE_NAME, DEFAULT_DIRECTORY_NAME, ACCESS_TYPE 
from dba_external_tables 
order by 1,2; 
OWNER TABLE_NAME DEFAULT_DIRECTORY_NAME ACCESS_ 
------------------------------ ------------------------------ ------------------------------ ------- 
EXPDP ET$00251AEF0001 EXPDATA CLOB 
EXPDP ET$01982C090001 EXPDATA CLOB 
EXPDP ET$01B7017F0001 EXPDATA CLOB 
EXPDP ET$01C303530001 EXPDATA CLOB 
EXPDP ET$01D3186F0001 EXPDATA CLOB 
EXPDP ET$01D400370001 EXPDATA CLOB 
SYS ALERT_LOG_VIEW BDUMP CLOB 

--查询外部表,报的错误和alert日志一样 
SQL> select count(*) from EXPDP.ET$00251AEF0001; 
select count(*) from EXPDP.ET$00251AEF0001 
* 
ERROR at line 1: 
ORA-29913: error in executing ODCIEXTTABLEOPEN callout 
KUP-11024: This external table can only be accessed from within a Data Pump job. 
SQL> 

--查看外部表定义 
SQL> desc ET$00251AEF0001 
ERROR: 
ORA-04043: object ET$00251AEF0001 does not exist 


3、清理DataPump jobs。 
SQL> select 'drop table '||owner||'.'||object_name||' purge ;' from dba_objects where object_name like 'ET$%'; 
'DROPTABLE'||OWNER||'.'||OBJECT_NAME||'PURGE;' 
---------------------------------------------------- 
drop table EXPDP.ET$01D400370001 purge ; 
drop table EXPDP.ET$01D3186F0001 purge ; 
drop table EXPDP.ET$01C303530001 purge ; 
drop table EXPDP.ET$01B7017F0001 purge ; 
drop table EXPDP.ET$01982C090001 purge ; 
drop table EXPDP.ET$00251AEF0001 purge ; 

6 rows selected. 

SQL> drop table EXPDP.ET$01D400370001 purge ; 
drop table EXPDP.ET$01D3186F0001 purge ; 
drop table EXPDP.ET$01C303530001 purge ; 
drop table EXPDP.ET$01B7017F0001 purge ; 
drop table EXPDP.ET$01982C090001 purge ; 
drop table EXPDP.ET$00251AEF0001 purge ; 
Table dropped. 

SQL> 
Table dropped. 

SQL> 
Table dropped. 

SQL> 
Table dropped. 

SQL> 
Table dropped. 

SQL> 

Table dropped.

      由以上信息可知,数据泵的外部表产生的时间分别是2015年3月份和10月份,经沟通得知该地市数据库服务
器发生过重装和机房搬迁:

猜测:可能当时数据库重装和机房搬迁,数据库使用过数据泵备份而数据泵作业没有成功退出,导致数据泵
作业外部表残留,影响到数据库统计信息收集,处理方法就是删除数据泵作业残留外部表。个人觉得比较奇
怪的是数据泵作业外部表实体已经不存在,DDL定义已经不存在,但是外部表明却存在,应该是数据库字典
信息错误。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29357786/viewspace-2150037/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
个人喜欢IT行业,目前从事数据库工作,包括Oracle、mysql、mongodb、sqlserver等数据库的维护,喜欢专研开发技术,尤其对java程序的开发感兴趣。工作经历上,在中国联通系统集成公司、中公网医疗信息技术有限公司做过数据库技术支持;目前在海量数据,负责华东区oracle、mysql、mongodb的维护工作。

注册时间:2015-01-30

  • 博文量
    179
  • 访问量
    215354