Oracle导出where条件内容

来源:互联网 发布:windows oracle主备 编辑:程序博客网 时间:2024/05/19 18:37


日常工作中经常会出现将一个过滤结果集导出到另一个库,需要导出命中添加where条件,由于不同平台中需要用不同的转移字符,较为繁琐,而是用参数文件就能很好的解决该问题。

===========================================================

目的一:导出导出表ljg ,条件为object_id<10;

?目的二:使用参数文件,解决不同平台写法不一样的繁琐问题

 

 

限制条件:每次只能导出一个表的结果集

 

 

实例如下:

   

C:\Documents andSettings\Administrator>sqlplus"system/sys"

 

SQL*Plus: Release 10.2.0.1.0 -Production on 星期二 12 11 16:08:242012

 

Copyright (c) 1982, 2005,Oracle.  All rights reserved.

 

 

连接到:

Oracle Database 10g EnterpriseEdition Release 10.2.0.1.0 - Production

With the Partitioning, OLAPand Data Mining options

 

SQL> createtable ljg as select object_name,object_id fromdba_objects;

 

表已创建。

 

SQL> selectcount(*) from ljg;

 

 COUNT(*)

----------

    50318

 

SQL>exit

 OracleDatabase 10g Enterprise Edition Release 10.2.0.1.0 -Production

With the Partitioning, OLAPand Data Mining options 断开

 

 

 

C:\Documents andSettings\Administrator>expparfile=d:\parfile.txt

 

Export: Release 10.2.0.1.0 -Production on 星期二 12 11 16:09:592012

 

Copyright (c) 1982, 2005,Oracle.  All rights reserved.

 

 

连接到: Oracle Database 10gEnterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAPand Data Mining options

已导出 ZHS16GBK 字符集和 AL16UTF16NCHAR 字符集

 

即将导出指定的表通过常规路径...

当前的用户已更改为 SYS

.. 正在导出表                            LJG导出了          

成功终止导出没有出现警告。

 

C:\Documents andSettings\Administrator>

 

C:\Documents andSettings\Administrator>

 

其中d:\parfile.txt内容为

 

 

userid=system/sysfile=d:\ljg.dmp tables=sys.ljg  query="whereobject_id<10"

0 0
原创粉丝点击