我按照用户用exp导出了一个dmp文件,发现里面有几张表的数据量太大,不想在本机数据库导入时导入这些表的数据。有没有办法用一个命令导入除了这些表之外的其他表数据的?
我的意思是不要一个一个其他表罗列出来进行导入。

解决方案 »

  1.   

    好像IMP是不能导入除了某些表之外的数据,没有这个参数。
      

  2.   

    IMP只能这样了:imp 'CONNECT STRING' fromuser=? touser=? tables=(t1,t2,t3....好多个)
      

  3.   

    不能,这是exp,imp极其不爽的一个缺陷!
    如果10g以上,可以使用expdp,impdp具有这种功能,使用参数exclude
      

  4.   

    写一个par file,把所有你想导出的表列出来。
    这个 可以通过 
    spool table.txt
    select table_name from user_tables:
    spool off;
    保存到table.txt中,再用utral edit 编辑下。最后做一个exp 脚本
    exp parfile=export_options.par ||||||||||||||
    Export Parameter FilesParameter files are a convenient way to consolidate all the options from a file that will be used when executing the utility. The benefit of the parameter file is that it allows the options to be specified once and reused by all utility jobs. Three of the utilities discussed in this chapter (export, import, SQL*Loader) support parameter files. Below is an example of an export parameter file: export_options.par. compress=n
    direct=n
    buffer=1000
    tables=table_with_one_million_rows
    userid=scott/tigerUsing this parameter file, the export command line is executed by the following: exp parfile=export_options.par Specifying options in a file makes it much easier to implement the options with any utility that accepts a parameter file. In addition, these options are not revealed on the command line, and therefore not exposed to commands ( UNIX ps command ) that would reveal the username and password had they been specified on the command line.||||||||||||
      

  5.   

    请问csucxcc ,table.txt里面的表明需要是什么格式的?
    用utral edit在每个表明前面加‘,’吗?
    还有在export_options.par 里面怎么用引用table.txt文件呢?
      

  6.   

    我已经写出了par file但只是把用table.txt处理过的表粘贴到了par文件里。par里能否引用table.txt文件呢?
      

  7.   

      在par文件里加上:
      listfile=table.txt    --试试
      

  8.   

    parfile内容:
    userid = kingstar/kingstar@headdb_bakstatistics=none 
    rows=Y 
    compress=N 
    buffer=4096 
    feedback=100000
    listfile = table.txt
    tables = listfilefile=(D:\EXP_DUMP_20100417\exp_dat_olap_20100421_1.dmp, D:\EXP_DUMP_20100417\exp_dat_olap_20100421_2.dmp, D:\EXP_DUMP_20100417\exp_dat_olap_20100421_3.dmp)
    filesize=5G 
    log=D:\EXP_DUMP_20100417\exp_dat_olap_20100421.log  table.txt内容:
    olap.TB_DIM_TIME,
    olap.TB_DIM_OFTA_CONTACT_INFO,
    olap.TB_DIM_OFCODE_TYPE,
    olap.TB_DIM_OFCODE_LEVEL,
    olap.TB_DIM_DIY_CLASSTYPE,
    olap.TB_DIM_CLIENT_INFO,
    olap.TB_INNER_TIME(等等等很多)在cmd窗口执行后的结果是:
    C:\Documents and Settings\Administrator>exp parfile=D:\EXP_DUMP_20100417\test.par
    LRM-00101: 未知的参数名 'listfile'
    LRM-00113: 处理文件 'D:\EXP_DUMP_20100417\test.par' 时出错EXP-00019: 处理参数失败, 请键入 'EXP HELP=Y' 获取帮助信息
    EXP-00000: 导出终止失败
      

  9.   

    如果用plsql developer导出的话就可以,不要选那几个表就行了。
      

  10.   

    兄弟,1000多张表里面有300表不想导,也用plsql developer来导出吗?
    首先得考虑效率问题。所以问的是用命令方式导出。
      

  11.   

    --  参考.par如下
    USERID=giapuser/oracle
    buffer=40960000
    file=exp_giapuser_data.dmp
    LOG=exp_giapuser_data.log
    COMPRESS=N
    ROWS=Y
    recordlength=65535
    DIRECT=Y
    FEEDBACK=10000
    tables=(
    AJ_AJYS
    AJ_BDQ
    AJ_BDQ_ZLSH
    AJ_BLXX
    AJ_BSQHB
    AJ_CLCS
    AJ_DW_CLCS
    AJ_FLOWCHART
    AJ_FLWS
    AJ_FLWSSM
    AJ_FXXYRXX
    ....
    ....
    ....
    )
      

  12.   

    恩,我就是按照你现在给的这个方法写的。我上面问的是有没有把法不把tables=(
    AJ_AJYS
    AJ_BDQ
    AJ_BDQ_ZLSH
    AJ_BLXX
    AJ_BSQHB
    AJ_CLCS
    AJ_DW_CLCS
    AJ_FLOWCHART
    AJ_FLWS
    AJ_FLWSSM
    AJ_FXXYRXX
    ....
    ....
    ....
    )贴进来,而是直接饮用建的tables.txt。刚才ty_tarena_pger回复我用listfile=table.txt
    但报listfile不存在。
    是不是没法实现啊?
    谢谢了。
      

  13.   

    不用Listfile 也可以实现。完全按照脚本来嘛。tables=(
    AJ_AJYS
    AJ_BDQ
    AJ_BDQ_ZLSH
    AJ_BLXX
    AJ_BSQHB
    AJ_CLCS
    AJ_DW_CLCS
    AJ_FLOWCHART
    AJ_FLWS
    AJ_FLWSSM
    AJ_FXXYRXX
    ....
    ....
    ....
    )
    这里把所有的table都列进来,
    可以直接用utraledit 编辑实现的。
      

  14.   

    我就是使用的这种方法。只是listfile想在了解一下。不过这个命令不管用。此问题就讨论到此了。谢谢您以及其他各位TX的帮助