对象及数据存在时的数据导入(imp)

Oracle10g R2 ,   Oracle 11g R2 , Linux 

 

 范例: 

 

1. truncate channel用户data之前,注意disableFK.

select 'alter table '||owner||'.'||table_name|| ' disable constraint '||constraint_name||' ;'

from all_constraints where wner='CHANNEL' and constraint_type='R' ;

 

2. disable channel用户下的 jobtrigger, 可以直接在toad中操作。

 

3. truncate channel用户下的表数据 .

select ' truncate table channel.'||object_name||' ;' from dba_objects

where wner='CHANNEL' and  object_type='TABLE' ; 

 

4. 使用最新dmp导入数据

imp  'system/"system@dbsec"'  fromuser=channel  touser=channel   file=xxxxx.dmp  log=ccptimp.log  ignore=y

 

5. enable FK job, triggers . 

select 'alter table '||owner||'.'||table_name|| ' enable constraint '||constraint_name||' ;'

from all_constraints where wner='CHANNEL' and constraint_type='R' ;

 

最好在toad中检查一下FK是否有enable .

 

6. 检查同义词及权限(channel_apchannel, channel_ap_role),角色。

 

7. 查看channelchannel_ap是否有executedebug procedurefunction等的权限。

 

8. 检查sequence是否正常,检查所有其他对象。 

 

9. 导入的table 及列的注释comment可能都是乱码,需要重新执行脚本。

 

10. 以防丢失某些东西,可以在测试机上建立一个channel_test用户,导入新的dmp文件,进行对比。 

 

11.个别table或数据有问题,可以drop table重建 . 

 

请使用浏览器的分享功能分享到微信等