ITPub博客

首页 > 数据库 > Oracle > exp中query参数使用

exp中query参数使用

原创 Oracle 作者:sky850623 时间:2014-06-23 21:19:00 0 删除 编辑

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 行
成功终止导出, 没有出现警告。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26937943/viewspace-1192137/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-05-30

  • 博文量
    154
  • 访问量
    515368