如果你手里有个exp导出的dmp文件,不知道导出用户,如何导入?
现在模拟一下,从test导出导入新建用户anbob
[oracle@orazhang ~]$ exp test/test file=test.dbf
Export: Release 10.2.0.1.0 - Production on 星期三 4月 13 17:19:24 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST
About to export TEST's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST's tables via Conventional Path ...
. . exporting table TESTCHAR 2 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TESTNULL 1 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TEST_PRO 2 rows exported
. . exporting table TEST_TRAN 5 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TEST_TRI 1 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table TEST_UNUSE 50706 rows exported
EXP-00091: Exporting questionable statistics.
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.
[oracle@orazhang ~]$ ls
afiedt.buf baiji.java doub.java ed.hup orcldrop.sql test.dbf
a.sql b.sql Download on.lst record wxWidgets-2.9.1
baiji.class Desktop dwhelper oraInventory sqlnet.log
[oracle@orazhang ~]$ ora
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 4月 13 17:19:44 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> create user anbob identified by anbob;
User created.
SQL> grant connect,resource to anbob;
Grant succeeded.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@orazhang ~]$ imp anbob/anbob file=test.dbf;
Import: Release 10.2.0.1.0 - Production on 星期三 4月 13 17:20:46 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
Warning: the objects were exported by TEST, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
.importing TEST's objects into ANBOB
Import terminated successfully without warnings.
[oracle@orazhang ~]$ imp anbob/anbob file=test.dbf full=y;
Import: Release 10.2.0.1.0 - Production on 星期三 4月 13 17:24:32 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
Warning: the objects were exported by TEST, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing TEST's objects into ANBOB
. . importing table "TESTCHAR" 2 rows imported
. . importing table "TESTNULL" 1 rows imported
. . importing table "TEST_PRO" 2 rows imported
. . importing table "TEST_TRAN" 5 rows imported
. . importing table "TEST_TRI" 1 rows imported
. . importing table "TEST_UNUSE" 50706 rows imported
Import terminated successfully without warnings.
[oracle@orazhang ~]$ ora
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 4月 13 17:24:59 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn anbob/anbob
Connected.
SQL> select count(*) from tab;
COUNT(*)
----------
6
------------------------------------------------
导出成功,数据也没问题,但大伙应该注意到导出的时候有异常EXP-00091: Exporting questionable statistics
是因为数据库的字符集和客户端(NLS_LANG)的字符集不一致导致的,修改一致后,再试一下
数据库字符集:
SQL> RUN
1 select * from database_properties where property_name like '%SET%'
2*
rows will be truncated
PROPERTY_NAME PROPERTY_VALUE
------------------------------------------------------------ -----------------------------------------------------------------------------------------
NLS_CHARACTERSET AL32UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_LANG字符集
[oracle@orazhang ~]$ echo $NLS_LANG
Simplified Chinese_china.ZHS16GBK
[oracle@orazhang ~]$ export NLS_LANG="Simplified Chinese_china.AL32UTF8"
[oracle@orazhang ~]$ exp test/test file=c.dbf
Export: Release 10.2.0.1.0 - Production on 鏄熸湡涓?4鏈?13 17:45:25 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST
About to export TEST's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST's tables via Conventional Path ...
. . exporting table TESTCHAR 2 rows exported
. . exporting table TESTNULL 1 rows exported
. . exporting table TEST_PRO 2 rows exported
. . exporting table TEST_TRAN 5 rows exported
. . exporting table TEST_TRI 1 rows exported
. . exporting table TEST_UNUSE 50706 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
「喜欢文章,快来给作者赞赏墨值吧」 赞赏
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
请登录后发表评论