好几天没有写了,懒惰的真是难以克服。
主要是最近被那个linux 双机问题弄得人很难受,真可以说是寝食难安啊,试了很多办法,还是没有完全解决。终于从蚂蚁处得到一些思路,希望最近能过测试,不然这个元旦就不好过了!
话回正路,今天需要记录的是:exp/imp时fromuser到底是指的啥?
以前也没有深究这个问题,开始一直认为是exp出来的那个schema名称,不知中途遇到什么问题,竟然改变了我的看法,竟然以为这个fromuser是exp时所使用的schema名称,所以今天决定再来看看,终于明白这个fromuser就是数据的owner。也就是你导出数据的owner。touser也就不用说了。
[oracle@dp-test ~]$ exp system/oracle file=hhris.dmp owner=hhris direct=y log=exp.log
Export: Release 10.2.0.4.0 - Production on Tue Dec 2 18:20:10 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified users ... . exporting pre-schema procedural objects and actions . exporting foreign function library names for user HHRIS . exporting PUBLIC type synonyms . exporting private type synonyms . exporting object type definitions for user HHRIS About to export HHRIS's objects ... . exporting database links . exporting sequence numbers . exporting cluster definitions . about to export HHRIS's tables via Direct Path ... . . exporting table ADDTOHIS 0 rows exported . . exporting table APPOINT 13 rows exported . . exporting table CTRL_IMAGE_RECYCLED 0 rows exported . . exporting table CT_CLASS 0 rows exported . . exporting table CT_ORGAN 0 rows exported . . exporting table CT_ORGANMODE 0 rows exported . . exporting table DICT_CAPTION 171 rows exported . . exporting table DICT_CITY 2736 rows exported . . exporting table DICT_CLASS 10 rows exported . . exporting table DICT_CLASSRULE 9 rows exported . . exporting table DICT_CLASS_LOCK 1 rows exported . . exporting table DICT_CLASS_REF 6 rows exported . . exporting table DICT_CLASS_SET 23 rows exported . . exporting table DICT_CODE 112 rows exported . . exporting table DICT_COMMTEMPLATE 0 rows exported . . exporting table DICT_CUSTOM_DIAGTEMPLATE 0 rows exported . . exporting table DICT_CUSTOM_DIAGTEMPLATETREE 0 rows exported . . exporting table DICT_DIAGTEMPLATE 741 rows exported . . exporting table DICT_DISEASE 750 rows exported . . exporting table DICT_DOCTOR 610 rows exported . . exporting table DICT_ERRORFILMREASON 13 rows exported . . exporting table DICT_ERRORFILMTYPE 6 rows exported
......
|
然后尝试两种方式导入之:
1、非正常导入
[oracle@dp-test ~]$ imp system/oracle file=hhris.dmp fromuser=system touser=cbo tables=EXAM_REPORT
Import: Release 10.2.0.4.0 - Production on Tue Dec 2 18:23:21 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V10.02.01 via direct path import done in US7ASCII character set and AL16UTF16 NCHAR character set IMP-00033: Warning: Table "EXAM_REPORT" not found in export file Import terminated successfully with warnings.
|
呵呵 oracle竟然提示说在dmp文件中找不到EXAM_REPORT这个对象,我想oracle在imp的时候,是以schema.object_name这种方式来检测的,所以没有找到,不然报错信息就有点儿难以理解了!
2、正确imp方法
[oracle@dp-test ~]$ imp system/oracle file=hhris.dmp fromuser=hhris touser=cbo tables=EXAM_REPORT
Import: Release 10.2.0.4.0 - Production on Tue Dec 2 18:23:54 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V10.02.01 via direct path import done in US7ASCII character set and AL16UTF16 NCHAR character set . importing HHRIS
|
总结:
1、fromuser为所导出数据的owner。
2、exp时owner与tables不能同时使用,相互冲突。
3、imp时可以同时指定fromuser 和tables参数。
记录下来,备忘之!
阅读(15963) | 评论(0) | 转发(0) |