Oracle資料泵遠程匯入檔案到本機資料庫

來源:互聯網
上載者:User

標籤:style   使用   io   ar   檔案   資料   cti   log   sp   

--以dba身份登入
C:\Users\Administrator>sqlplus / as sysdba
--建立使用者
SQL> create user bfzg0828 identified by bfzg0828 default tablespace users quota
unlimited on users;
--授予串連角色,資源角色給使用者
SQL> grant connect,resource to bfzg0828;


授權成功。
--授權建立資料連結
SQL> grant create table,create database link to bfzg0828;



授權成功。
--建立目錄


SQL> create or replace directory oracle_exp as ‘D:\oracle‘;


目錄已建立。


--在物理機上d盤建立檔案oracle


......


--給使用者授予目錄讀寫權限


SQL> grant read,write on directory oracle_exp to bfzg0828;

grant read,write on directory oracle_exp to bfzg;






授權成功。


--以bfzg0828使用者登陸


SQL> conn bfzg0828/bfzg0828
已串連。


--建立網路資料庫連結


SQL> create database link test113 connect to btv10_bz identified by btv10_bz using ‘192.168.0.66:1521/bttest‘;




資料庫連結已建立。


--查詢建立的網路連結


SQL> select * from [email protected];


GLOBAL_NAME
-----------------------------------------------


BTTEST


SQL>




--使用expdp匯出遠端資料庫到本地目錄d:\oracle\bfzg0828.dmp
C:\Users\Administrator>expdp bfzg0828/[email protected] directory=DIR_EXP dumpfile=bfzg0828.dmp  logfile=bfzg0828.log  network_link=test113


--匯出成功後,使用impdp匯入到本地庫


--這裡是建立的使用者bfzg使用者,擁有connect,resouce角色許可權,table_exists_action=replace表示,如果表存在則替換,imp沒有功能
impdp bfzg/bfzg directory=oracle_exp dumpfile=BFZG0828.DMP remap_schema=btv10_bz:bfzg   exclude=statistics table_exists_action=replace


注btv10_bz為匯出使用者,bfzg為本次匯入使用者
BFZG0828.DMP匯出使用者是btv10_bz(btv10_bz/[email protected]:1521/bttest)


--匯入單個表
impdp bfzg/bfzg directory=oracle_exp dumpfile=BFZG0828.DMP  tables=btv10_bz.bt_corp remap_schema=btv10_bz:bfzg  exclude=statistics  table_exists_action=replace

Oracle資料泵遠程匯入檔案到本機資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.