导入导出oracle数据库表的dmp文件
來(lái)源于:
http://jingyan.baidu.com/article/ff42efa917eca2c19f22025a.html
http://blog.csdn.net/lanpy88/article/details/7580691
通過(guò)導(dǎo)入導(dǎo)出dmp文件,可以把一個(gè)或多個(gè)數(shù)據(jù)庫(kù)表的表結(jié)構(gòu)和表數(shù)據(jù)同時(shí)導(dǎo)入導(dǎo)出。下面來(lái)講述一下如何進(jìn)行導(dǎo)入導(dǎo)出。
先進(jìn)入命令行,點(diǎn)擊開(kāi)始,輸入cmd:
導(dǎo)入的命令是:imp?用戶(hù)名/密碼@網(wǎng)絡(luò)服務(wù)名?file=xxx.dmp?full=y;
如:
?
?
小貼士:導(dǎo)出多個(gè)表時(shí),表名使用逗號(hào)隔開(kāi)如:
tables=(table1,table2,table3)。
經(jīng)過(guò)這四步,就可以進(jìn)行數(shù)據(jù)庫(kù)表結(jié)構(gòu)和表數(shù)據(jù)的同時(shí)導(dǎo)入導(dǎo)出了。
?
?
導(dǎo)出: 方法一:利用PL/SQL Developer工具導(dǎo)出: 菜單欄---->Tools---->Export Tables,如下圖,設(shè)置相關(guān)參數(shù)即可: 方法二:利用cmd的操作命令導(dǎo)入導(dǎo)出:3:導(dǎo)入與導(dǎo)出,如下:
數(shù)據(jù)導(dǎo)出:
?1 將數(shù)據(jù)庫(kù)TEST完全導(dǎo)出,用戶(hù)名system 密碼manager, 實(shí)例名TEST? 導(dǎo)出到D:\daochu.dmp中
?? exp?system/manager@TEST?file=d:\daochu.dmp full=y
?2 將數(shù)據(jù)庫(kù)中system用戶(hù)與sys用戶(hù)的表導(dǎo)出
?? exp?system/manager@TEST?file=d:\daochu.dmp owner=(system,sys)
?3 將數(shù)據(jù)庫(kù)中的表table1 、table2導(dǎo)出
?? exp?system/manager@TEST?file=d:\daochu.dmp tables=(table1,table2)?
?4 將數(shù)據(jù)庫(kù)中的表table1中的字段filed1以"00"打頭的數(shù)據(jù)導(dǎo)出
?? exp?system/manager@TEST?file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"
??
???? 上面是常用的導(dǎo)出,對(duì)于壓縮我不太在意,用winzip把dmp文件可以很好的壓縮。
??不過(guò)在上面命令后面 加上 compress=y? 就可以了?
?
?
?
?
?
?
導(dǎo)入:
?1 將D:\daochu.dmp 中的數(shù)據(jù)導(dǎo)入 TEST數(shù)據(jù)庫(kù)中。
?? imp?system/manager@TEST? file=d:\daochu.dmp
?? 上面可能有點(diǎn)問(wèn)題,因?yàn)橛械谋硪呀?jīng)存在,然后它就報(bào)錯(cuò),對(duì)該表就不進(jìn)行導(dǎo)入。
?? 在后面加上 ignore=y 就可以了。
?2 將d:\daochu.dmp中的表table1?導(dǎo)入
?imp?system/manager@TEST? file=d:\daochu.dmp? tables=(table1)?
?
注意事項(xiàng):導(dǎo)出dmp數(shù)據(jù)時(shí)需要有導(dǎo)出表的權(quán)限的用戶(hù),否則不能導(dǎo)出。
?
轉(zhuǎn)載于:https://www.cnblogs.com/ys-wuhan/p/6042314.html
總結(jié)
以上是生活随笔為你收集整理的导入导出oracle数据库表的dmp文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 使用sqlite3创建数据库表的时候须要
- 下一篇: linux cmake编译源码,linu