[轉]FILESIZE參數 – 輸出寫入到多個匯出檔案

來源:互聯網
上載者:User

標籤:

FILESIZE參數 – 輸出寫入到多個匯出檔案

1. 適用於:

甲骨文公司伺服器 - 企業版 - 版本:8.1.7至10.2

甲骨文公司伺服器 - 個人版 - 版本:8.1.7至10.2

甲骨文公司伺服器 - 標準版 - 版本:8.1.7至10.2

本文檔中的資訊適用於任何平台。

2. 目的:

本文檔提供當從Oracle資料庫匯出資料或將資料匯入回到Oracle資料庫中時有關使用FILESIZE參數資訊。

3. 範圍和應用:

本手冊適用於要使用EXPORT公用程式從Oracle資料庫中匯出資料,並建立多個匯出轉儲檔案,而不是一個單一的(通常是非常大)匯出轉儲檔案的Oracle8i,Oracle9i以及Oracle10g資料庫的使用者。手冊提供了有關使用FILESIZE參數,典型的錯誤資訊,和一些相關的缺陷與可能的解決方案的資訊。

4. 簡介:

1) 預設情況下,輸出將資料寫入一個出口轉存,直至達到最大大小。可以在一個檔案中儲存的最大值是依賴於您的作業系統。另見:

註:62427.1 “2GB或不2GB - 檔案限制在Oracle”

2) 首先介紹Oracle8i,輸出支援寫入到多個出口檔案,輸入可以讀入多個出口檔案。如果你給FILESIZE參數指定一個值(位元組的限制),出口將唯寫入轉儲檔案您指定的位元組大小的資料。

3) 在Oracle9i及更高版本的伺服器上,FILESIZE參數有一個最大的值,這個值等於可以儲存在64位(16EB(艾位元組)= 16384 PB(PB級)=16777216TB(TB級)=17179869184GB(千MB))的最大值。

4) 經典輸出用戶端(EXP)沒有一個真正的轉儲檔案的最佳大小。即使我們只從一個非常大的轉儲匯入一張小表,我們業要通讀完整的轉儲檔案。

5) 請注意這與Oracle10g的資料泵的用戶端(expdp和impdp)不同。如果我們從多個轉儲檔案匯入一張小表,我們只能讀取資料泵轉儲檔案頭,而且我們讀取的資料泵主表可能是儲存在較後位置的轉儲檔案之一。基於主表中的資訊,我們確定該小表處在的轉儲檔案(S),然後我們唯讀那些特定的轉儲檔案(S)。

6) 相比於處理多個小檔案,從檔案查看點處理一個單一的大型輸出轉儲檔案更加困難。 因此,250GB的資料,如果需要匯出,建議建立多個較小的檔案,例如:指定FILESIZE=25G,建立10個規模較小的轉儲檔案。

7) 匯出到磁帶裝置時,不使用FILESIZE參數,而使用VOLSIZE參數。有關詳情,請參閱:

註:30428.1 “Unix系統上的匯出到磁帶”” 

8) 當匯出到一個具名管道,不推薦使用FILESIZE參數。 如果使用FILESIZE參數時使用具名管道,請確保您預先為每個出口轉存檔案建立一個具名管道。有關詳情,請參閱:

註:30528.1 “使用匯出(EXP - 2 EXP-15),匯入(IMP-2IMP-21),或SQL * Loader時的大檔案的問題(2GB +)”

5. 出口參數的用法:FILESIZE

如果你不指定檔案大小(注意,0值相當於不指定FILESIZE)值,不管在File參數指定的檔案數量是多少,輸出都將寫入一個檔案。

如果您匯出檔案所需的空間超過可用的磁碟空間,出口將中止操作,待提供足夠的磁碟空間後,輸出操作才可以重複並完成。

FILESIZE值可以指定為KB(KB數)級。例如,FILESIZE=2KB和FILESIZE= 2048是相同的。同樣,MB指定MB(1024 * 1024)和GB指定千MB(1024** 3)。

B為位元組的簡寫;該數字不用繼續乘以位元組大小而獲得最終的檔案大小(FILESIZE=2048B即是FILESIZE= 2048)。

FILESIZE=0(預設)輸出寫入到一個單一的檔案

FILESIZE=1024或:

FILESIZE=1K或:

