非同步提交
The default behavior. is for LGWR to write redo to the online redo log synchronously
and for transactions to wait for the buffered redo to be on disk before returning a
commit to the user. However, for lower transaction commit latency, application
developers can specify that redo be written asynchronously so that transactions need
not wait for the redo to be on disk and can return from the COMMIT call immediately.
預設的lgwr寫是同步方式,事務等待redo buffer的資訊寫到磁碟才返回commit完成 ,這可能會造成commit效能低。
應用開發者可以指定非同步寫redo,這樣事務不必須等待redo寫到磁碟。
If you specify only COMMIT, then the default is COMMIT WORK WRITE WAIT IMMEDIATE.
如果只指定commit,預設使用的是 commit work write wait immediate
WORK
The WORK keyword is supported for compliance with standard SQL. The statements COMMIT and COMMIT WORK are equivalent.
work關鍵字是為了支援標準sql,commit 和 commit work是等價的
COMMENT Clause
This clause is supported for backward compatibility. Oracle recommends that you used named transactions instead of commit comments.
為了向後相容性,oracle建議使用命名的事務替代commit comment
WAIT | NOWAIT
Use these clauses to specify when control returns to the user.
使用這個子句控制什麼時候返回給使用者
The WAIT parameter ensures that the commit will return only after the corresponding redo is persistent in the online redo log. Whether in BATCH or IMMEDIATE mode, when the client receives a successful return from this COMMIT statement, the transaction has been committed to durable media. A crash occurring after a successful write to the log can prevent the success message from returning to the client. In this case the client cannot tell whether or not the transaction committed.
用wait時,寫到磁碟之後,才會返回給使用者
The NOWAIT parameter causes the commit to return to the client whether or not the write to the redo log has completed. This behavior. can increase transaction throughput. With the WAIT parameter, if the commit message is received, then you can be sure that no data has been lost.
用nowait時,無論是否已經寫入到磁碟到,都會返回給使用者,增加了事務的吞吐量
IMMEDIATE | BATCH
Use these clauses to specify when the redo is written to the log.
使用這個子句指定什麼時候寫到log檔案
The IMMEDIATE parameter causes the log writer process (LGWR) to write the transaction's redo information to the log. This operation option forces a disk I/O, so it can reduce transaction throughput.
使用immediate引數立即寫到線上日誌檔案,這個選項一定會有io產生,所以減少了事務的吞吐量
The BATCH parameter causes the redo to be buffered to the redo log, along with other concurrently executing transactions. When sufficient redo information is collected, a disk write of the redo log is initiated. This behavior. is called "group commit", as redo for multiple transactions is written to the log in a single I/O operation.
batch引數可以批量提交redo資訊到線上日誌檔案
如果您資料庫預設使用某種特定的提交行為,則可以執行以下語句。
ALTER SYSTEM SET COMMIT_WRITE = NOWAIT;
此命令將使資料庫預設使用這一行為。您還可以使其成為會話級預設行為:
ALTER SESSION SET COMMIT_WORK = NOWAIT;
注:不是預設方式的話有可能會丟失資料
by song
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25099483/viewspace-772646/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 同步非同步,阻塞非阻塞非同步
- 非同步、同步、阻塞、非阻塞非同步
- 同步、非同步、阻塞、非阻塞非同步
- 同步非同步 與 阻塞非阻塞非同步
- 理解阻塞、非阻塞、同步、非同步非同步
- 同步、非同步,阻塞、非阻塞理解非同步
- 同步、非同步、阻塞與非阻塞非同步
- 同步、非同步、阻塞和非阻塞非同步
- commit 的非同步提交MIT非同步
- 非同步提交(Asynchronous COMMIT)非同步MIT
- [轉]阻塞/非阻塞與同步/非同步非同步
- 同步與非同步 阻塞與非阻塞非同步
- java同步非阻塞IOJava
- 非同步和非阻塞非同步
- 同步、非同步、阻塞、非阻塞的區別非同步
- 徹底搞懂同步非同步與阻塞非阻塞非同步
- IO - 同步 非同步 阻塞 非阻塞的區別非同步
- 同步、非同步、阻塞、非阻塞的簡單理解非同步
- 同步與非同步、阻塞與非阻塞的理解非同步
- 同步阻塞、同步非阻塞、多路複用的介紹
- 大白話搞懂什麼是同步/非同步/阻塞/非阻塞非同步
- socket阻塞與非阻塞,同步與非同步、I/O模型非同步模型
- 網路IO之阻塞、非阻塞、同步、非同步總結非同步
- Java 非阻塞 IO 和非同步 IOJava非同步
- 真正的 Tornado 非同步非阻塞非同步
- tornado非同步請求非阻塞非同步
- 怎樣理解阻塞非阻塞與同步非同步的區別?非同步
- 一篇文章讀懂阻塞,非阻塞,同步,非同步非同步
- ♻️同步和非同步;並行和併發;阻塞和非阻塞非同步並行
- 程式執行緒、同步非同步、阻塞非阻塞、併發並行執行緒非同步並行
- 聊聊執行緒與程式 & 阻塞與非阻塞 & 同步與非同步執行緒非同步
- 從同步原語看非阻塞同步以及Java中的應用Java
- 對於同步、非同步、阻塞、非阻塞的幾點淺薄理解非同步
- 併發-0-同步/非同步/阻塞/非阻塞/程式/執行緒非同步執行緒
- 如何解讀 Java IO、NIO 中的同步阻塞與同步非阻塞?Java
- Socket程式設計中的同步、非同步、阻塞和非阻塞(轉)程式設計非同步
- 【OS】同步非同步/阻塞非阻塞、併發並行序列的區分非同步並行
- 對執行緒、協程和同步非同步、阻塞非阻塞的理解執行緒非同步