使用imp/impdb和管道實現資料庫的快速遷移

來源:互聯網
上載者:User

A、使用impdp和network_link

1,在目標資料庫建立 db link
create public database link hrtestdb  connect to system identified by 1234 using 'hrtestdb';

impdp system/1234 network_link=hrtestdb schemas=BMCCZHPUSR;

2,在目標庫建立相關資料表空間,防止匯入報錯

3,impdp匯入

不同使用者之間的匯入使用remap_schema參數
impdp wj/wj#201209  network_link=hrtestdb schemas=BMCCZHPUSR remap_schema=BMCCZHPUSR:wj

B、使用imp和管道技術
如果涉及9i及以下版本,沒有expdp命令,只有export命令,就需要手工建立管道來實現

具體過程如下
1,建立管道

mknod /tmp/exp.pipe p

2,exp匯出資料,此時命令會停止,等待imp命令
exp system/1234  file=/tmp/exp.pipe tables=BMCCZHPUSR.RESUME_STUDY

3,本機上運行imp命令,匯入資料到目標資料庫
imp wj/wj@epmdb file=/tmp/exp.pipe   BUFFER=159715200 IGNORE=Y   COMMIT=Y FROMUSER=BMCCZHPUSR touser=wj;

4,刪除管道檔案
rm –rf /tmp/exp.pipe

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.