投入多少,收获多少;投入多深,领悟多深。太阳底下没有新鲜事,排列组合就是创新。每天多做一点点,就是进步的开始,每天进步一点点,就是成功的开始,每天创新一点点,就是领先的开始。

impdp 将数据导入数据库中不存的用户里

上一篇 / 下一篇  2008-06-26 17:00:05 / 个人分类:ORACLE

没有开场白,直接看测试吧


SQL>  create or replace directory dir1 as '/backup/test/';

Directory created.


SQL> grant read,write on directory dir1 to yxyup;

Grant succeeded.

SQL> conn yxyup
Enter password:
Connected.
SQL> create table t1 as select * from dba_objects;

Table created.

oracle@hpdata3:/backup/test#expdp system/system dumpfile=yxyup.dump directory=dir1 schemas=yxyup logfile=yxyup.log

Export: Release 10.2.0.3.0 - 64bit Production on Thursday, 26 June, 2008 16:53:55

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** dumpfile=yxyup.dump directory=dir1 schemas=yxyup logfile=yxyup.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 6 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . exported "YXYUP"."T1"                                4.718 MB   50531 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /backup/test/yxyup.dump
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 16:54:16


SQL> drop table t1 purge;
 Dropped.

oracle@hpdata3:/backup/test#impdp system/system dumpfile=yxyup.dump directory=dir1schemas=yxyuplogfile=yxyup.log.imp

Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 26 June, 2008 16:56:49

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/******** dumpfile=yxyup.dump directory=dir1 schemas=yxyup logfile=yxyup.log.imp
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"YXYUP" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
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 "YXYUP"."T1"                                4.718 MB   50531 rows
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" completed with 1 error(s) at 16:56:59

oracle@hpdata3:/backup/test#impdp system/system dumpfile=yxyup.dump directory=dir1schemas=aaalogfile=yxyup.log.imp

Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 26 June, 2008 16:58:05

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39002: invalid operation
ORA-39165: Schema AAA was not found.

数据库已经存在的用户,在impdp时说ORA-31684: Object type USER:"YXYUP" already exists(当然可以导入成功)

数据库中不存的用户,在impdp 说ORA-39165: Schema AAA was not found.(这里自然成功不了)

如果想导入到其他用户中可以用remap_schema来做,(像import时的fromuser,touser)

oracle@hpdata3:/backup/test#impdp system/system dumpfile=yxyup.dump directory=dir1 remap_schema=yxyup:aaa logfile=yxyup.log.imp

Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 26 June, 2008 17:17:01

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** dumpfile=yxyup.dump directory=dir1 remap_schema=yxyup:aaa logfile=yxyup.log.imp
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
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 "AAA"."T1"                                  4.718 MB   50531 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 17:17:10

oracle@hpdata3:/backup/test#impdp system/system dumpfile=yxyup.dump directory=dir1 remap_schema=yxyup:bbb logfile=yxyup.log.imp

Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 26 June, 2008 17:22:52

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** dumpfile=yxyup.dump directory=dir1 remap_schema=yxyup:bbb logfile=yxyup.log.imp
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
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 "BBB"."T1"                                  4.718 MB   50531 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 17:23:01

 

 


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-13  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 6783
  • 日志数: 164
  • 建立时间: 2007-12-06
  • 更新时间: 2008-10-10

RSS订阅

Open Toolbar