日期:2014-05-16  浏览次数:20409 次

数据库启动时丢失数据文件模拟实验

1.查询数据库状态,MOUNTED

SYS@ bys001>select status,startup_time from v$instance;
STATUS       STARTUP_TIME
------------ -------------------
MOUNTED      2013/07/16 16:54:36

2.重命令一个数据文件,模拟文件丢失。

SYS@ bys001>host
[oracle@oel-01 oradata]$ cd bys001/
[oracle@oel-01 bys001]$ ls
bys_flashback.dbf  redo01.log    test1.dbf
catalog1.dbf       redo02.log    test1_undo.dbf
control01.ctl      redo03.log    undotbs01.dbf
example01.dbf      sysaux01.dbf  users01.dbf
redo01a.log        system01.dbf  users01.dbf2
redo01a.logbak     temp01.dbf

[oracle@oel-01 bys001]$ mv users01.dbf users01.dbf.bak  
[oracle@oel-01 bys001]$ ls
bys_flashback.dbf  redo01.log    temp01.dbf
catalog1.dbf       redo02.log    test1.dbf
control01.ctl      redo03.log    test1_undo.dbf
example01.dbf      sysaux01.dbf  undotbs01.dbf
redo01a.log        system01.dbf  users01.dbf.bak
查看日志:
[oracle@oel-01 ~]$ cat alert_bys001.log                                                                                           
alter database mount
Tue Jul 16 21:58:24 2013
Successful mount of redo thread 1, with mount id 2045113404
Allocated 3981204 bytes in shared pool for flashback generation buffer
Starting background process RVWR
Tue Jul 16 21:58:24 2013
RVWR started with pid=20, OS id=4553
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: alter database mount
Tue Jul 16 22:08:53 2013
Checker run found 1 new persistent data failures
   ---系统发现了,运行检查发现1个新的持久性数据失败
                    
with mount id 2045113404     mount id  在正常MOUNT数据库过程中,数据库计算MOUNT ID并记录在
控制文件中,然后开始启动心跳heartbeat,每3秒更新一次控制文件。
 heartbeat表示实例已经被特定例程MOUNT,此属性主要用于RAC环境。在单实例环境中同样存在。

使用ASM时,还会增加一个ASM实例的心跳事件。


SYS@ bys001>select event#,name from v$event_name where name like '%heart%';
    EVENT# NAME
---------- ----------------------------------------
        75 heartbeat monitor sleep
       380 ASM mount : wait for heartbeat
       563 control file heartbeat
                                                           &nbs