[20190520]exp imp on th fly.txt
[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已經支援資料壓縮(早期僅僅支援後設資料),沒有必要這樣做,意義不大。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2644894/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle exp和impOracle
- 【exp/imp不同版本】Oracle不同版本的exp/imp使用注意事項Oracle
- exp和imp詳解
- exp匯出遭遇IMP-00020
- exp&imp的使用方法
- 使用imp/exp遇到兩個問題
- 不同版本exp/imp使用注意事項
- oracle資料匯出匯入(exp/imp)Oracle
- EXP、IMP、SQLLOADER、EXPDP、IMPDP、DBMS_METADATA、SQLPLUS等方面SQL
- 用exp、imp遷移包含物化檢視日誌的資料
- Oracle資料庫匯入匯出。imp匯入命令和exp匯出命令Oracle資料庫
- 正規表示式之(exp),(?:exp),(?=exp) 理解
- Oracle OCP(54):IMPOracle
- 7.84 EXP
- exp匯出報錯EXP-00106問題處理
- IMP-00009: abnormal end of export fileORMExport
- 能select的表,可以exp嗎?有exp_full_database就能exp其他使用者的表嗎?Database
- Oracle OCP(54):EXPOracle
- EXP增量備份
- JavaScript Math.exp()JavaScript
- Oracle-exp命令Oracle
- D - K-th NearestREST
- imp-匯入小寫字母的表
- abc369D Bonus EXP
- abc369 D - Bonus EXP
- HTB_pwn_pet_companion_exp
- exp: docker配置國內映象Docker
- RealWorld CTF 5th ShellFind 分析
- HTB_pwn_rocket_blaster_xxx_expAST
- 再探URLDNS鏈(手搓exp)DNS
- EXP時遭遇ORA-00600 [729]
- 再探Stagefright漏洞——POC與EXP
- 9780078022159 Database System Concepts, 7th EditionDatabase
- TH-OCR文字識別技術
- 刷題系列 - K-th 語法
- The 11th Zhejiang Provincial Collegiate Programming Contest
- Fundamentals of Computer Graphics 4th目錄
- CSS: The Definitive Guide 4th 筆記CSSGUIIDE筆記