导入数据IMP-00058 ORA-00904

php中文网
发布: 2016-06-07 17:33:51
原创
1841人浏览过

将源库分区表数据迁移到历史库中碰到IMP-00058 ORA-00904错误,具体操作及解决如下:

\'/ as sysdba\' statistics=nonedata_only=y file=/backup/wxlun20130911.dmplog=/backup/wxlun20130911.implog fromuser=wxlun touser=wxlun_his buffer=5400000

import: release 11.2.0.3.0 - production on wed sep 11 10:54:392013

copyright (c) 1982, 2011, oracle and/or itsaffiliates. all rights reserved.


connected to: oracle database 11g enterprise edition release11.2.0.3.0 - 64bit production
with the partitioning, olap, data mining and real applicationtesting options

export file created by export:v11.02.00 via conventional path

warning: the objects were exported by wxlun, not by you

import done in zhs16gbk character set and al16utf16 nchar characterset
. importing wxlun's objects into wxlun_his
. . importing partition "wxlun_t01":"pt_201306"
imp-00058: oracle error 904 encountered
ora-00904: "toexpresscompanyid": invalid identifier
imp-00057: warning: dump file may not contain data of allpartitions of this table

. . importing partition "wxlun_t02":"vapt_201306" 12553338 rows imported
imp-00057: warning: dump file may not containdata of all partitions of this table ---因为只导入一个分区数据,会报这个错误,在此忽略
import terminated successfully with warnings.

表wxlun_t02分区数据导入成功,而wxlun_t01导入失败,查看目的库的wxlun_t01表结构
sys@wxlun_his>desc wxlun.wxlun_t01
name null? type
------------------------------------------------- ----------------------------
bcid not null varchar2(20)
formcode not null varchar2(50)
currentstatus not null number(3)
prestatus not null number(3)
returnstatus number(3)
operatetype not null number(5)
currentdistributioncode not null varchar2(50)
deliverstationid not null number(10)
note not null varchar2(400)
createby not null number(10)
createdept not null number(10)
createtime not null date
isdeleted not null number(1)
syncflag not null number(1)
synctime date
ipaddress varchar2(20)
clientinfo varchar2(2000)


源库wxlun_t01表结构
sys@wxlun:sql>desc wxlun.wxlun_t01
name null? type
-------------------------------------------------------------------------------- -------------------------------------------------
bcid not null varchar2(20)
formcode not null varchar2(50)
currentstatus not null number(3)
prestatus not null number(3)
returnstatus number(3)
operatetype not null number(5)
currentdistributioncode not null varchar2(50)
deliverstationid not null number(10)
note not null varchar2(400)
createby not null number(10)
createdept not null number(10)
createtime not null date
isdeleted not null number(1)
syncflag not null number(1)
synctime date
ipaddress varchar2(20)
clientinfo varchar2(2000)
todistributioncode varchar2(100)
toexpresscompanyid number


发现源库的表增加了两个字段(随着业务需要,某些表会增加字段),将目的库表添加相应字段,,并将导入失败的表数据重新导入:

sys@wxlun_his>alter table wxlun.wxlun_t01 add todistributioncodevarchar2(100);
alter table wxlun.wxlun_t01 add toexpresscompanyid number;

table altered.

sys@wxlun_his>
table altered.

$imp \'/ as sysdba\' statistics=nonedata_only=y file=/backup/wxlun20130911.dmplog=/backup/wxlun20130911.implog fromuser=wxlun touser=wxlun_his buffer=5400000 tables=wxlun_t01

import: release 11.2.0.3.0 - production on wed sep 11 11:09:282013

copyright (c) 1982, 2011, oracle and/or itsaffiliates. all rights reserved.


connected to: oracle database 11g enterprise edition release11.2.0.3.0 - 64bit production
with the partitioning, olap, data mining and real applicationtesting options

export file created by export:v11.02.00 via conventional path

warning: the objects were exported by wxlun, not by you

import done in zhs16gbk character set and al16utf16 nchar characterset
. importing wxlun's objects into wxlun_his
. . importing partition"wxlun_t01":"pt_201306" 6779635 rowsimported ---导入成功
imp-00057: warning: dump file may not contain data of allpartitions of this table
import terminated successfully with warnings.
$

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号