ITPub博客

首页 > 数据库 > Oracle > oracle的导入导出

oracle的导入导出

原创 Oracle 作者:boean 时间:2007-03-07 13:23:20 0 删除 编辑

oracle的导入导出,把生产数据库的数据down到本地,再导入测试环境,测试生产数据库备份文件的正确性!这里主要讲得是导入(dmp文件日益增大,工作量也日益增大,测试库估计顶不住了!毕竟是个DIY设备呵呵……)

[@more@]
1。创建目录在sql下运行一下语句 > create or replace directory tmp as 'y:'; > grant write,read on directory tmp to smsafe; (因为oracle导入导出默认目录是dpdump,在这个目录下,磁盘空间太小dmp文件有20g之多,在其它盘创建dumpfiley“Y:”是路径,windows或liunx下路径均可)
2.查看 select * from dba_directories;
3.删除 drop directory tmp;(创建错误或不需要时可删除)
4.导入原用户smsafe 原数据表空间smsafedata 原索引表空间smsafeindex 导入用户hebei 导入数据表空间hebeidata 导入索引表空间hebeiindex 主机字符串dbtest impdp smsafe/password@dbtest dumpfile=tmp:xxx.dmp remap_schema=smsafe:hebei remap_tablespace=smsafedata:hebeidata remap_tablespace=smsafeindex:hebeiindex
5.因为只是测试数据,因此可以做一下修改。来加快导入速度
a.设定bebheidata表空间nologging
b.导入时不导入索引 impdp sys/password dumpfile=tmp:xxx.dmp remap_schema=smsafe:hebei remap_tablespace=smsafedata:hebeidata remap_tablespace=smsafeindex:hebeiindex exclude=index:"like 'IDX%'"(注意大小写,点号需要转议字符)
6.导出 expdp sys/password dumpfile=tmp:xxx.dmp schemas=smsafe

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/556989/viewspace-903222/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: rman备份练习
请登录后发表评论 登录
全部评论
  • 博文量
    29
  • 访问量
    252437