以下操作在命令提示字元視窗(cmd.exe)中進行輸入
一、分步進行
1、分步進行匯出
C:\Documents and Settings\Administrator>exp
使用者名稱:userid(資料庫中在安全性下使用者中所建立的使用者)
口令:password
輸入數組提取緩衝區大小:4096>(直接斷行符號)
匯出檔案:expdat.dmp>c:\a.dmp(此處填寫匯出檔案存放地址及名稱)
<1>E,<2>U,<3>T>2(此處選擇匯出類型,我選擇按使用者匯出)
匯出許可權>(直接斷行符號)
匯出表資料>(直接斷行符號)
壓縮區>(直接斷行符號)
要匯出的使用者>userid
要匯出的使用者>(直接斷行符號)
結束#
2、分布進行匯入
步驟同1,開始輸入imp
注意:
只列出匯入檔案的內容注意選擇no
匯入整個匯出檔案選擇yes
二、直接匯入匯出
1、直接匯出
(1) 將資料庫TEST完全匯出,使用者名稱userid 密碼password 匯出到D:\daochu.dmp中
exp
userid/password@TEST
file=d:\daochu.dmp full=y
(2 )將資料庫中userid1使用者與userid2使用者的表匯出
exp
userid1/password@TEST
file=d:\daochu.dmp owner=(userid1,userid2)
(3) 將資料庫中的表table1 、table2匯出
exp
userid/password@TEST
file=d:\daochu.dmp tables=(table1,table2)
(4) 將資料庫中的表table1中的欄位filed1以"00"打頭的資料匯出
exp
userid/password@TEST
file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"
2、直接匯入
(1)將D:\daochu.dmp 中的資料匯入 TEST資料庫中。
imp
userid/password@TEST
file=d:\daochu.dmp ignore=y
(2) 將d:\daochu.dmp中的表table1 匯入
imp
userid/password@TEST
file=d:\daochu.dmp tables=(table1)