溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

EXP-00091 EXP導(dǎo)出錯誤問題困惑

發(fā)布時間:2020-10-01 09:59:09 來源:網(wǎng)絡(luò) 閱讀:1694 作者:onlinekof2001 欄目:關(guān)系型數(shù)據(jù)庫

今天要求將部分表數(shù)據(jù)導(dǎo)出

提供的exp導(dǎo)出腳本如下:

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')"

嘗試執(zhí)行報錯

$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.

根據(jù)上述的要求可能是字符集不符合,或者導(dǎo)出時指定查詢子,分區(qū)或子分區(qū)被導(dǎo)出,或處理表的時候發(fā)生的錯誤等(翻譯能力有限,僅能這樣理解)。

查看客戶端和服務(wù)端字符集是否相符

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'

在環(huán)境變量中增加語言設(shè)定

export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
echo $NLS_LANG

重新導(dǎo)出依舊報00091的錯,嘗試去掉query也報錯,修改腳本嘗試使用expdp工具導(dǎo)出表。

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')"

查看日志正確導(dǎo)出,但仔細(xì)觀察發(fā)現(xiàn)導(dǎo)出的行數(shù)與exp導(dǎo)出相同均為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

也就是說,導(dǎo)出應(yīng)該是成功的,但因為某些原因還是報錯。

在文檔EXP Utility Reports EXP-91 During Export (文檔 ID 730106.1)中,筆者找到了這個問題的解釋。
Oracle統(tǒng)計量是CBO的工作基礎(chǔ)。Oracle優(yōu)化器在發(fā)展歷程中,經(jīng)歷了從RBO到CBO的演變過程。RBO時代,優(yōu)化器生成規(guī)則是以代碼的方式固化在Oracle代碼中的。而CBO的工作是基于數(shù)據(jù)對象統(tǒng)計量。統(tǒng)計量反映在實體上,就是一系列的元數(shù)據(jù)信息。在9i時代,CBO與RBO共同作用,而且統(tǒng)計量是需要人工進(jìn)行收集維護(hù)的。而且,由于數(shù)據(jù)變化的原因,在一些早期CBO版本中,“實時”統(tǒng)計量往往還不能獲得最好的執(zhí)行計劃。所以,在9i的Exp/Imp工具開始,統(tǒng)計量導(dǎo)出就成為Exp工具默認(rèn)行為。

 

也就是說exp工具在導(dǎo)出時使用了統(tǒng)計功能,而報錯的發(fā)生就和統(tǒng)計有關(guān)。問題沒有能解決

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI