RMAN学习之二:归档模式无备份,丢失数据文件。
2012-11-11 10:20
459 查看
1、数据库处于归档模式。
2、模拟环境。
3、删掉数据文件。
4、恢复数据文件。
(1)重建数据文件。
(2)修复数据文件。
(3)打开数据库。
(4)检查数据。
总结:丢失数据文件,从其创建时刻起所有的重做日志都在,因此可以在重建数据文件,通过recover命令应用所有重做日志,重建数据文件的内容。
这里也可以借助RMAN实现。
回到故障现场。
修复数据文件。
应用重做日志。
打开数据库。
检查数据。
SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/app/oracle/oradata/archive Oldest online log sequence 1 Next log sequence to archive 1 Current log sequence 1
2、模拟环境。
SQL> create tablespace test datafile '/u01/app/oracle/oradata/orcl/test.dbf' size 100m;
SQL> create user test identified by test default tablespace test;
SQL> grant connect, resource to test;
SQL> select * from stu; ID NAME ---------- -------------------- 1 aa 2 bb
3、删掉数据文件。
SQL> host rm -f '/u01/app/oracle/oradata/orcl/test.dbf';
SQL> startup; ORA-32004: obsolete and/or deprecated parameter(s) specified ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 125830736 bytes Database Buffers 155189248 bytes Redo Buffers 2973696 bytes Database mounted. ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test.dbf'
4、恢复数据文件。
(1)重建数据文件。
SQL> alter database create datafile '/u01/app/oracle/oradata/orcl/test.dbf' as '/u01/app/oracle/oradata/orcl/test.dbf'; Database altered.
(2)修复数据文件。
SQL> recover datafile 6; Media recovery complete.
(3)打开数据库。
SQL> alter database open; Database altered.
(4)检查数据。
SQL> select * from stu; ID NAME ---------- -------------------- 1 aa 2 bb
总结:丢失数据文件,从其创建时刻起所有的重做日志都在,因此可以在重建数据文件,通过recover命令应用所有重做日志,重建数据文件的内容。
这里也可以借助RMAN实现。
回到故障现场。
SQL> host rm -f '/u01/app/oracle/oradata/orcl/test.dbf';
SQL> startup; ORA-32004: obsolete and/or deprecated parameter(s) specified ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 130025040 bytes Database Buffers 150994944 bytes Redo Buffers 2973696 bytes Database mounted. ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test.dbf'
修复数据文件。
RMAN> restore datafile 6; Starting restore at 2012-11-11 10:52:18 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=154 devtype=DISK creating datafile fno=6 name=/u01/app/oracle/oradata/orcl/test.dbf restore not done; all files readonly, offline, or already restored Finished restore at 2012-11-11 10:52:25
应用重做日志。
RMAN> recover datafile 6; Starting recover at 2012-11-11 10:52:33 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:01 Finished recover at 2012-11-11 10:52:34
打开数据库。
RMAN> alter database open; database opened
检查数据。
SQL> select * from stu; ID NAME ---------- -------------------- 1 aa 2 bb
相关文章推荐
- 一个归档模式无备份丢失数据文件的恢复
- ORACLE基础学习-RMAN应用--归档模式有备份,丢失数据文件恢复
- RMAN数据库恢复 之归档模式有(无)备份-丢失数据文件的恢复
- ORACLE基础学习-RMAN应用之(归档模式无备份,丢失数据文件的恢复)
- 归档模式五备份,丢失数据文件的恢…
- RMAN学习之一:归档模式有备份,丢失数据文件。
- 在归档模式下有备份,丢失数据文件的恢复
- rman实验之归档模式无备份,正常关机丢失数据文件的恢复
- rman实验之归档模式有备份,正常关机丢失数据文件的恢复
- 控制文件丢失恢复案例(归档模式下,有备份)
- 归档模式下-丢失非关键数据文件
- 归档模式下-丢失关键数据文件
- RMAN学习6——归档有备份,丢失部分数据文件
- RMAN学习7——归档无备份,丢失部分数据文件
- 归档模式下恢复没有备份的数据文件
- 归档模式误删除文件无备份恢复--无数据丢失
- RMAN学习之三:归档模式有备份,丢失控制文件。
- 归档模式下有备份数据文件损坏的完全恢复-1
- 归档模式下,恢复没有备份的数据文件
- 归档模式下无备份数据文件损坏的完全恢复-2