這兩天執行導入dump文件時總碰到一個問題。 問題現象 : 1. 執行:imp xyz/xxx file=test.dmp log=imp_test.log fromuser=test1 touser=test2ignore=y commit=y buffer=300000000 feedback=10000 注:這個文件dump200G容量。 2. 執行了許久,但最后結果和log
這兩天執行導入dump文件時總碰到一個問題。
問題現象:
1. 執行:imp xyz/xxx file=test.dmp log=imp_test.log fromuser=test1 touser=test2 ignore=y commit=y buffer=300000000 feedback=10000
注:這個文件dump>200G容量。
2. 執行了許久,但最后結果和log中記錄:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
Warning: the objects were exported by TEST1, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing TEST1's objects into TEST2
Import terminated successfully without warnings.
3. 但沒有任何dump中的數據導入到test2用戶中。
原因分析:
首先,其實是對imp命令中的fromuser參數偏差的理解。
[root@vm-vmw4131-t ~]# imp -help
FROMUSER list of owner usernames
imp指令幫助中說明FROMUSER的含義是“屬主用戶名列表”,相應的,從exp指令幫助中可以看到OWNER參數表示的是相同的含義:
[root@vm-vmw4131-t ~]# exp -help
OWNER list of owner usernames
即該用戶指的是對象所屬用戶。
其次,經過咨詢,上述問題中用到的fromuser=test1這個test1用戶是執行exp的系統賬戶,并不是數據庫對象所屬賬戶,這就能解釋上面問題的原因了:由于dump文件所屬的數據對象賬戶是另外一個賬戶,不是test1,因此使用imp ... fromuser=test1時,會檢索這個文件dump,查找屬于test1用戶的對象,全文件掃描后,根本沒有屬于該用戶的對象,因此提示“Import terminated successfully without warnings”正常結束。
總結:
1. 這次導入導出時可能根本沒實際考慮LANG等字符集環境變量。
2. imp的fromuser指的是對象所屬用戶,不是執行exp導出的用戶。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com