Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6660265
  • 博文数量: 1005
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13071
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1005)

文章存档

2020年(2)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: Oracle

2011-12-28 20:07:19

环境:
OS:Red Hat Linux As 4
DB:10gR2
提前准备:全备份整个数据库.
 
步骤1:先停掉数据库
shutdown immediate
步骤2.模拟损坏某个数据文件,这里使用vi编辑数据文件hxl01.dbf
步骤3:启动数据库
SQL> startup
ORACLE instance started.
Total System Global Area  524288000 bytes
Fixed Size                  1220360 bytes
Variable Size             163578104 bytes
Database Buffers          356515840 bytes
Redo Buffers                2973696 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/u01/app/oracle/oradata/oracl/hxl01.dbf'
 
步骤4:恢复损坏的数据库
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
restore datafile 5;
recover datafile 5;
sql 'alter database open';
release channel c1;
release channel c2;
}
allocated channel: c1
channel c1: sid=155 devtype=DISK
allocated channel: c2
channel c2: sid=154 devtype=DISK
Starting restore at 28-DEC-11
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to /u01/app/oracle/oradata/oracl/hxl01.dbf
channel c1: reading from backup piece /u01/rman_backup/2011/201112/20111227/df_770980962_46_1.bak
channel c1: restored backup piece 1
piece handle=/u01/rman_backup/2011/201112/20111227/df_770980962_46_1.bak tag=TAG20111227T092240
channel c1: restore complete, elapsed time: 00:00:05
Finished restore at 28-DEC-11
Starting recover at 28-DEC-11
starting media recovery
media recovery complete, elapsed time: 00:00:02
Finished recover at 28-DEC-11
sql statement: alter database open
released channel: c1
released channel: c2
阅读(3834) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~