想导出数据库实例,但表的记录太大,不想全部导出,能否在导出实例的时候,
指定导出的数据表的行数不能大于一个具体值?比如实例中有些表的记录数上
千万,我只想导出1000条就行了。这个规则适用于其他所有用户表。难吗?

解决方案 »

  1.   

    exp username/passwd file=xxx.dmp tables='....' query=\'where rownum\<数字\'
    unix系统单引号和小于号前要加'\'
      

  2.   

    上楼:
    这样只能指定一个表啊,如果数据库有1000张表那岂不是要exp...1000回?
      

  3.   

    D:\Documents and Settings\liusn> exp  demo/demo@hasl tables = (test_1, a, b ) fi
    le = c:\demo.dmp log = c:\demo.log query = """where rownum <=10 """Export: Release 9.2.0.1.0 - Production on 星期三 7月 5 14:49:13 2006Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集即将导出指定的表通过常规路径 ...
    . . 正在导出表                          TEST_1         10 行被导出
    . . 正在导出表                               A          9 行被导出
    EXP-00091: 正在导出可疑的统计信息。
    EXP-00091: 正在导出可疑的统计信息。
    . . 正在导出表                               B          9 行被导出
    导出成功终止,但出现警告。注意query 模式下导出的话:
    1.The parameter QUERY cannot be specified for full, user, or tablespace mode exports.
    参数query不能使用在完全导出,用户导出和表空间导出方式
    2.The parameter QUERY must be applicable to all specified tables.
    参数query指定的内容必须对所有指定的表都有效
    3.The parameter QUERY cannot be specified in a direct path export (DIRECT=y)
    参数query不能与direct路径导出同时使用
    4.The parameter QUERY cannot be specified for tables with inner nested tables.
    参数query不能导出内嵌表
    5.You cannot determine from the contents of the export file whether the data is the result of a QUERY export.
    用query参数导出的数据与同其他方式导出的数据是一样的,无法根据导出文件进行分辨
      

  4.   

    windows 系统下 query 的条件需要加上3对双引号
    unix 系统下 query 的条件需要通过 \ 来转义
      

  5.   

    exp user/password@别名 tables=dba01 query='"where rq between to_date(''2003-06-01'',''yyyy-mm-dd'') and to_date(''2003-08-01'',''yyyy-mm-dd'')"' file=c:\dd.dmp