Chinaunix首页 | 论坛 | 博客
  • 博客访问: 669840
  • 博文数量: 128
  • 博客积分: 265
  • 博客等级: 二等列兵
  • 技术积分: 1464
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-27 20:44
个人简介

just do it

文章分类

全部博文(128)

文章存档

2023年(1)

2020年(1)

2019年(1)

2018年(3)

2017年(6)

2016年(17)

2015年(16)

2014年(39)

2013年(34)

2012年(10)

分类: Oracle

2015-08-24 10:58:28


点击(此处)折叠或打开

  1. 后台alert报以下信息:
  2. DBMS_STATS: GATHER_STATS_JOB encountered errors.  Check the trace file.
  3. Errors in file /orahome/oracle/diag/rdbms/bims/bims/trace/bims_j000_11430.trc:
  4. ORA-20011: Approximate NDV failed: ORA-29913: 执行 ODCIEXTTABLEOPEN 调出时出错
  5. ORA-29400: 数据插件错误error opening file /orahome/oracle/admin/bims/create/sh_sales_ext.log
  6.  
  7. 关于这些错误,MOS文档ID 1274653.1有详细的说明,如下:
  8. ORA-20011 ORA-29913 and ORA-29400 with Associated KUP-XXXXX Errors from DBMS_STATS.GATHER_STATS_JOB (文档 ID 1274653.1)
  9. 类型:PROBLEM状态:PUBLISHED优先级:3
  10. 注释 (0)
  11. APPLIES TO
  12.  
  13. Oracle Server - Standard Edition - Version 11.2.0.2 and later
  14. Oracle Server - Enterprise Edition - Version 11.2.0.2 and later
  15. Oracle Server - Personal Edition - Version 11.2.0.2 and later
  16. Information in this document applies to any platform.
  17. SYMPTOMS
  18.  
  19. The key identifiers in these cases are typically the following:
  20.  
  21. DBMS_STATS is being executed in some form
  22. ORA-20011, ORA-29913 and ORA-29400 Errors are seen, ORA-29913 specifying external function "ODCIEXTTABLEOPEN" signifying that there was an error in the callout by the external function "ODCIEXTTABLEOPEN " while trying to open an external table.
  23. Some specific examples follow:
  24.  
  25. When attempting to run GATHER_STATS_JOB the following errors occur:
  26.  ORA-20011: Approximate NDV failed:ORA-29913: error in executing ODCIEXTTABLEOPEN callout
  27. ORA-29400: data cartridge error
  28.  
  29. usually accompanied with varying other errors such as:
  30.  KUP-11024: This external table can only be accessed from within a Data Pump job
  31. and others.
  32.  
  33. Note: With cases where the file was not found in the directory specified raising:
  34. KUP-04040: file %s in %s not found
  35. See:
  36.  
  37. Document 150737.1 ORA-29913, ORA-29400, KUP-04040 While Selecting from External Table
  38. Document 1290722.1 "KUP-04040: file timezdif.csv in TIMEZDIF_DIR not found " logged by GATHER_STATS_JOB in alert.log after upgrade
  39. Document 1305127.1 KUP-04040: file TRCA_CONTROL.txt in TRCA$STAGE not found
  40. Alternatively you may get text in the trace file like:
  41.  *** 2012-09-10 05:00:11.921
  42. DBMS_STATS: GATHER_STATS_JOB: GATHER_TABLE_STATS('"SH"','"SALES_TRANSACTIONS_EXT"','""', ...)
  43. DBMS_STATS: ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
  44. ORA-29400: data cartridge error
  45. error opening file ../demo/schema/log/ext_1v3.log 
  46. CAUSE
  47.  
  48. 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.
  49.  
  50. There are many reasons that an external table may not exist including:
  51.  
  52. Temporary Datapump external tables have not been cleaned up properly. The dictionary information should have been dropped when the DataPump jobs completed.
  53.  
  54. An External table has been removed without clearing up the corresponding data dictionary information. For example: Oracle Demo Schema Tables such as the external table “SALES_TRANSACTIONS_EXT” may have been removed but the dictionary has not been updated to reflect this. The "SALES_TRANSACTIONS_EXT" table is an external table in the "SH" schema which is one of Demo Schema provided by Oracle.
  55.  
  56. SOLUTION
  57.  
  58. Essentially the solution to this issue is to clean up the orphaned dictionary entries. Different solutions are appropriate dependent on the exact nature of the primary cause and these are outlined below:
  59.  
  60. Temporary Datapump External Table
  61.  
  62. Ensure that there are no DataPump jobs running at the same time as the DBMS_STATS job (this is to avoid any potential complications associated with cleaning up at the same time as someting else is running).
  63. Check and clean up orphaned DataPump jobs. Both above steps can be done by following note:
  64.  
  65. Note:336014.1 How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ?
  66. Identify external tables. To do this, Run the following as SYSDBA in SQL*Plus
  67.  
  68. spool obj.out
  69. set linesize 200 trimspool on
  70. set pagesize 2000
  71. col owner form a30
  72. col created form a25
  73. col last_ddl_time form a25
  74. col object_name form a30
  75. col object_type form a25
  76.  
  77. select OWNER,OBJECT_NAME,OBJECT_TYPE, status,
  78. to_char(CREATED,'dd-mon-yyyy hh24:mi:ss') created
  79. ,to_char(LAST_DDL_TIME , 'dd-mon-yyyy hh24:mi:ss') last_ddl_time
  80. from dba_objects
  81. where object_name like 'ET$%'
  82. /
  83.  
  84. select owner, TABLE_NAME, DEFAULT_DIRECTORY_NAME, ACCESS_TYPE
  85. from dba_external_tables
  86. order by 1,2
  87. /
  88.  
  89. spool off
  90.  
  91. Correlate the information from DBA_OBJECTS and DBA_EXTERNAL TABLES above to identify the temporary external tables that belong to the DataPump.
  92. Drop the temporary external tables that belong to the DataPump. eg:
  93.  
  94. SQL> drop table system.&1 purge;
  95. Enter value for 1: ET$00654E1E0001
  96. old 1: drop table system.&1 purge
  97. new 1: drop table system.ET$00654E1E0001 purge
  98. Other External Table
  99.  
  100. With cases where specific External tables (be they Demo Schema tables or other tables) are missing, the process for handling them is much the same and can be resolved by following the procedures below. For example, if the additional error is 'error opening file ../demo/schema/log/ext_1v3.log', then this indicates that there is a problem opening or locating the log file from the demo schema directory. The implication is that the demo tables have not been cleared up correctly:
  101.  
  102. Try to locate the files for these tables in their directory. It may be that the files still exist but they have just been renamed or re-located. If that is the case you can correct the location to avoid the problem. If the file has been removed then follow either the following steps:
  103. Lock the statistics on these tables by using the following command:
  104. DBMS_STATS.LOCK_TABLE_STATS ('ownname','tabname');
  105. (This step prevents DBMS_STATS from gathering against the missing table)
  106.  
  107. AND/OR
  108.  
  109. Remove the table.  For example if the "SALES_TRANSACTIONS_EXT" Demo table is missing you would use :
  110. DROP TABLE SALES_TRANSACTIONS_EXT;
  111.  
  112.  
  113.  
  114. REFERENCES
  115.  
  116. NOTE:336014.1 - How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ?
  117. BUG:9387797 - ORA-20011 / ORA-1870 EXECUTING GATHER_FIXED_OBJECTS_STATS AFTER UPGRADE TO 11.2
  118. @ BUG:9471411 - QUERY ON X$KWQITCX RETURNS ORA-01870 WHEN AQ_TM_PROCESSES=0
  119. NOTE:150737.1 - ORA-29913, ORA-29400, KUP-04040 While Selecting from External Table
  120. NOTE:1290722.1 - "KUP-04040: file timezdif.csv in TIMEZDIF_DIR not found " logged by GATHER_STATS_JOB in alert.log after upgrade
  121. NOTE:1305127.1 - KUP-04040: file TRCA_CONTROL.txt in TRCA$STAGE not found

阅读(3114) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~