除了命令列參數,Oracle imp 也提供互動式模式,逐步提示輸入參數,適合不熟參數語法或臨時一次性導入的場合。本文以實際畫面流程示範從啟動到完成的完整操作步驟。
在 Windows CMD 視窗輸入 imp 並按 Enter:
C:\> imp
Import: Release 11.2.0.1.0 - Production ...
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
| 提示訊息 | 說明 | 建議輸入 |
|---|---|---|
| Username: | 執行導入的資料庫帳號 | scott |
| Password: | 對應密碼(輸入時不顯示) | tiger |
| Import data only (yes/no): | 是否僅導入資料(不建立物件) | no |
| Import file: | 導入的 .dmp 檔案路徑 | d:\test.dmp |
| Enter insert buffer size (minimum is 8192) 30720>: | 插入緩衝區大小,直接 Enter 使用預設 | (Enter) |
| List contents of import file only (yes/no): | 僅列出檔案內容不實際導入 | no |
| Ignore create error due to object existence (yes/no): | 物件已存在時是否忽略錯誤繼續導入資料 | yes(覆蓋資料) / no(保守) |
| Import grants (yes/no): | 是否導入權限授予 | yes |
| Import table data (yes/no): | 是否導入表資料 | yes |
| Import entire export file (yes/no): | 是否導入整個導出檔(no 可指定特定使用者/表) | no |
| Username: | 指定導入資料的目標 Schema(物件將建立在此 Schema 下) | scott |
確認參數後,imp 開始讀取檔案、建立物件、導入資料,過程中會顯示字符集轉換資訊與進度:
Export file created by EXPORT:V11.02.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
...
Import terminated successfully with warnings.
ignore=y 會報錯停止;建議正式環境先評估是否需 DROP 重建或使用 ignore=y。IMP_FULL_DATABASE 或 DBA 權限。