Linux 中 Oracle dmp 文件导入导出,oracledmp


a. 用户名 system 密码 manager 导出到D:/daochu.dmp中

exp system/manager@SID file=d:/daochu.dmp full=y 

b. 将数据库中 system 用户与 sys 用户的表导出

exp system/manager@SID file=d:/daochu.dmp owner=(system,sys) 

c. 将数据库中的表 inner_notify、notify_staff_relat导出

exp aichannel/aichannel@SID file= d:/data/newsmgnt.dmp tables=(inner_notify,notify_staff_relat) 

d. 将数据库中的表 table1 中的字段 filed1 以"00"打头的数据导出

exp system/manager@SID file=d:/daochu.dmp tables=(table1) query=/" where filed1 like '00%'/" 

对于压缩,既用 winzip 把 dmp 文件可以很好的压缩,也可以在上面命令后面 加上 compress=y 来实现。

导出 DMP文件适用于,大型数据库完整迁移,迁移前后的数据库字符集要求比较严格,对CLOB字段支持不太友好。

对于小数据的导出其实用 PLSQL 能做的更好,更快,导出的SQL也很直观。

对于本机安装了oracle 客户端,可以直接将 DMP 文件导出到本地,如果是没有安装,导出的文件是在linux 服务器上面。

需要用远程工具【WINSCp,PINTY.....】连接下载下来。

e. 将 D:/daochu.dmp 中的数据导入 TEST数据库中。

imp system/manager@SID file=d:/daochu.dmp 
imp aichannel/aichannel@HUST full=y file=file= d:/data/newsmgnt.dmp ignore=y 

上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入,后面添加 ignore=y。 

f. 将 d:/daochu.dmp中的表table1 导入

imp system/manager@SID file=d:/daochu.dmp tables=(table1)

相关内容