Oracle數據庫導入導出方法的個人總結
1.使用命令行:
數據導出:
1.將數據庫TEST完全導出,用戶名system密碼manager導出到D:daochu.dmp中
exp system/manager@TEST file=d:daochu.dmp full=y
2.將數據庫中system用戶與sys用戶的表導出
exp system/manager@TEST file=d:daochu.dmp owner=(system,sys)
3.將數據庫中的表inner_notify、notify_staff_relat導出
exp aichannel/aichannel@TESTDB2 file= d:datanewsmgnt.dmp tables=(inner_notify,notify_staff_relat)
4.將數據庫中的表table1中的字段filed1以'00'打頭的數據導出
exp system/manager@TEST file=d:daochu.dmp tables=(table1) query=' where filed1 like '00%''
上面是常用的導出,對于壓縮,既用winzip把dmp文件可以很好的壓縮。
也可以在上面命令后面加上compress=y來實現。
數據的導入:
1.將D:daochu.dmp 中的數據導入 TEST數據庫中。
imp system/manager@TEST file=d:daochu.dmp
imp aichannel/aichannel@HUST full=y file=file= d:datanewsmgnt.dmp ignore=y
上面可能有點問題,因為有的表已經存在,然后它就報錯,對該表就不進行導入。
在后面加上 ignore=y 就可以了。
2.將d:daochu.dmp中的表table1導入
imp system/manager@TEST file=d:daochu.dmp tables=(table1)
2.plsql:
數據導出:
TOOLS-Export user objects(用戶對象)
TOOLS-Export tables(表)
數據的導入:
TOOLS-Import tables
Oracle Import(表) SQL Inserts(用戶對象)
也可以將用戶對象的語句拷貝出來,粘貼到Command Window這樣的好處是可以看到執行的過程。
