暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

为何而心跳-Oracle Heartbeat研究之二

原创 eygle 2006-01-27
787

在上一篇文章(为何而心跳-Oracle Heartbeat研究)中,我简单介绍了heartbeat的机制,现在我们来作点进一步的研究.


首先启动数据库到Mount状态: 


[oracle@jumper bdump]$ sqlplus '/ as sysdba'

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jan 24 14:10:02 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area   97588504 bytes
Fixed Size                   451864 bytes
Variable Size              33554432 bytes
Database Buffers           62914560 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production 

在Mount状态DUMP控制文件,比较前后变化,我们发现Heartbeat每3秒都被更新一次:


[oracle@jumper udump]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jan 24 14:10:33 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> alter session set events 'immediate trace name CONTROLF level 10' ;

Session altered.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

[oracle@jumper udump]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jan 24 14:10:46 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> alter session set events 'immediate trace name CONTROLF level 10' ;

Session altered.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[oracle@jumper udump]$ ls
conner_ora_31841.trc  conner_ora_31846.trc
[oracle@jumper udump]$ diff conner_ora_31841.trc conner_ora_31846.trc
....
16c16
< *** SESSION ID:(9.5) 2006-01-24 14:10:39.076
---
> *** SESSION ID:(9.7) 2006-01-24 14:10:48.822
63c63
< heartbeat: 580556236 mount id: 3192501183
---
> heartbeat: 580556239 mount id: 3192501183 

这说明Heartbeat并非在数据库Open状态下才会更新,也说明HeartBeat是用来维持实例的Mount状态检测.


Q:这里的mount id应该代表的是instance的id,每次不同,这个id来自何处呢?应该和系统有关,我没找到具体的含义.哪位知道请告知.


之所以验证这个内容是因为在Steve ( www.ixora.com.au )的网站上有这样一段话:



The checkpoint RBA is copied into the checkpoint progress record of the controlfile by the checkpoint heartbeat once every 3 seconds.



这段话在不同的数据库版本里需要被重新理解.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论