目的:在不创建dumpfile前预估出需要的导出文件大小。 适用于export 实验步骤如下:
OS: Linux test20 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
ORACLE: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
1、 创建一个管道文件
[oracle@test20 oracle]$ mknod exp.pipe p
[oracle@test20 oracle]$ ll exp.pipe
prw-r--r-- 1 oracle oinstall 0 Mar 1 13:17 exp.pipe
2、dd命令往文件中写入
dd if=/oracle/exp.pipe of=/dev/null bs=1024 &
3、导出需要的对象,设置dumpfile为exp.pipe
[oracle@test20 oracle]$ exp yyf/yyf file=/oracle/exp.pipe tables=yyf
Export: Release 10.2.0.4.0 - Production on Fri Mar 1 13:21:12 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.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 YYF 807920 rows exported
Export terminated successfully without warnings.
85856+0 records in
85856+0 records out
87916544 bytes (88 MB) copied, 6.24984 seconds, 14.1 MB/s
[1]+ Done dd if=/oracle/exp.pipe of=/dev/null bs=1024
4、估算完后,查看exp.pipe文件大小
[oracle@test20 oracle]$ ll
prw-r--r-- 1 oracle oinstall 0 Mar 1 13:21 exp.pipe <<-------由此看出实际是没有写入数据。原因在于of=/dev/null
5、实际导出,并查看文件dumpfile大小。
[oracle@test20 oracle]$ exp yyf/yyf file=/oracle/yyf.dmp tables=yyf
About to export specified tables via Conventional Path ...
. . exporting table YYF 807920 rows exported
Export terminated successfully without warnings.
[oracle@test20 oracle]$ ll yyf.dmp
-rw-r--r-- 1 oracle oinstall 87916544 Mar 1 11:44 yyf.dmp
ps:现在的磁盘价格,根本用不着估算的这么准确。