FILESIZE=1KB輸出寫入1KB的檔案

FILESIZE=1M或:

FILESIZE=1MB輸出寫入1MB的檔案

FILESIZE=1G或:

FILESIZE= 1GB,輸出寫入1千MB的檔案

當輸出寫入的資料量超過FILESIZE指定的最大值,輸出會從File參數中得到下一個輸出檔案的名稱,如果它已經使用了所有的File參數指定的名稱,輸出會提示您提供了一個新的輸出檔案名。

如果輸出的資料量不適合提供的檔案清單,輸出將提示需要更多的檔案名稱。

如果在後台啟動並執行輸出程式,確保給輸出提供足夠的檔案名稱。在等待您提供額外的檔案名稱時輸出程式會掛起,而您可能不能發現檔案名稱不夠用。

例如:運行一個完整的資料庫輸出的直接路徑和建立750 MB輸出轉儲檔案:

File: exp.par
-------------
FILESIZE=750MB
FILE=exp_f1.dmp,exp_f2.dmp,
exp_f3.dmp,exp_f4.dmp
FULL=Y
DIRECT=Y
LOG=exp_full.log
% exp system/manager PARFILE=exp.par

注1: 當出口分配一個新的出口轉儲檔案,這將記錄在在出口日誌中。

E.g:
...
continuing export into file exp_f2.dmp
...

注2: 已指定File參數,但是出口不需要這個檔案,則該指定的FILE不會被建立。

 

    例如:在上面的例子,如果輸出總額為2 GB,然後輸出將建立3個檔案:

- exp_f1.dmp with size of 750 Mb
- exp_f2.dmp with size of 750 Mb
- exp_f3.dmp with size of 500 Mb

注3: 如果出口需要更多的檔案,將資料匯出,它會提示一個新的檔案名稱。

 

例如:在上面的例子,如果出口總額為3.5 GB,然後出口將建立4個750 MB的檔案,並會提示為剩餘的500 MB資料建立新檔案。鍵入下一個出口轉儲檔案的檔案名稱後,出口將繼續下去。

Example:
...
Export file: EXPDAT.DMP > exp_f5.dmp
...

注4 請注意,File參數指定檔案名稱的命令列文法是:

 

---命令列模式可能的文法(2例):

E.g:
%exp...file=exp_f1.dmp exp_f2.dmp exp_f3.dmp exp_f4.dmp...
%exp...file=exp_f1.dmp,exp_f2.dmp,exp_f3.dmp,exp_f4.dmp ...

或者在Windows系統(3附例):

D:\>exp...file=(exp_f1.dmp exp_f2.dmp exp_f3.dmp exp_f4.dmp)...
D:\>exp...file=(exp_f1.dmp,exp_f2.dmp,exp_f3.dmp,exp_f4.dmp)...
D:\>exp...file="exp_f1.dmp,exp_f2.dmp,exp_f3.dmp,exp_f4.dmp"...

或者在Unix系統(3附例):

% exp... file=\(exp_f1.dmp exp_f2.dmp exp_f3.dmp exp_f4.dmp\)...
% exp...file=\(exp_f1.dmp,exp_f2.dmp,exp_f3.dmp,exp_f4.dmp\)...
% exp...file=‘exp_f1.dmp,exp_f2.dmp,exp_f3.dmp,exp_f4.dmp‘ ...

6. 進口參數:FILESIZE

 

輸入資料時,必須使用匯入參數FILESIZE告訴匯入最大的出口指定轉儲檔案的大小。FILESIZE值可以指定為KB(KB數)級。例如,FILESIZE=2KB和FILESIZE= 2048是相同的。同樣,MB指定MB(1024 * 1024)和GB指定千MB(1024** 3)。

B為位元組的簡寫;該數字不用繼續乘以位元組大小而獲得最終的檔案大小(FILESIZE=2048B即是FILESIZE= 2048)。

FILESIZE=0(預設)出口讀取一個單一的檔案

FILESIZE=1024或:

FILESIZE=1K或:

FILESIZE=1KB出口讀取1KB的檔案

FILESIZE=1M或:

FILESIZE=1MB出口讀取1MB的檔案

FILESIZE=1G或:

FILESIZE= 1GB,出口讀取1千MB的檔案

例如:從上面建立的出口轉儲檔案運行一個表層級的進口程式。

