對imp中的fromuser參數的偏差理解,impfromuser

來源:互聯網
上載者:User

對imp中的fromuser參數的偏差理解,impfromuser

這兩天執行匯入dump檔案時總碰到一個問題。


問題現象

1. 執行:imp xyz/xxx file=test.dmp log=imp_test.log fromuser=test1 touser=test2ignore=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匯出的使用者。


oracle imp 採用 fromuser touser 的模式,提示“正在將 xxx 的對象匯入到 xxx”;

木事的,最大可能是表太大,表上有索引,並且索引也不小
 
在dos中將資料庫資料匯入oracle時,報這樣的錯: IMP-00034:警告:在匯出檔案中未找到FromUser"IIMS"

我一般這樣匯入的
imp 新使用者名稱/密碼@服務名 file=需要匯入的檔案 fromuser=資料庫檔案的匯出使用者名稱 touser=新使用者名稱 log=就匯入全過程的日誌
如果還有疑問,可執行imp help=y 查看更多的參數
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.