exp是导出的意思,imp是导入的意思。

以下都是我使用xshell连接redhat5.5中oracle11g R2测试结果

首先需要切换到oracle账号,su – oracle

exp system/oracle@orcl file=/home/oracle/backup/full.dmp full=y

全部导出,使用system账号,后面oracle为密码,orcl是实例名称,full是全备的意思

exp system/oracle@orcl file=/home/oracle/bakup/scotthr.dmp owner=scott,hr

导出owner为scott和hr的duixiang

exp scott/tiger@orcl file=/home/oracle/backup/deptemp.dmp tables=dept,emp

导出scott的dept和emp两张表

使用sys账号导出时,需要使用转义字符,因为sys 必需要加as sysdba

exp \”sys/oracle@orcl as sysdba\” file=/home/oracle/backup/testsys.dmp owner=dept,emp

 

把scott.dept和scott.emp导入

imp scott/tiger@orcl file=/home/oracle/backup/deptemp.dmp

这样会失败,following statement failed because the object already exists:

oracle exp和imp的用法

imp scott/tiger@orcl file=/home/oracle/backup/deptemp.dmp ignore=y

忽略还是会有警告

oracle exp和imp的用法

直接把scott.dept和scott.emp删除,再重新还原应该就没有问题了,试试吧:

drop table scott.emp;

drop table scott.dept;

imp scott/tiger@orcl file=/home/oracle/backup/deptemp.dmp

oracle exp和imp的用法

相关文章:

  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-09-05
猜你喜欢
  • 2022-01-17
  • 2021-09-13
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2021-07-20
相关资源
相似解决方案