
2008-7-2 09:45
wsxinfor
关于lgwr,每次commit都执行一次lgwr吗?
关于lgwr,每次commit都执行一次lgwr吗?
oracle的书籍上写道,fast commit技术,比如我的生产环境每秒钟大概会有100个用户commit 提交事物,是不是oracle的lgwr在1秒钟内写100次呢? 如果是这原那么效率是不是很低呢? 是否可以有多个lgwr进程?
2008-7-2 09:57
wsxinfor
?
2008-7-2 10:36
sqysl
应该是这样的,COMMIT就写日志,写日志前还要写数据,可以开多个写日志进程。
2008-7-2 13:08
wsxinfor
搞错了吧,写数据肯定是在写日至后阿, 而且lgwr并不触发dbwr进程
2008-7-2 15:04
nganhong
LGWR 要執行寫動作時
會等待微秒 (應該不超過一秒)
若有太多的 commit 同時
它會一次把全部的 log record 寫下
是為 group commit
LGWR 只有一個
當進程 (process) 要把 redo record 要寫入 log buffer 時
必須要取得 redo allocation latch
redo allocation latch 只有一個 同一時間只能為一個進程所用
其目的為 告知進程 log buffer 的位置及大小空間 可以為它 (進程) 所用
之後
當進程要進行寫入 redo record 時,
還要取得 redo copy latch
redo copy latch 的數目取決於 CPU 的數量
它允許多個進程同時進行寫入 log buffer
詳情見 [url]http://www.ixora.com.au/tips/tuning/log_buffer_size.htm[/url]
dsi 也又有詳細的說明
[[i] 本帖最后由 nganhong 于 2008-7-2 15:23 编辑 [/i]]
2008-7-2 16:10
wsxinfor
group commit 会造成数据不一致吗?
如果是等待几毫秒lgwr,那么 commit 就是不触发lgwr写的条件了,我这样理解对吗?
2008-7-2 16:22
redpassion
redo的capacity主要取决于 redo IO
当用户提交一个commit时,会触发一个redo IO写请求,statistics(redo sync writes)加1
oracle会把这个IO请求放在一个队列中。
当IO系统空闲时,这个IO请求会被立刻处理,redo writes会加1
当IO系统忙时,这个IO会在队列中等待。等到IO空闲时,oracle会把队列中的所有请求一次处理(group commit),redo writes会加1。
group commit ratio = redo sync writes/redo writes, it can go as high as 20.
redo write time/sec 为redo IO忙的百分比。可以作为判断redo IO是否成为瓶颈的标志,由于10g中的parallel redo IO特性, 这个值可以超过1。
2008-7-2 16:47
wsxinfor
redo sync writes
redo writes
分别代表什么意思? 如何可以得到这些值呢?
发现Oracle的概念实在是太多了!
2008-7-2 17:08
nganhong
[b]Redo writes[/b] - Count of the total number of writes by LGWR to the redo log files.
[b]Redo synch writes [/b]- Usually, redo that is generated and copied into the log buffer need not be flushed out to disk immediately. The log buffer is a circular buffer that LGWR periodically flushes. Redo sync writes increments when changes being applied must be written out to disk due to a commit.
出處 - [url]http://www.wwf.co.itpub.net/post/5073/35049[/url]
2008-7-3 02:12
Yong Huang
[quote]原帖由 [i]wsxinfor[/i] 于 2008-7-2 02:47 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10832422&ptid=1015145][img]http://www.itpub.net/images/common/back.gif[/img][/url]
redo sync writes
redo writes
分别代表什么意思? 如何可以得到这些值呢?
发现Oracle的概念实在是太多了! [/quote]
Does this help?
[url]http://yong321.freeshell.org/oranotes/RedoWriteSyncWrite.txt[/url]
Basically, redo synch writes is *requests* sent to LGWR to write redo to logfiles, and redo writes is count of actual writes by LGWR.
Yong Huang
2008-7-3 02:16
Yong Huang
[quote]原帖由 [i]nganhong[/i] 于 2008-7-2 01:04 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10831251&ptid=1015145][img]http://www.itpub.net/images/common/back.gif[/img][/url]
LGWR 要執行寫動作時
會等待微秒 (應該不超過一秒)
[/quote]
Where do you see that wait for a microsecond rule?
There used to be a Metalink thread 194107.999, where the analyst quotes an Oracle kernel developer saying that LGWR waits 10 centiseconds after it's posted by the first commit, to see if there's another commit request coming in. If yes, they're combined into one.
But Jonathan Lewis questioned that claim saying it would be way too long. Now that thread is off from Metalink.
Yong Huang
页:
[1]

Powered by ITPUB论坛