[20190520]exp imp on th fly.txt
–//以前做的测试,查找浪费许多时间,做1个记录。
–//注:仅仅linux 操作系统,bash shell版本不能太低就可以实现,现在安装的linux bash shell应该都没有问题。
1.环境:
scott@book> @ ver1
port_string version banner
—————————— ————– ——————————————————————————–
x86_64/linux 2.4.xx 11.2.0.4.0 oracle database 11g enterprise edition release 11.2.0.4.0 – 64bit production
2.测试exp:
exp on the fly, run:
create table t as select * from all_objects;
$ exp scott/book file=>(gzip>t.dmp.gz) tables=t buffer=8388608
export: release 11.2.0.4.0 – production on mon may 20 08:58:15 2019
copyright (c) 1982, 2011, oracle and/or its affiliates. all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.4.0 – 64bit production
with the partitioning, olap, data mining and real application testing options
export done in zhs16gbk character set and al16utf16 nchar character set
about to export specified tables via conventional path …
. . exporting table t 83245 rows exported
export terminated successfully without warnings.
$ file t.dmp.gz
t.dmp.gz: gzip compressed data, from unix, last modified: mon may 20 08:58:15 2019
scott@book> rename t to ty;
table renamed.
3.测试imp:
imp on the fly, run:
$ imp scott/book full=y file=<(gunzip <t.dmp.gz) buffer=8388608
import: release 11.2.0.4.0 – production on mon may 20 09:00:42 2019
copyright (c) 1982, 2011, oracle and/or its affiliates. all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.4.0 – 64bit production
with the partitioning, olap, data mining and real application testing options
export file created by export:v11.02.00 via conventional path
import done in zhs16gbk character set and al16utf16 nchar character set
. importing scott’s objects into scott
. importing scott’s objects into scott
. . importing table “t” 83245 rows imported
import terminated successfully without warnings.
imp scott/book full=y file=<(gunzip <t.dmp.gz) buffer=8388608
scott@book> select count(*) from t union all select count(*) from ty;
count(*)
———-
83245
83245
4.也可以通过管道实现所谓的不落地方式,只要建立将p.dmp.gz建立为管道文件:
$ mkfifo p.dmp.gz
$ ls -l p.dmp.gz
prw-r–r– 1 oracle oinstall 0 2019-05-20 09:04:27 p.dmp.gz
–//再执行如下:
$ cat ad.sh
#! /bin.bash
exp scott/book file=>(gzip>p.dmp.gz) tables=t buffer=8388608 &
sleep 5
imp scott/btbtms@192.168.100.33:1521/test full=y file=<(gunzip <p.dmp.gz) buffer=8388608 &
wait
scott@test> select count(*) from t ;
count(*)
———-
83245
–//注expdp,impdp不支持这样方式,实际上expdp,impdp已经支持数据压缩(早期仅仅支持元数据),没有必要这样做,意义不大。
需要了解更多数据库技术:exp imp on th fly.txt,都可以关注数据库技术分享栏目—计算机技术网(www.ctvol.com)!
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/dtteaching/798058.html