test用户下有tb1表
SQL> select * from tb1;
ID NAME
---------- ----------
1 A
2 B
3 C
10 D
1)导出所有数据
C:\>exp test/test file=e:\a.dmp tables=tb1
Export: Release 10.2.0.1.0 - Production on 星期一 6月 23 14:55:30 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的表通过常规路径...
. . 正在导出表 TB1导出了 4 行
成功终止导出, 没有出现警告。
2)导出id<3的数据
C:\>exp test/test file=e:\a.dmp tables=tb1 query="""where id<3"""
Export: Release 10.2.0.1.0 - Production on 星期一 6月 23 14:59:38 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的表通过常规路径...
. . 正在导出表 TB1导出了 2 行
成功终止导出, 没有出现警告。
注意:在windows系统中,需要在where语句的两端使用三个双引号
linux中 query=\"where id\<3\"
3)使用parfile参数定义一个文件,可以不考虑操作系统平台
query.par
query="where id<3"
C:\>exp test/test file=e:\a.dmp tables=tb1 parfile=e:\query.par
Export: Release 10.2.0.1.0 - Production on 星期一 6月 23 15:04:26 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的表通过常规路径...
. . 正在导出表 TB1导出了 2 行
成功终止导出, 没有出现警告。