Export the database directly to the target database using Exp+pipe (data does not fall into DMP)

Source: Internet
Author: User
Tags reserved ssh

As early as the Oracle 8,oracle 8i,oracle 9i, there was no datapump, so the work of the logical database migration depended more on exp/imp,
However, when disk space is limited and downtime is short, we usually need a way to do it without landing.

At that time, our usual way is to use the pipeline, that is, exp to export the database to the pipe, the target segment through the pipeline directly to the data imp to the target database, so that the data does not fall, eliminating the generation of DMP files and Space, O (∩_∩) o haha ~

Of course, there are many similar applications, such as the use of pipelines directly to the EXP data store to tape, or directly exp data exported to a compressed format, followed by a test.

Here first Test, exp to pipe and imp from pipe:

[[email protected] exp-pipe]$ mknod/tmp/exp_pipe p[[email protected] exp-pipe]$[[email protected] exp-pipe]$ ifconfigeth0 Link encap:ethernet HWaddr 08:00:27:43:8d:35inet addr:192.168.56.66 bcast:192.168.56.255 Mask : 255.255.255.0inet6 ADDR:FE80::A00:27FF:FE43:8D35/64 scope:linkup broadcast RUNNING multicast MTU:1500 Metric:1RX packets:5971 errors:0 dropped:0 overruns:0 frame:0tx packets:4147 errors:0 dropped:0 overruns:0 carrier:0collisions:0 Txqueuelen:1000rx bytes:555804 (542.7 KiB) TX bytes:550356 (537.4 KiB) [[email protected] imp_pipe]$ Mknod/tmp/imp_ Pipe p[[email protected] imp_pipe]$[[email protected] imp_pipe]$ ifconfigeth0 Link encap:ethernet HWaddr 08:00:27:f1:72:d0inet addr:192.168.56.101 bcast:192.168.56.255 Mask:255.255.255.0inet6 addr:fe80::a00:27ff:fef1 : 72D0/64 scope:linkup Broadcast RUNNING multicast mtu:1500 metric:1rx packets:5444 errors:0 dropped:0 overruns:0 Frame:0T X packets:4332 errors:0 dropped:0 overruns:0 carrier:0collisions:0 tXqueuelen:1000rx bytes:489891 (478.4 KiB) TX bytes:366032 (357.4 KiB) 

Configure two machines with SSH scripts with Oracle installation package Trust, super simple, not here to repeat

Then enter in the first window:

[[email protected] ~]$ DD If=/tmp/exp_pipe | SSH 192.168.56.101 dd of=/tmp/imp_pipe ....

This will stop at this interface, waiting for the input of the pipe
Then open a session and use EXP to speak the database input into the pipeline:

[[Email protected] ~]$ exp lunar/lunar file=/tmp/exp_pipe log=ff.log tables=ff export:release 11.2.0.3.0-production on Sun Oct 00:48:17 Copyright (c) 1982, and Oracle and/or its affiliates. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionwith The partitioning and Real A Pplication testing Optionsexport done in ZHS16GBK character set and al16utf16 NCHAR character Setserver uses Al32utf8 Char Acter Set (possible charset conversion) about to export specified tables via conventional Path ..... Exporting table FF .....

This interface waits for the target segment to be received .....
Then open a session in the target segment:

[Email protected] imp_pipe]$ imp lunar/lunar file=/tmp/imp_pipe log=ff.log tables=ff import:release 11.2.0.3.0-product Ion on Sun Oct 16:48:11 (c) 1982, Oracle and/or its affiliates. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionwith The partitioning and Real A Pplication Testing Options Export file created by export:v11.02.00 via conventional pathimport do in ZHS16GBK character Set and AL16UTF16 NCHAR character Setimport server uses Al32utf8 character set (possible charset conversion). Importing LUNAR ' s objects into LUNAR. Importing LUNAR ' s objects into LUNAR. . Importing table "FF" 141112 rows Importedimport terminated successfully without warnings. [Email protected] imp_pipe]$

You can then see that when the data transfer is complete, the other sessions are complete:

[[email protected] ~]$ dd if=/tmp/exp_pipe |  SSH 192.168.56.101 DD of=/tmp/imp_pipe29856+0 records in29856+0 records out15286272 bytes (MB) copied, 61.7143 seconds, 248 kb/s29856+0 Records in29856+0 records out15286272 bytes (MB) copied, 3.78268 seconds, 4.0 Mb/s[[email protect Ed] ~]$ [[email protected] ~]$ exp lunar/lunar file=/tmp/exp_pipe log=ff.log tables=ff export:release 11.2.0.3.0-production on Sun Oct 00:48:17 2013 copyright (c) 1982, +, Oracle and/or its affiliates. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionwith The partitioning and Real A Pplication testing Optionsexport done in ZHS16GBK character set and al16utf16 NCHAR character Setserver uses Al32utf8 Char Acter Set (possible charset conversion)  about to export specified tables via conventional Path ..... Exporting table FF 141112 rows Exportedexport terminated successfully without warnings. [[Email protEcted] ~]$ 

Now look at the target segment to see if the table has been imported:

[[Email protected] imp_pipe]$ SS Sql*plus:release 11.2.0.3.0 Production on Sun Oct 16:51:13 Copyright (c) 1982, 2 011, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionwith The partitioning and Real Ap Plication testing options [email protected]>conn lunar/lunarconnected. [Email protected]>select count (*) from FF; COUNT (*)----------141112 [email protected]>

O (∩_∩) o haha ~, done!

Ext.: http://www.lunar2013.com/2013/10/%e4%bd%bf%e7%94%a8exppipe%e7%9a%84%e6%96%b9%e5%bc%8f%e7%9b%b4%e6%8e%a5%e5% B0%86%e6%95%b0%e6%8d%ae%e5%ba%93%e5%af%bc%e5%87%ba%e5%88%b0%e7%9b%ae%e6%a0%87%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc %88%e6%95%b0.html

Export the database directly to the target database using Exp+pipe (data does not fall into DMP)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.