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








分类: Oracle

2008-11-19 13:26:15

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

Oracle9i Enterprise Edition Release - Production
PL/SQL Release - Production
CORE       Production
TNS for Linux: Version - Production
NLSRTL Version - 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;



SQL> select * from v$version;

Oracle Database 10g Enterprise Edition Release - Prod
PL/SQL Release - Production
CORE      Production
TNS for 32-bit Windows: Version - Production
NLSRTL Version - 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
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
阅读(1498) | 评论(0) | 转发(0) |