导入时,对象如果存在,可以指定ignore=y忽略错误
1.导出与导入全库
a.exp
#export the entire database
userid="sys/doone@practice as sysdba"
file=dmp/full_1.dmp
log=log/full.log
full=y
rows=y
buffer=10000
compress=n
RECORD=y
#增量导出(cumulative累积,incremental增量,complete完全)
inctype=incremental
b.imp
#import the entire database
userid="sys/doone@practice as sysdba"
file=dmp/full.dmp
log=log/full.log
full=y
show=Y
ignore=y
#增量导入,废弃
#inctype=restore
c.从全导出中,导入某张或多张表
#import the entire database
userid="sys/doone@practice as sysdba"
file=dmp/full.dmp
log=log/full.log
#full=y
#show=Y
tables=(date_log)
fromuser=tina
rows=y
ignore=y
#增量导入,废弃
#inctype=restore
2.导出或导入某个用户
a.exp
#Export user scott
userid="sys/doone@practice as sysdba"
file=export_user_scott.dmp
log=export_user_scott.log
owner=scott
b.imp
GRANT CONNECT,RESOURCE TO SCOTT IDENTIFIED BY TIGER;
ALTER USER SCOTT DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
#import user Scotty
userid="sys/doone@practice as sysdba"
file=dmp/export_user_scott.dmp
log=import_user_scott.log
fromuser=scott
ignore=y
c.imp到另一用户scotty
GRANT CONNECT,RESOURCE TO SCOTTY IDENTIFIED BY TIGER;
ALTER USER SCOTTY DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
#import user Scotty
userid="sys/doone@practice as sysdba"
file=dmp/export_user_scott.dmp
log=import_user_scott.log
fromuser=scott
touser=scotty
rows=n
3.导出或导入某个或,或多个
A.EXP
userid="sys/doone@practice as sysdba"
file=dmp/export_user_table.dmp
log=log/export_user_table.log
tables=(tina.date_log)
query="where create_date<sysdate"
compress=n
direct=n
B.IMP
userid="sys/doone@practice as sysdba"
file=dmp/export_user_table.dmp
log=log/import_user_table.log
tables=(date_log)
fromuser=tina
ignore=y