Oracle恢复实验(三)
2012-08-29 19:57
260 查看
环境:Oracle10g、Red Hat 4,Oracle运行在归档模式。
场景:恢复未备份的数据文件。
具体步骤:
1、新建表空间testts,并建个表,插入些数据
SQL> create tablespace testts datafile '/home/oracle/oracle/product/oradata/orcl/testts01.dbf' size 10m;
Tablespace created.
SQL> create table testTab tablespace testts
2 as select * from scott.emp;
Table created.
SQL> select count(*) from testTab;
COUNT(*)
----------
14
SQL> commit;
Commit complete.
2、关库、删除数据文件,模拟数据文件损坏,注意没有备份哟
SQL> shutdown abort
SQL> !rm -f /home/oracle/oracle/product/oradata/orcl/testts01.dbf
3、尝试打开数据库
SQL> startup
ORACLE instance started.
Total System Global Area 130023424 bytes
Fixed Size 1218100 bytes
Variable Size 67111372 bytes
Database Buffers 58720256 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/home/oracle/oracle/product/oradata/orcl/testts01.dbf'
会提示数据文件无法找到。
5、重建数据文件,尝试打开数据库。
SQL> alter database create datafile '/home/oracle/oracle/product/oradata/orcl/testts01.dbf';
Database altered.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/home/oracle/oracle/product/oradata/orcl/testts01.dbf'
此时数据文件是个空的,当然需要介质恢复
6、介质恢复
SQL> recover database;
Media recovery complete.
7、打开数据库,查检数据是否恢复
SQL> alter database open;
Database altered.
SQL> select count(*) from testTab;
COUNT(*)
----------
14
全部数据都恢复回来了。
相关文章推荐
- Oracle常规恢复的实验测试
- Oracle常规恢复的实验测试
- Oracle恢复实验(一)
- Oracle恢复实验一:使用添加数据文件之前的控制文件
- Oracle恢复实验(二):数据文件user01.dbf损坏,打开数据库情况下进行恢复。
- Oracle恢复实验(三):恢复未备份的数据文件。
- Oracle 10g中使用RMAN进行备份恢复的几个实验手记
- oracle实验记录 (恢复,备份-含坏块数据文件)
- Oracle恢复实验(四):所有控制文件和数据文件丢失。
- Oracle利用RMAN做异地恢复实验
- [置顶] [实验-视频过程]oracle热备份-整个数据库-备份和恢复操作演示
- oracle rman 实验(oracle rman Cumulative累积增量备份和恢复)
- oracleRMAN备份与恢复实验
- Oracle恢复实验(一)
- oracle 热备份与恢复实验
- oracle 日志恢复实验
- Oracle 10g rac+asm 磁盘头备份与恢复实验
- Oracle恢复实验笔记
- Oracle恢复实验(二)
- oracle dataguard 实验(恢复备份至异机)