EXP-00091 EXP导出错误问题困惑
admin
2023-05-08 05:40:55
0

今天要求将部分表数据导出

提供的exp导出脚本如下:

USERID=x/x@x
BUFFER=102400
ROWS=Y 
LOG=T_DAYLOG_CALLBYSERVICE.log
FILE=T_DAYLOG_CALLBYSERVICE.dmp
tables=T_DAYLOG_CALLBYSERVICE
query="where logdate between to_date('20150810','YYYYMMDD') and  to_date('20150828','YYYYMMDD')"

尝试执行报错

$exp parfile=T_DAYLOG_CALLBYSERVICE.PAR
Export: Release 10.2.0.4.0 - Production on Tue Sep 1 16:05:15 2015
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table         T_DAYLOG_CALLBYSERVICE      10197 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.

如其提示以报错EXP-00091,查看错误

[oracle@SH-SRV-UIDB:/u01/script]$oerr exp 00091
00091, 00000, "Exporting questionable statistics."
// *Cause:  Export was able export statistics, but the statistics may not be
//          usuable. The statistics are questionable because one or more of
//          the following happened during export: a row error occurred, client
//          character set or NCHARSET does not match with the server, a query
//          clause was specified on export, only certain partitions or
//          subpartitions were exported, or a fatal error occurred while
//          processing a table.
// *Action: To export non-questionable statistics, change the client character
//          set or NCHARSET to match the server, export with no query clause,
//          export complete tables. If desired, import parameters can be
//          supplied so that only non-questionable statistics will be imported,
//          and all questionable statistics will be recalculated.

根据上述的要求可能是字符集不符合,或者导出时指定查询子,分区或子分区被导出,或处理表的时候发生的错误等(翻译能力有限,仅能这样理解)。

查看客户端和服务端字符集是否相符

SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
select * from nls_database_parameters t where t.parameter='NLS_CHARACTERSET';  
select * from v$nls_parameters  where parameter='NLS_CHARACTERSET'

在环境变量中增加语言设定

export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
echo $NLS_LANG

重新导出依旧报00091的错,尝试去掉query也报错,修改脚本尝试使用expdp工具导出表。

USERID=x/x@x
DIRECTORY=BACKUPDIR
COMPRESSION=NONE
CONTENT=ALL
LOGFILE=T_DAYLOG_CALLBYSERVICE.log
DUMPFILE=T_DAYLOG_CALLBYSERVICE.dmp
TABLES=T_DAYLOG_CALLBYSERVICE
QUERY="where logdate between to_date('20150810','YYYYMMDD') and  to_date('20150828','YYYYMMDD')"

查看日志正确导出,但仔细观察发现导出的行数与exp导出相同均为10197行。

Export: Release 10.2.0.4.0 - 64bit Production on Tuesday, 01 September, 2015 15:24:24
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
;;; 
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "ICD"."SYS_EXPORT_TABLE_01":  parfile=T_DAYLOG_CALLBYSERVICE.PAR 
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 168 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS. . exported "ICD"."T_DAYLOG_CALLBYSERVICE"             980.4 KB   10197 rows
Master table "ICD"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for ICD.SYS_EXPORT_TABLE_01 is:
  /u01/temp/T_DAYLOG_CALLBYSERVICE.dmp
Job "ICD"."SYS_EXPORT_TABLE_01" successfully completed at 15:24:28

也就是说,导出应该是成功的,但因为某些原因还是报错。

在文档EXP Utility Reports EXP-91 During Export (文档 ID 730106.1)中,笔者找到了这个问题的解释。
Oracle统计量是CBO的工作基础。Oracle优化器在发展历程中,经历了从RBO到CBO的演变过程。RBO时代,优化器生成规则是以代码的方式固化在Oracle代码中的。而CBO的工作是基于数据对象统计量。统计量反映在实体上,就是一系列的元数据信息。在9i时代,CBO与RBO共同作用,而且统计量是需要人工进行收集维护的。而且,由于数据变化的原因,在一些早期CBO版本中,“实时”统计量往往还不能获得最好的执行计划。所以,在9i的Exp/Imp工具开始,统计量导出就成为Exp工具默认行为。

 

也就是说exp工具在导出时使用了统计功能,而报错的发生就和统计有关。问题没有能解决

相关内容

热门资讯

Google在港推出AI代理G... 观点网讯:7月29日,Google在香港推出AI代理Gemini Spark,该代理可全天候在后台运...
5G+165Hz!联想新品官宣... 近两年来,小屏平板一直是比较有趣的一个品类。 不同于大平板注重效率、手机追求万能的特点,拯救者Y70...
原创 马... 马斯克又出来了。这次说2036年钱就没用了。 理由是人工智能加机器人,东西多到你用不完,还拿钱干嘛...
美的集团:我国智能家居互联互通... IT之家 7 月 30 日消息,美的集团今日发布公告,7 月 21 日至 23 日,智能家居互联互通...
华为新款MatePad Pro... 【CNMO科技消息】7月30日,@华为终端 官宣全新旗舰平板华为MatePad Pro。 新款华为...
从实验室到实景验证:6G光子太... 全息通信是第六代移动通信(6G)的典型应用场景之一,旨在通过融合无线传输与全息三维成像技术,实现超大...
从“能对话”到“能干活”——人... 【经济界面】 光明日报记者 刘坤 李晓东 周洪双 人工智能(AI)眼镜化身为个人“助理”,实时进行...
【全新发布】UminiP Pr... (来源:洲明科技)
日本通过“H3火箭8号”发射失... △H3火箭(资料图) 日本文部科学省30日召开关于去年“H3火箭8号”发射失败的会议。会议通过的最终...
互联网巨头抢滩健康硬件,上游芯... 封面新闻记者 付文超 当下,互联网巨头对健康硬件的押注,正在成为产业现实,加速拉动整个产业链步入新一...