計(jì)算redo block size的大小 通常的操作系統(tǒng)都是以512 bytes為單位,如:Solaris, AIX, Windows NT/2000, Linux 等 這個(gè)Log size可以從Oracle的內(nèi)部視圖中獲得: SQL> select max(lebsz) from x$kccle;
額外的信息,每個(gè)redo block header需要占用16 bytes. SQL> select name,value from v$sysstat
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é)為單位的,但是LGWR將redo寫(xiě)入log file還是以塊為單位的。redo log block的大小在Oracle代碼中是固定的,是依據(jù)操作系統(tǒng)的,是操作系統(tǒng)支持的I/O的最小單位
從上表可以看出,最常用的操作系統(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 block有16個(gè)字節(jié)的頭,數(shù)據(jù)區(qū)域大約是 (redo size(redo信息的大?。?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就明白了
|
聯(lián)系客服