全庫匯入的一般步驟

husthxd發表於2005-02-22

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章