1:G:\Oracle\product\10.1.0\Client_1\NETWORK\ADMIN目錄下有個tnsname.ora文件,內(nèi)容如下:
CMSTAR =
? (DESCRIPTION =
??? (ADDRESS_LIST =
????? (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.13.200)(PORT = 1521))
??? )
??? (CONNECT_DATA =
????? (SERVICE_NAME = cmstar)
??? )
? )
其中:CMSTAR為數(shù)據(jù)庫名,HOST為IP地址,所以可以仿效上面的例子手動添加數(shù)據(jù)錄連接。
2:用cmd進入命令行
輸入:tnsping cmstar
就是測試172.18.13.200是否連接成功
3:導(dǎo)入與導(dǎo)出,如下:
數(shù)據(jù)導(dǎo)出:
?1 將數(shù)據(jù)庫TEST完全導(dǎo)出,用戶名system 密碼manager 導(dǎo)出到D:\daochu.dmp中
?? exp
system/manager@TEST
file=d:\daochu.dmp full=y
?2 將數(shù)據(jù)庫中system用戶與sys用戶的表導(dǎo)出
?? exp
system/manager@TEST
file=d:\daochu.dmp owner=(system,sys)
?3 將數(shù)據(jù)庫中的表table1 、table2導(dǎo)出
?? exp
system/manager@TEST
file=d:\daochu.dmp tables=(table1,table2)
?4 將數(shù)據(jù)庫中的表table1中的字段filed1以"00"打頭的數(shù)據(jù)導(dǎo)出
?? exp
system/manager@TEST
file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"
?
???? 上面是常用的導(dǎo)出,對于壓縮我不太在意,用winzip把dmp文件可以很好的壓縮。
??不過在上面命令后面 加上 compress=y? 就可以了
數(shù)據(jù)的導(dǎo)入
?1 將D:\daochu.dmp 中的數(shù)據(jù)導(dǎo)入 TEST數(shù)據(jù)庫中。
?? imp
system/manager@TEST
? file=d:\daochu.dmp
?? 上面可能有點問題,因為有的表已經(jīng)存在,然后它就報錯,對該表就不進行導(dǎo)入。
?? 在后面加上 ignore=y 就可以了。
?2 將d:\daochu.dmp中的表table1 導(dǎo)入
?imp
system/manager@TEST
? file=d:\daochu.dmp? tables=(table1)
?
?基本上上面的導(dǎo)入導(dǎo)出夠用了。不少情況我是將表徹底刪除,然后導(dǎo)入。
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
