Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2617527
  • 博文数量: 323
  • 博客积分: 10211
  • 博客等级: 上将
  • 技术积分: 4934
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-27 14:56
文章分类

全部博文(323)

文章存档

2012年(5)

2011年(3)

2010年(6)

2009年(140)

2008年(169)

分类: Oracle

2008-11-19 13:26:15

redo buffer在v$sgastat和v$sga所显示的大小不一样。截取一段网友的测试:
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
PL/SQL Release 9.2.0.7.0 - Production
CORE    9.2.0.7.0       Production
TNS for Linux: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - Production

SQL> select * from v$sga;

NAME                      VALUE
-------------------- ----------
Fixed Size               452268
Variable Size         218103808
Database Buffers      536870912
Redo Buffers             667648

SQL>  select * from v$sgastat where name='log_buffer';

POOL        NAME                            BYTES
----------- -------------------------- ----------
            log_buffer                     656384

SQL> select 667648-656384 from dual;

667648-656384
-------------
        11264


10G

SQL> select * from v$version;

BANNER
---------------------------------------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

SQL> show sga

Total System Global Area 1258291200 bytes
Fixed Size                  1292180 bytes
Variable Size             897583212 bytes
Database Buffers          352321536 bytes
Redo Buffers                7094272 bytes
SQL>  select * from v$sgastat where name='log_buffer';

POOL       NAME                                BYTES
---------- ------------------------------ ----------
           log_buffer                        7094272
我们注意到10g这个问题已经不存在了。查询了一些文档,摘录如下:
 
Log Buffer Guard PagesOn platforms that support memory protection there are guard pages on each side of the log buffer. These are one memory protection unit in size - normally 4K or 8K. Oracle uses an mprotect() system call during instance startup to set the permissions on the guard pages to PROT_NONE. Thus any attempt to read from or write to either of the guard pages will return the EACCES error and cause the process to abort, even if the effective user id of the process is oracle.

The intent of the guard pages is to reduce the risk of log buffer corruption. It is possible for an Oracle bug, hardware memory error or hacker stack corruption attack to cause a pointer or offset to be corrupted so that data is copied into memory at an incorrect location. The guard pages prevent such corruptions from over running the log buffer.

Log buffer protected by guard pages

The following listing shows that the guard pages are included in the size of the "Redo Buffers" as shown in V$SGA, but are excluded from the size of the "log_buffer" as shown in V$SGASTAT. Oracle DBAs are often puzzled by this discrepancy.

SQL> select name, value from v$sga where name = 'Redo Buffers'; NAME VALUE -------------------- ---------- Redo Buffers 532480 SQL> select name, bytes from v$sgastat where name = 'log_buffer' and pool is null; NAME BYTES -------------------------- ---------- log_buffer 524288
阅读(1606) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~