File: imp.par
-------------
FILESIZE=750MB
FILE=exp_f1.dmp,exp_f2.dmp,
exp_f3.dmp,exp_f4.dmp
FROMUSER=scott
TOUSER=scott
TABLES=emp
LOG=imp_emp.log
% imp system/manager PARFILE=imp.par

注1 :如果檔案參數(如在輸出過程中檔案exp_f4.dmp未被建立)中列出的檔案太多,這些檔案名稱會被忽略。

 

注2 :如果沒有列出的所有檔案名稱,進口將主動要求下一個檔案名稱。 

例如如果進口開始指定了 exp_f1.dmp,exp_f2.dmp兩個檔案而沒有提到第三個或最後的檔案名稱exp_f3.dmp,進口會提示為剩餘資料建立新的檔案名稱。輸入正確的檔案名稱後,進口程式將繼續下去。

例如:

...
Import file: EXPDAT.DMP > exp_f3.dmp
...

7. 出口可能的警告和錯誤:

 

1) EXP-75: FILESIZE四捨五入式下降

FILESIZE參數指定的值是RECORDLENGTH參數值的倍數。如果這是不正確的,那麼FILESIZE參數值將下調自動:

% exp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp, \
exp_f4.dmp LOG=exp_f.log FILESIZE=1000m \
DIRECT=y RECORDLENGTH=65535 FULL=y
Export: Release 10.2.0.3.0 - Production on Thu Dec 20 17:19:13 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
EXP-00075: rounding FILESIZE down, new value is 1048560000
Export done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
About to export the entire database ...
...

解決辦法:忽略警告或指定FILESIZE參數為RECORDLENGTH的倍數:

%exp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp, \
exp_f4.dmp LOG=exp_f.log FILESIZE=1048560000 \
DIRECT=y RECORDLENGTH=65535 FULL=y

注1:確保進口時也使用FILESIZE新指定值。

 

注2:有關參數RECORDLENGTH的詳細資料,請參閱:

注3:155477.1 “直接參數:常規路徑匯出與直接路徑匯出的比較”

2) EXP-73:轉儲檔案太小

如果FILESIZE參數值小於RECORDLENGTH參數值,將產生一個錯誤。例如如果出口開始於RECORDLENGTH= 8192和FILESIZE =4KB。

% exp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp, \
exp_f4.dmp LOG=exp_f.log FILESIZE=64k \
DIRECT=y RECORDLENGTH=65535 FULL=y
Export: Release 10.2.0.3.0 - Production on Thu Dec 20 17:39:12 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
EXP-00075: rounding FILESIZE down, new value is 65535
EXP-00073: dump file size too small
EXP-00000: Export terminated unsuccessfully

解決方案:FILESIZE參數,如指定一個較大的值:

%exp system/manager FILE=exp_f1.dmp,exp_f2.dmp,exp_f3.dmp, \
exp_f4.dmp LOG=exp_f.log FILESIZE=640m \
DIRECT=y RECORDLENGTH=65535 FULL=y

3) EXP-2:錯誤寫入匯出檔案

 

如果沒有足夠的空間供出口寫入到轉儲檔案,或另一個進程阻止出口寫入轉儲檔案,出口會因為如下一些錯誤中止:

...
EXP-00030: Unexpected End-Of-File encountered while reading input
.. exporting table EMP_LONG error clossing export file
EXP-00002: Error in writing to export file
EXP-00002: Error in writing to export file
EXP-00000: Export terminated unsuccessfully

解決方案:確保有足夠的自由空間來建立檔案,確保該磁碟沒有任何錯誤,確保其他進程(如防病毒掃描)不會阻止出口寫入檔案,並重新運行出口。

 

8. 匯入時可能的警告和錯誤:

1) IMP-46:使用出口檔案FILESIZE值

如果沒有值指定在進口程式中的FILESIZE參數,將產生一個警告。然而,進口程式將繼續:

% imp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp \
exp_f4.dmp LOG=imp_emp.log \
FROMUSER=scott TOUSER=scott TABLES=emp
Import: Release 10.2.0.3.0 - Production on Thu Dec 20 18:00:48 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export file created by EXPORT:V10.02.01 via direct path
import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
IMP-00046: using FILESIZE value from export file of 786432000
...
Import terminated successfully with warnings.

