exp00091 oracle,EXP-00091 EXP导出错误问题困惑

博客讲述了在使用Oracle数据库进行数据导出时遇到EXP-00091错误的问题。作者检查了客户端和服务端的字符集,并尝试了不同的导出方式,包括修改导出脚本和使用expdp工具,但仍然报错。尽管最终通过expdp工具成功导出了数据,但错误仍然存在。博客探讨了统计量在Oracle优化器中的角色,以及可能引起错误的原因。
摘要由CSDN通过智能技术生成

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

提供的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工具在导出时使用了统计功能,而报错的发生就和统计有关。问题没有能解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值