Oracle exp imp 資料匯入匯出

2021-07-15 09:27:23 字數 810 閱讀 4896

rem 按表名匯出資料

exp 使用者名稱/密碼@ip/資料庫名稱 tables=表名 file=表名.dmp log=表名.log compress=n

rem 按表名+查詢條件匯出資料

exp 使用者名稱/密碼@ip/資料庫名稱 tables=表名 file=表名.dmp log=表名.log compress=n query="'where id in(123)'"

rem 按表匯入

imp 使用者名稱/密碼@ip/資料庫名稱 file=資料檔名.dmp tables=表名 ignore=y

rem 批量匯出單錶

select

'exp 使用者名稱/密碼@ip/資料庫名稱 tables='|| table_name ||' file='|| table_name ||'.dmp log='|| table_name ||'.log compress=n'

as sqls

from user_tables a

order

by num_rows desc

異常處理:

需求描述:

如果使用者名稱的密碼使用的是特殊字元,如@!#$%,會出現如下錯誤:

「exp-00056: 遇到 oracle 錯誤 12154」,

解決辦法:用引號將密碼括起來,如下:

windows os: exp username/"""password"""@db --3個雙引號擴密碼

linux/unix os: exp 'username/"password"@db' --1個雙引號擴密碼,1個單引號擴全部

oracle exp imp 資料備份

1 oracle11g預設對空表不分配segment,故使用exp匯出oracle11g資料庫時,空表不會匯出。解決辦法 設定deferred segment creation 引數為false後,無論是空表還是非空表,都分配segment。在sqlplus中,執行如下命令 sql alter sy...

Oracle EXP IMP引數詳解

exp imp是oracle自帶的匯入匯出命令,運用它,即使不需要那結ui工具也能輕易的完成資料匯出匯入工作,下面是它們的引數 exp引數詳解 使用的格式是 exp keyword value 或 keyword value1,value2,valuen 其中userid是必須的且為第乙個引數 關鍵...

Oracle(exp imp)匯入匯出

直接進入系統命令行執行即可。exp命令 1 exp username psw test file d test.dmp full y 2 exp username psw test file d test.dmp owner ly 3 exp username psw test file d tes...