解決辦法:忽略警告,下一次從這個出口轉儲檔案集輸入時,指定正確的值FILESIZE參數,如:

% imp system/manager FILE=exp_f1.dmp,exp_f2.dmp,exp_f3.dmp \
exp_f4.dmp LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp

2) IMP-47:意外的檔案序號

 

如果以錯誤的順序列出檔案名稱,系統報告錯誤,進口程式將中止,例如:

% imp system/manager FILE=exp_f3.dmp, exp_f2.dmp, exp_f1.dmp \
exp_f4.dmp LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp
Import: Release 10.2.0.3.0 - Production on Thu Dec 20 18:05:04 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export file created by EXPORT:V10.02.01 via direct path
import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
IMP-00047: unexpected file sequence number; expected 1 but found 3
IMP-00132: first file in the multi-file export is exp_f1.dmp
IMP-00000: Import terminated unsuccessfully
Or:
% imp system/manager FILE=exp_f1.dmp, exp_f3.dmp, exp_f2.dmp \
exp_f4.dmp LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp
Import: Release 10.2.0.3.0 - Production on Thu Dec 20 18:13:39 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export file created by EXPORT:V10.02.01 via direct path
import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
IMP-00047: unexpected file sequence number; expected 2 but found 3
IMP-00132: first file in the multi-file export is exp_f1.dmp
IMP-00008: unrecognized statement in the export file:
...

解決方案:以正確的順序指定轉儲檔案,例如:

%imp system/manager FILE=exp_f1.dmp,exp_f2.dmp,exp_f3.dmp \
exp_f4.dmp LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp

3) IMP-40:FILESIZE與出口程式使用的值不匹配

 

如果錯誤的FILESIZE值在進口過程中被指定(例如指定FILESIZE=75m,而非FILESIZE=750m),將報告錯誤:

% imp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp \
exp_f4.dmp LOG=imp_emp.log FILESIZE=75m \
FROMUSER=scott TOUSER=scott TABLES=emp
Import: Release 10.2.0.3.0 - Production on Thu Dec 20 18:18:26 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export file created by EXPORT:V10.02.01 via direct path
import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
IMP-00040: FILESIZE does not match the value used for export: 786432000
IMP-00000: Import terminated unsuccessfully

解決方案:重新啟動進口,並給FILESIZE參數指定正確的值,如:

% imp system/manager FILE=exp_f1.dmp,exp_f2.dmp,exp_f3.dmp\
exp_f4.dmp LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp

4) IMP-2:未能開啟讀取檔案

 

如果你錯誤地指定了一個不正確的檔案名稱,進口將提示輸入正確的檔案名稱:

% imp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp \
exp_f4.dm LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp
Import: Release 10.2.0.3.0 - Production on Thu Dec 20 18:21:02 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export file created by EXPORT:V10.02.01 via direct path
import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
IMP-00002: failed to open exp_f4.dm for read
Import file: EXPDAT.DMP >

解決方案:指定正確的檔案名稱,或者以正確的名稱重新啟動進口轉儲檔案:

...
Import file: EXPDAT.DMP > exp_f4.dmp
...

5) IMP-48:檔案頭不匹配

 

如果你錯誤地指定了一個錯誤的檔案名稱,可能發生以下錯誤:

% imp system/manager FILE=exp_f1.dmp, exp_f2.dmp, exp_f3.dmp \
exp_f.log LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp
Import: Release 10.2.0.3.0 - Production on Thu Dec 20 18:28:26 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export file created by EXPORT:V10.02.01 via direct path
import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
IMP-00048: mismatched file header
IMP-00008: unrecognized statement in the export file:
IMP-00000: Import terminated unsuccessfully
-- or import aborts with:
...
IMP-00048: mismatched file header
IMP-00009: abnormal end of export file
IMP-00000: Import terminated unsuccessfully

解決方案:重新啟動的進口,並指定一系列正確的轉儲檔案的名稱,如:

%impsystem/manager FILE=exp_f1.dmp,exp_f2.dmp,exp_f3.dmp\
exp_f4.dmp LOG=imp_emp.log FILESIZE=750m \
FROMUSER=scott TOUSER=scott TABLES=emp

[轉]FILESIZE參數 – 輸出寫入到多個匯出檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.