Oracle 数据备份与恢复


Oracle导出数据:
 
 编写创建路径文件:create_dir.sql
 
 create or replace directory dmpdir as 'E:\app\tmp';
  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\tmp';
 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 配置归档日志删除策略

Oracle基础教程之通过RMAN复制数据库

RMAN备份策略制定参考内容

RMAN备份学习笔记

Oracle数据库备份加密 RMAN加密

相关内容

    暂无相关文章