ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 导出表的部分数据到dmp文件中

导出表的部分数据到dmp文件中

原创 Linux操作系统 作者:onlinedog 时间:2010-03-10 17:37:41 0 删除 编辑

例子:
exp userid=hbjb_kf_hd/test@s9 buffer=4096 log=e:\ic10.log file=e:\ic10.dmp query='where aab001=''13040100706''' tables=(ic10)

QUERY
Default: none
This parameter enables you to select a subset of rows from a set of tables when doing a table mode export. The value of the query parameter is a string that contains a WHERE clause for a SQL SELECT statement that will be applied to all tables (or table partitions) listed in the TABLE parameter.
For example, if user scott wants to export only those employees whose job title is SALESMAN and whose salary is less than 1600, he could do the following (this example is UNIX-based):
exp scott/tiger TABLES=emp QUERY=\"WHERE job=\'SALESMAN\' and sal \<1600\"

Note:
Because the value of the QUERY parameter contains blanks, most operating systems require that the entire strings WHERE job=\'SALESMAN\' and sal\<1600 be placed in double quotation marks or marked as a literal by some method. Operating system reserved characters also need to be preceded by an escape character. See your Oracle operating system-specific documentation for information about special and reserved characters on your system.

When executing this query, Export builds a SQL SELECT statement similar to the following:
SELECT * FROM emp WHERE job='SALESMAN' and sal <1600;
 
The values specified for the QUERY parameter are applied to all tables (or table partitions) listed in the TABLE parameter. For example, the following statement will unload rows in both emp and bonus that match the query:

exp scott/tiger TABLES=emp,bonus QUERY=\"WHERE job=\'SALESMAN\' and sal\<1600\"
 Again, the SQL statements that Export executes are similar to the following:
SELECT * FROM emp WHERE job='SALESMAN' and sal <1600;
SELECT * FROM bonus WHERE job='SALESMAN' and sal <1600;

If a table is missing the columns specified in the QUERY clause, an error message will be produced, and no rows will be exported for the offending table.
Restrictions When Using the QUERY Parameter
      The QUERY parameter cannot be specified for full, user, or tablespace-mode exports.
      The QUERY parameter must be applicable to all specified tables.
      The QUERY parameter cannot be specified in a direct path Export (DIRECT=y)
      The QUERY parameter cannot be specified for tables with inner nested tables.
      You cannot determine from the contents of the export file whether the data is the result of a QUERY export.

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

上一篇: 我的2010年
下一篇: sql model用法例子
请登录后发表评论 登录
全部评论

注册时间:2008-09-16

  • 博文量
    106
  • 访问量
    228385