Welcome 微信登录

首页 / 数据库 / MySQL / Orcale 备份与还原数据库

Orcale 数据库备份数据的命令用exp.exe,还原数据库命令imp.exe一、备份数据库——exp格式:exp 用户名/密码@数据库 owner=拥有者 file=C:xxxxxx.dmpeg1、数据库TEST完全导出,用户名:test, 密码:test,拥有者:tb_test 导出到D:daochu.dmp中exp test/test@TEST owner=tb_test  file=d:daochu.dmp第一步:进入到 Oracle 安装目录下的bin目录下;第二步:exp test/test@TEST owner=tb_test  file=d:daochu.dmpeg2、将数据库中的表test中的字段filed1以"00"开头的数据导出,用户名:test, 密码:testexp test/test@TEST file=d:daochu.dmp tables=(test)query="where filed1 like "00%""注:可以在命令后面 加上 compress=y 来实现 文件压缩二、还原数据库——imp格式:imp 用户名/密码@数据库 full=y file=备份文件路径 ignore=y log=日志文件路径eg 1、将D:daochu.dmp文件还原到tb_test数据库中,用户名:test, 密码:test,日志文件放在D:/log.txt 中第一步:进入到 oracle 安装目录下的bin目录下;第二步:imp system/manager@tb_test full = y file="d:ack.dmp" ignore=y log=d:log.txteg2、将d:daochu.dmp中的表table1 导入到tb_test数据库中imp system/manager@tb_test file=d:daochu.dmp  tables=(table1)注:如何没有以前的表记录的话,有可能要出现重复数据,可以通过以下方式解决首先,删除用户(本人用的test):DROP USER test CASCADE其次,新建用户(test)create user test identified by testdefault tablespace test_datatemporary tablespace test_tempquota unlimited on test_dataaccount unlock;然后,给新建用户授权 GRANT CONNECT,DBA, RESOURCE TO test;最后,执行导入数据命令。Oracle 断开用户连接的方法Linux下的MySQL自动备份脚本-第一版相关资讯      Oracle数据库  Oracle入门教程  oracle数据库教程 
  • Oracle数据库全球化  (03月01日)
  • Oracle数据库日期过滤方法性能比较  (02/02/2015 13:20:26)
  • Oracle数据库安装中端口被占用问题  (10/29/2014 07:42:24)
  • 在CentOS 6.6上搭建C++运行环境并  (10/10/2015 19:44:40)
  • Oracle数据库无法使用localhost和  (11/14/2014 16:39:10)
  • 使用SQLT来构建Oracle测试用例  (08/28/2014 06:17:41)
本文评论 查看全部评论 (0)
表情: 姓名: 字数