zoukankan      html  css  js  c++  java
  • 【练习】数据移动---导入(IMPDP)

    1.导入表并验证:

    04:54:48 SYS@ORA11GR2>grant connect,resource to jj identified by jj;
    
    Grant succeeded.
    
    04:55:43 SYS@ORA11GR2>conn jj/jj
    Connected.
    
    2.[oracle@host03 datadump]$ impdp system/oracle directory=dir_dp dumpfile=emp30.dmp remap_schema=scott:jj
    
    Import: Release 11.2.0.4.0 - Production on Wed Dec 14 04:56:54 2016
    
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** directory=dir_dp dumpfile=emp30.dmp remap_schema=scott:jj 
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    . . imported "JJ"."EMP"                                   8.25 KB       6 rows
    Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
    ORA-39083: Object type REF_CONSTRAINT failed to create with error:
    ORA-00942: table or view does not exist
    Failing sql is:
    ALTER TABLE "JJ"."EMP" ADD CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "JJ"."DEPT" ("DEPTNO") ENABLE
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 1 error(s) at Wed Dec 14 04:57:01 2016 elapsed 0 00:00:06
    
    3.验证:d.
    04:56:41 JJ@ORA11GR2>select tname from tab;
    
    TNAME
    ------------------------------
    EMP

    2.导入schema:

    ①删除用户
    04:59:18 SYS@ORA11GR2>drop user scott cascade;
    
    User dropped.
    ②创建用户
    05:00:32 SYS@ORA11GR2>create user scott identified by tiger;
    
    User created.
    
    05:00:45 SYS@ORA11GR2>grant connect,resource to scott;
    
    Grant succeeded.
    
    ③[oracle@host03 datadump]$ impdp system/oracle directory=dir_dp dumpfile=scott_all_tab.dmp
    
    Import: Release 11.2.0.4.0 - Production on Wed Dec 14 05:04:51 2016
    
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** directory=dir_dp dumpfile=scott_all_tab.dmp 
    Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    . . imported "SCOTT"."S1_BASE"                           5.914 KB       3 rows
    . . imported "SCOTT"."SALGRADE"                          5.859 KB       5 rows
    . . imported "SCOTT"."BONUS"                                 0 KB       0 rows
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at Wed Dec 14 05:04:55 2016 elapsed 0 00:00:03
    ④05:05:18 SCOTT@ORA11GR2>select tname from tab;
    
    TNAME
    ------------------------------
    BONUS
    S1_BASE
    SALGRADE
  • 相关阅读:
    英特尔®oneAPI简介及动手实验研讨会召集令
    发展壮大:帮助独立游戏开发商解决分销难题
    我们可以从英特尔® SPMD 程序编译器中学到什么?
    2019 Unreal Open Day —— 英特尔携手 UE 助力游戏开发生态建设
    Abp集成Quartz.net记录
    静态和实例初始化映射
    Queryable扩展点
    投影
    空类型映射
    列表和数组
  • 原文地址:https://www.cnblogs.com/tomatoes-/p/6187166.html
Copyright © 2011-2022 走看看