国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
計(jì)算oracle redo block size的大小
計(jì)算oracle redo block size的大小
2011年01月29日 星期六 下午 11:09

計(jì)算redo  block size的大小
   LGWR以block為單位把redo寫(xiě)入磁盤(pán),redo block size是Oracle源代碼中固定的,與操作系統(tǒng)相關(guān)。

通常的操作系統(tǒng)都是以512 bytes為單位,如:Solaris, AIX, Windows NT/2000, Linux 等

這個(gè)Log size可以從Oracle的內(nèi)部視圖中獲得:

SQL> select max(lebsz) from x$kccle;
            MAX(LEBSZ)
            ----------
            512
            


也可以從v$sysstat中的統(tǒng)計(jì)信息中通過(guò)計(jì)算粗略得到.
以下幾個(gè)統(tǒng)計(jì)信息如:
redo size------------redo信息的大小
redo wastage---------浪費(fèi)的redo的大小
redo blocks written--LGWR寫(xiě)出的redo block的數(shù)量

額外的信息,每個(gè)redo block header需要占用16 bytes.
由此可以粗略的計(jì)算redo block size如下

SQL> select name,value from v$sysstat
            2  where name in ('redo size','redo wastage','redo blocks written');
            NAME                                                                  VALUE
            ---------------------------------------------------------------- ----------
            redo size                                                           2242628
            redo wastage                                                          63904
            redo blocks written                                                    4657
            SQL> select ceil(16 + (2242628 + 63904)/4657) rbsize from dual;
            RBSIZE
            ----------
            512
 

 

Although the size of redo entries is measured in bytes, LGWR writes the redo to the log files on disk in blocks. The size of redo log blocks is fixed in the Oracle source code and is operating system specific. Oracle's documentation uses the term "operating system block size" to refer to the log block size. Normally it is the smallest unit of I/O supported by the operating system for raw I/O, but on some operating systems it is the smallest possible unit of file system based I/O. The following table shows the most common log block sizes and some of the operating systems that use them.<?XML:NAMESPACE PREFIX = O />

雖然redo entries是以字節(jié)為單位的,但是LGWRredo寫(xiě)入log file還是以塊為單位的。redo log block的大小在Oracle代碼中是固定的,是依據(jù)操作系統(tǒng)的,是操作系統(tǒng)支持的I/O的最小單位

 

 

  Log Block Size  

Operating Systems

512 bytes

  Solaris, AIX, Windows NT/2000, Linux, Irix, DG/UX, OpenVMS, NetWare, UnixWare, DYNIX/ptx  

1024 bytes

  HP-UX, Tru64 Unix

2048 bytes

  SCO Unix, Reliant Unix

4096 bytes

  MVS, MPE/ix

從上表可以看出,最常用的操作系統(tǒng)的log block的大小都是512字節(jié)。查看這個(gè)塊大小有很多方法:

x$kccle中查:

select max(l.lebsz) log_block_size_kccle

from sys.x$kccle l

where l.inst_id = userenv('Instance')

The log block size can also be inferred from the system statistics in StatsPack reports. There is a 16 byte header for each log block, and the size of the data area is approximately the number of bytes of redo generated (redo size) plus the number of bytes of redo space left unused (redo wastage) divided by the number of log blocks written (redo blocks written). Thus the approximate formula is

log block size可以大致由統(tǒng)計(jì)信息中推斷。每個(gè)log block16個(gè)字節(jié)的頭,數(shù)據(jù)區(qū)域大約是

(redo sizeredo信息的大?。?span>+redo wastage(浪費(fèi)的redo大小))/redo blocks written(LGWR寫(xiě)Redo的塊的數(shù)量)

16 + (redo size + redo wastage) / redo blocks written

v$sysstat中查:

 

select ceil(16+(redo_size+redo_wastage)/redo_block_written) log_block_size_sysstat

from(select max(decode(name,'redo size',value)) redo_size,

          max(decode(name,'redo wastage',value)) redo_wastage,

          max(decode(name,'redo blocks written',value)) redo_block_written

from (select name,value from v$sysstat

where name in('redo size','redo wastage','redo blocks written')))

This formula will commonly understate the log block size by a few bytes, because it does not allow for redo that has been generated but not yet written, and the redo size statistic is commonly a little inaccurate.

按道理redo block written *(512-16)應(yīng)該等于redo size+redo wastage的,現(xiàn)在還不是很理解,準(zhǔn)備發(fā)一個(gè)帖子請(qǐng)教論壇高手

另外,既然redo寫(xiě)入log file都是以block為單位,那在LGWR頻繁給觸發(fā)時(shí),必然存在block還沒(méi)有寫(xiě)滿就被寫(xiě)入了log file,針對(duì)這樣的場(chǎng)景如何理解----看了redo wastage就明白了 

 


本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
oracle可以存放多大數(shù)據(jù)量數(shù)據(jù),多少條數(shù)據(jù)
Statspack之十四-"log file sync" 等待事件
oracle 11g log buffer和redo buffer值不同
深入淺出Oracle學(xué)習(xí)筆記(1)
oracle12c 部署(三)
Oracle 重做日志調(diào)整 SQL語(yǔ)句
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服