ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 全库导入的一般步骤

全库导入的一般步骤

原创 Linux操作系统 作者:husthxd 时间:2005-02-22 00:00:00 0 删除 编辑

IMP全库导入的一般步骤


1.先全库加rows=n把结构导进去
imp system/manager file=exp.dmp log=imp.log full=y rows=n indexes=n
2.使业务用户的触发器失效/删除主键和唯一索引
spool drop_pk_u.sql

select 'alter table '||table_name||' drop constraint '||constraint_name||';'
from user_constraints
where constraint_type in ('P','U')
/

spool off

spool disable_trigger.sql

select 'alter trigger '||trigger_name||' disable;'
from user_triggers
/

spool off

@drop_pk_u.sql
@disable_trigger.sql

3.以ignore=y全库导入
imp system/manager file=exp.dmp log=imp.log full=y ignore=y

4.通过toad提取源数据库创建主键和索引的脚本,在目标数据库中创建主键和索引.

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

请登录后发表评论 登录
全部评论
ITPUB数据库版块资深版主,对Oracle、PostgreSQL有深入研究。

注册时间:2007-12-28

  • 博文量
    1559
  • 访问量
    4231838