imp 与exp部分例子

导入时,对象如果存在,可以指定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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值