exp/imp

来源:互联网 发布:形式语言与自动机 知乎 编辑:程序博客网 时间:2024/06/05 18:20

 

 

exp scott/scott@test file=scott.dmp log=scott.log tables=emp,dept constraints=n indexes=n

 

imp scott1/scott1@test file=scott.dmp log=scott1.dmp tables=(emp,dept) fromuser=scott touser=scott1 commit=y ignore=y indexes=n constraints=n

 

exp scott/scott@test file=sit.dmp log=sit.log tables=(a,b,c) constraints=n indexes=n

exp  scott/scott@test file=pub_sit.dmp log=pub_sit.log tables=a query='where create_time ">"sysdate -1 and rownum "<"=100'  constraints=n indexes=n

 


exp scott/scott@test file=scott.dmp log=scott.log tables=dept query=/''where deptno=20 /'' constraints=n indexes=n


exp scott/scott@testfile=scott.dmp log=scott.log tables=dept query='where deptno=20 ' constraints=n indexes=n


imp scott1/scott1@test file=scott.dmp log=scott1.dmp tables=(emp,dept) fromuser=scott touser=scott1 commit=y ignore=y indexes=n constraints=n


imp scott/scott@test  file=sit.dmp log=prelive.log tables=(a,b.c) constraints=n indexes=n

 

 

 

 

 

forward:

 

 

因为impdp的bug较多,在我导入数据的时候,有错误,我于是用imp工具

imp skate/password fromuser=skate touser=skate_new file=/home/oracle/admin/omovo/dpdump/compassweb.dmp ignore=y
提示下面的错误:

IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (MOVO_NEW.COMPASSINDEXPLACE_PK) violated

从错误可以看出,是因为有重复的数据,经过google后,了解到如果表没有constraints, 用ignore=y.可以覆盖表,但如果表
有constriants,那就要先删除原有的数据,在后在imp.否则会提示上面的错误.

我的做法是删除已经存在的表,然后在imp,结果ok全部导入