imp exp迁移用户数据,不知源用户名解决方法

原文转载于:http://blog.chinaunix.net/u/7121/showart_321915.html

将数据从一个用户导入到另一个用户所遇到的问题。

第一步:导入数据

[oracle@olivenan oracle]$ imp MASAMK/MASAMK file=/opt/data/TB_GPIDF_GPPERSON_TREND_ANALY.dmp ignore=y rows=n;

Import: Release 9.2.0.4.0 - Production on Fri Jun 15 14:36:22 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

Export file created by EXPORT:V09.00.01 via conventional path
IMP-00013: only a DBA can import a file exported by another DBA
IMP-00000: Import terminated unsuccessfully

导入出错,原因是导出的用户不是MASAMK,而是其它用户。我们的解决方法是试图找到导出该数据的用户。

第二步:接下来使用fromuser,touser进行操作。

接下来使用fromuser,touser进行操作,由于不知fromuser应取何值,随便给个就行。
[oracle@olivenan oracle]$ imp system/oracle fromuser=test touser=masamk file=/opt/data/TB_GPIDF_GPPERSON_TREND_ANALY.dmp ignore=y rows=n;

Import: Release 9.2.0.4.0 - Production on Fri Jun 15 14:19:19 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

Export file created by EXPORT:V09.00.01 via conventional path

Warning: the objects were exported by GPIDF, not by you

import done in US7ASCII 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)
IMP-00034: Warning: FromUser "TEST" not found in export file
Import terminated successfully with warnings.

注意上面的红色字体,标识数据是从GPIDF用户导出。

第三步:接下来,可以将数据导入到system用户下,不建议这样做。

[oracle@olivenan oracle]$ imp system/oracle file=/opt/data/TB_GPIDF_GPPERSON_TREND_ANALY.dmp ignore=y rows=n full=y;

Import: Release 9.2.0.4.0 - Production on Fri Jun 15 14:20:54 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

Export file created by EXPORT:V09.00.01 via conventional path

Warning: the objects were exported by GPIDF, not by you

import done in US7ASCII 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)
. importing GPIDF's objects into SYSTEM
Import terminated successfully without warnings.

第四步:导入表结构
[oracle@olivenan oracle]$ imp system/oracle fromuser=gpidf touser=masamk file=/opt/data/TB_GPIDF_GPPERSON_TREND_ANALY.dmp ignore=y rows=n;

Import: Release 9.2.0.4.0 - Production on Fri Jun 15 14:22:35 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

Export file created by EXPORT:V09.00.01 via conventional path

Warning: the objects were exported by GPIDF, not by you

import done in US7ASCII 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)
. importing GPIDF's objects into MASAMK
Import terminated successfully without warnings.

第五步:导入数据
[oracle@olivenan oracle]$ imp system/oracle fromuser=gpidf touser=masamk file=/opt
/data/TB_GPIDF_GPPERSON_TREND_ANALY.dmp ignore=y rows=y;

Import: Release 9.2.0.4.0 - Production on Fri Jun 15 14:22:44 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

Export file created by EXPORT:V09.00.01 via conventional path

Warning: the objects were exported by GPIDF, not by you

import done in US7ASCII 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)
. importing GPIDF's objects into MASAMK
. . importing table "TB_GPIDF_GPPERSON_TREND_ANALY" 2362 rows imported
Import terminated successfully without warnings.
[oracle@olivenan oracle]$
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值