本篇內(nèi)容主要講解“數(shù)據(jù)庫(kù)怎么導(dǎo)入導(dǎo)出數(shù)據(jù)”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“數(shù)據(jù)庫(kù)怎么導(dǎo)入導(dǎo)出數(shù)據(jù)”吧!
語(yǔ)法:create or replace directory <路徑名稱(chēng)> as ‘備份路徑’
create or replace directory file_path as 'C:\軟件\數(shù)據(jù)庫(kù)文件'
--賦權(quán)限給smsdb用戶:
grant read,write on directory file_path to smsdb;
1.3:備份數(shù)據(jù)庫(kù)(在CMD中執(zhí)行)
語(yǔ)法:expdp用戶名/密碼@數(shù)據(jù)庫(kù)連接標(biāo)示符 directory=路徑名稱(chēng) dumpfile=備份的文件名稱(chēng) logfile=輸出的日志名稱(chēng) schemas=需要備份的數(shù)據(jù)庫(kù)用戶名
expdp smsdb/123456@oracle11 directory=file_path dumpfile=new.dmp logfile=new.log schemas=smsdb
問(wèn)題:
ORA-39151: Table "SMSDB"."T_PROVIDER_MOBILE" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
分析:
默認(rèn)值是skip,但若設(shè)置了CONTENT=DATA_ONLY,則默認(rèn)值是APPEND,不是SKIP。
TABLE_EXISTS_ACTION=[SKIP | APPEND | TRUNCATE | REPLACE]
SKIP:跳過(guò)這張表,繼續(xù)下一個(gè)對(duì)象。如果CONTENT設(shè)置了DATA_ONLY參數(shù),則不能使用SKIP。
APPEND:會(huì)加載數(shù)據(jù)至對(duì)象,但不會(huì)影響已存在的行。
TRUNCATE:刪除已存在的行,然后加載所有的數(shù)據(jù)。
REPLACE:drop已存在的表,然后create并加載數(shù)據(jù)。如果CONTENT設(shè)置了DATA_ONLY,則不能使用REPLACE
解決方法:
在imp后面加上 table_exists_action=truncate
--導(dǎo)出表
expdp smsdb/123456@oracle11 tables=t_smsgateway_mt_his directory=file_path dumpfile=2017.5.12.dmp
4.5數(shù)據(jù)庫(kù)導(dǎo)入
語(yǔ)法:Impdp 用戶名/密碼@數(shù)據(jù)庫(kù)連接標(biāo)示符 directory=路徑名稱(chēng) dumpfile=備份的文件名稱(chēng) logfile=輸出的日志名稱(chēng) schemas=需要備份的數(shù)據(jù)庫(kù)用戶名
創(chuàng)建路徑:(刪除路徑:DROP DIRECTORY directory_NAME)
create directory file_path as 'C:\軟件\數(shù)據(jù)庫(kù)文件';
賦權(quán)限給smsdb用戶:
grant read,write on directory file_path to smsdb;
數(shù)據(jù)導(dǎo)入(cmd命令下):
impdp smsdb/123456@oracle11 directory=file_path dumpfile=new.dmp logfile=new.log schemas=smsdb ignore=y
到此,相信大家對(duì)“數(shù)據(jù)庫(kù)怎么導(dǎo)入導(dǎo)出數(shù)據(jù)”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
分享題目:數(shù)據(jù)庫(kù)怎么導(dǎo)入導(dǎo)出數(shù)據(jù)-創(chuàng)新互聯(lián)
網(wǎng)站網(wǎng)址:http://jinyejixie.com/article36/hipsg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、網(wǎng)站內(nèi)鏈、自適應(yīng)網(wǎng)站、Google、用戶體驗(yàn)、企業(yè)網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容