oracle版本:10204
如果導出的dmp過大,磁盤空間也比較緊張的話,exp可以邊導出邊壓縮,做一個測試:
SQL> create table t as select * from all_objects;
Table created.
SQL> select count(*) from t;
COUNT(*)
----------
53677
[oracle@qht115 ~]$ exp l5m/l5m file=>(gzip>t.dmp.gz) tables=t
Export: Release 10.2.0.4.0 - Production on Thu Mar 26 10:17:34 2020
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table T 53677 rows exported
Export terminated successfully without warnings.
[oracle@qht115 ~]$ file t.dmp.gz
t.dmp.gz: gzip compressed data, from Unix, last modified: Thu Mar 26 10:17:34 2020
imp也可以邊解壓縮邊導入
SQL> drop table t;
Table dropped.
[oracle@qht115 ~]$ imp l5m/l5m file=<(gunzip<t.dmp.gz) fromuser=l5m touser=l5m
Import: Release 10.2.0.4.0 - Production on Thu Mar 26 10:20:59 2020
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V10.02.01 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. importing L5M's objects into L5M
. . importing table "T" 53677 rows imported
Import terminated successfully without warnings.
驗證一下:
SQL> select count(*) from t;
COUNT(*)
----------
53677