Chinaunix首页 | 论坛 | 博客
  • 博客访问: 815490
  • 博文数量: 199
  • 博客积分: 6363
  • 博客等级: 准将
  • 技术积分: 2225
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-28 10:01
个人简介

来自农村的老实娃

文章分类

全部博文(199)

文章存档

2017年(1)

2014年(2)

2013年(3)

2012年(6)

2011年(26)

2010年(34)

2009年(50)

2008年(44)

2007年(33)

我的朋友

分类: Oracle

2010-01-06 16:30:33

1、对数据库作一个完全备份
$ORACLE_HOME/bin/rman target / <
run{
crosscheck archivelog all;
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/data/backup/2009_12_full/control_%F';
backup full database format '/data/backup/2009_12_full/data_%d_%U'
plus
archivelog format '/data/backup/2009_12_full/arch_%d_%U' delete all input;
}
!
2、删除所有的数据文件、控制文件,模拟灾难现场
3、准备数据库的口令文件
orapwd file=dyx.ora password=lzdyxin entries=5
4、准备spfile
sqlplus ' \ as sysdba'
create spfile from pfile='/data/init.ora';
5、启动数据库到nomount
startup nomount
6、启动rman
rman target /
7、告诉RMAN要操作的数据库(设置DBID)
RMAN>set DBID=387952369(此号在备份文件名中可找到)
8、从备份文件中还原控制文件
RMAN>restore controlfile from '/data/backup/2009_12_full/control_387952369..
9、启动数据到mount
RMAN>sqlp 'alter database mount';
10、还原数据库
RMAN>restore database;
11、恢复数据
RMAN>recover database;
12、打开数据库
RMAN>sql 'alter database open resetlogs';
13、作完恢复,立即对数据库作一个完全备份
阅读(949) | 评论(0) | 转发(0) |
0

上一篇:清除expdp作业

下一篇:怀念周总理

给主人留下些什么吧!~~