ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 对象及数据存在时的数据导入(imp)

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

原创 Linux操作系统 作者:tolywang 时间:2010-12-27 08:15:11 0 删除 编辑

Oracle10g R2 ,   Oracle 11g R2 , Linux 

 

 范例: 

 

1. truncate channel用户data之前,注意disable掉FK.

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

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

 

2. disable channel用户下的 job及trigger, 可以直接在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_ap,channel, channel_ap_role),角色。

 

7. 查看channel及channel_ap是否有execute及debug procedure及function等的权限。

 

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

 

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

 

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

 

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

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/35489/viewspace-682635/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    14695504