Welcome 微信登录

首页 / 数据库 / MySQL / Oracle 数据备份与恢复

Oracle导出数据:
 
 编写创建路径文件:create_dir.sql
 
 create or replace directory dmpdir as "E:app mp";
  grant read, write on directory dmpdir to test;
  exit
 
 编写执行导出Bat文件:export.bat
 
 sqlplus system/root123@MYTEST @create_dir.sql
  expdp system/root123@MYTEST schemas=test directory=dmpdir dumpfile=MYTEST.DMP
 
  MYTEST要备份的数据库 导入数据
 
  编写创建User文件:create_user.sql
 
drop user test2 cascade;
 create user test2 identified by password;
 grant connect, resource to test2;
 create or replace directory dmpdir as "E:app mp";
 grant read, write on directory dmpdir to test2;
 exit
 
 编写执行导入Bat文件:restore.bat
 
sqlplus system/root123@localhost:1521/MYTEST @create_user.sql
 impdp system/root123@localhost:1521/MYTEST  schemas=test directory=dmpdir dumpfile=MYTEST.DMP table_exists_action=replace remap_schema=test:test2推荐阅读:RMAN 配置归档日志删除策略 http://www.linuxidc.com/Linux/2013-11/92670.htmOracle基础教程之通过RMAN复制数据库 http://www.linuxidc.com/Linux/2013-07/87072.htmRMAN备份策略制定参考内容 http://www.linuxidc.com/Linux/2013-03/81695.htmRMAN备份学习笔记 http://www.linuxidc.com/Linux/2013-03/81892.htmOracle数据库备份加密 RMAN加密 http://www.linuxidc.com/Linux/2013-03/80729.htm更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12本文永久更新链接地址