zoukankan      html  css  js  c++  java
  • 用户之间imp的问题

    版权声明:本文为博主原创文章。未经博主同意不得转载。 https://blog.csdn.net/bisal/article/details/24785001
    今天同事说申请了一个从生产导出的dump文件,须要导入測试库进行測试。
    之前做的基本都是本库导出,本库导入的操作,比如:imp test/***@test tables=tbl_fuel file=H:devdatatbl_fuel.dmp ignore=y这种指令操作。
    今天的情况是从一个库的用户导出dump。然后导入到另外一个库的用户中。

    导出:
    exp p_x/**  FILE=tables.dmp TABLES=e.pre_ldp,e.tbl_flight log=tables.log rows=y

    几种错误的导入:
    imp test/***@test tables=(tbl_a,tbl_b) file=tables.dmp log=test.log full=y
    提示:
    IMP-00024: Only one mode (TABLES, FROMUSER, or FULL) can be specified
    TABLES、FROMUSER和FULL參数仅仅能使用一个

    imp test/***@test file=tables.dmp log=test.log ignore=n
    提示:
    Warning: the objects were exported by P_X, not by you
    import done in ZHS16CGB231280 character set and AL16UTF16 NCHAR character set
    import server uses ZHS16GBK character set (possible charset conversion)
    export client uses ZHS16GBK character set (possible charset conversion)
    export server uses UTF8 NCHAR character set (possible ncharset conversion)
    IMP-00031: Must specify FULL=Y or provide FROMUSER/TOUSER or TABLES arguments
    IMP-00000: Import terminated unsuccessfully
    FULL=Y、FROMUSER/TOUSER和TABLES參数必须指定当中之中的一个


    imp test/***@test file=tables.dmp log=test.log ignore=n fromuser=user ouser=test
    提示:
    Warning: the objects were exported by P_X, not by you
    import done in ZHS16CGB231280 character set and AL16UTF16 NCHAR character set
    import server uses ZHS16GBK character set (possible charset conversion)
    export client uses ZHS16GBK character set (possible charset conversion)
    export server uses UTF8 NCHAR character set (possible ncharset conversion)
    IMP-00034: Warning: FromUser "USER" not found in export file
    Import terminated successfully with warnings.
    说明From User "USER"不包括在dump文件里。

    但通过这种方式能够找到是哪个用户使用exp导出的这份dump文件。


    imp test/***@test file=tables.dmp log=test.log ignore=n tables=tbl_a
    提示:
    Warning: the objects were exported by P_X, not by you
    import done in ZHS16CGB231280 character set and AL16UTF16 NCHAR character set
    import server uses ZHS16GBK character set (possible charset conversion)
    export client uses ZHS16GBK character set (possible charset conversion)
    export server uses UTF8 NCHAR character set (possible ncharset conversion)
    . importing P_X's objects into TEST
    IMP-00033: Warning: Table "TBL_A" not found in export file
    说明TBL_A表并不在导出的dump中。个人觉得。由于这里未使用FROMUSER这些參数。默认就是dump中包括的数据是从本地test用户的。因此这会报错



    imp test/***@test file=tables.dmp log=test.log ignore=n fromuser=e touser=test(未建立表结构)
    imp test/***@test file=tables.dmp log=test.log ignore=y fromuser=e touser=test(已建立表结构)
    这里表示删除了表后,ignore=n。dump的来源是e这个schema或用户,导入到这个測试test用户下


    当然,由于test用户没有导出库的一些角色。因此例如以下这些权限操作可能会失败,但不影响使用这些測试。

    IMP-00017: following statement failed with ORACLE error 1917:
     "GRANT UPDATE ON "TBL_A" TO "B_E""

    參数:
    fromuser详细指定那个用户下的对象须要导入,所以假设这里使用p_x。会报错,由于表不在p_x用户下。


    touser详细指定导入那个用户。该參数必须跟fromuser一起使用。
    show在屏幕显示文件内容,详细不会做导入操作。
    ignore忽略导入过程中创建对象的错误(确保数据能够导入),但不会忽略写入数据的错误(如导入的数据跟当前表里的数据有违反唯一性约束的错误)。
    commit该參数为Y时。导入的过程会提交数据行,若buffer设置得太小,则会过去频繁的提交数据,对性能有一定的影响。使用commit另一个优点,就是做測试数据导入时,假设有些错误未插入数据库,使用commit后会将符合的记录commit提交,不会导致整个导入操作回滚,由于毕竟是做測试,多一些少一些数据问题不是非常大。
    full导入整个文件。
    tables导入表名列表,多个表名,逗号分隔。
    rows该參数为Y的时候将导入数据,默认是导入数据。但出于某种原因能够将该參数设置成N即不导入数据行。
查看全文
  • 相关阅读:
    【Cocos2d-X游戏实战开发】捕鱼达人之游戏场景的创建(六)
    WPF-24:绘制正多边形
    长假引起的系统审批流的变更的思考
    Linux shell编程02 shell程序的执行 及文件权限
    poj2787 算24
    REVERSE关键字之REVERSE索引
    设计模式读书笔记-----备忘录模式
    乔布斯的基本原则 (斯卡利访谈录 )
    MediaInfo源代码分析 1:整体结构
    Python 入门教程 9 ---- A Day at the Supermarket
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10499988.html
  • Copyright © 2011-2022 走看看