Oracle的非同步commit設定
In Oracle 10gR2, you can now choose to break this fourth property. Oracle's new asynchronous commit feature essentially allows you to trade durability for speed on a transaction-by-transaction basis. You can choose to break ACID compliance in this way by default, at the instance level; or you can choose to break it at the individual transaction level.
By default, Oracle's commits are durable. Oracle writes your changes to disk and doesn't return control of the session to you until it's done. The normal commit process is as follows:
- User begins transaction.
- While user is issuing DML, Oracle generates redo entries corresponding to the data changes. These redo entries are buffered in memory while the transaction is occurring.
- When the user issues a COMMIT, Oracle immediately writes this buffered redo to disk, along with redo for the commit. Ie, a disk I/O is forced.
- Oracle does not return from the commit until the redo has been completely written to disk (to the online redo log).
There are two important aspects to note here: the redo information is written to disk immediately, and the session waits for the process to complete before returning.
Oracle now lets you change both of these aspects. You can let the log writer write the redo information to disk in its own time, instead of immediately; and you can have the commit return to you before it's completed, instead of waiting.
Default COMMIT behavior | New option | ||
IMMEDIATE | The redo information is written to disk immediately (forcing a disk I/O for each commit). | BATCH | Oracle buffers the redo information. The log writer will write this redo information to disk, but in its own time. Thus, several I/Os can be "batched". |
WAIT | Oracle does not return from the commit until the commit has completed successfully. | NOWAIT | Oracle doesn't wait for the commit to complete, but returns right away. |
You can change Oracle's commit behavior at the statement level by simply specifying one or both of the new options above with your commit. Use the new WRITE clause of the commit statement for this purpose. For example:
COMMIT WRITE BATCH NOWAIT ;
will commit your transaction without forcing a disk I/O, and will return control to you without waiting for the commit operation to complete.
The full syntax of the new WRITE clause is:
COMMIT [WRITE [IMMEDIATE | BATCH] [WAIT | NOWAIT] ]
By default, if no WRITE clause is specified, a naked COMMIT is equivalent to
COMMIT WRITE IMMEDIATE WAIT;
You can even change the default behaviour of COMMIT at the instance level, so that the default behaviour of a naked COMMIT statement is not COMMIT WRITE IMMEDIATE WAIT. A new initialization parameter, COMMIT_WRITE, lets you set default commit immediacy to IMMEDIATE or BATCH, and default commit wait to WAIT or NOWAIT:
COMMIT_WRITE='{ IMMEDIATE | BATCH } , { WAIT | NOWAIT }'
修改引數的命令:
alter system set commit_write=batch,nowait scope=both;
在oracle 11g中該引數被標誌為遺棄,由兩個引數取代:
commit_logging和commit_wait
可以使用
alter system set commit_logging=batch scope=both;
alter system set commit_wait=nowait scope=both;
得到同樣的效果
[@more@]oracle 非同步 commit commit_write commit_logging commit_wait
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26651/viewspace-1040528/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle rac中設定時間同步Oracle
- commit 的非同步提交MIT非同步
- Oracle歸檔模式與非歸檔模式設定Oracle模式
- Oracle DML(非select) 操作不commit 對select的影響OracleMIT
- Oracle的奇葩設定之非歸檔模式與RMAN備份Oracle模式
- Socket程式設計中的同步、非同步、阻塞和非阻塞(轉)程式設計非同步
- 非同步提交(Asynchronous COMMIT)非同步MIT
- zotero的同步設定問題
- git專案之間的commit同步GitMIT
- 同步、非同步、阻塞、非阻塞的區別非同步
- 同步非同步,阻塞非阻塞非同步
- 非同步、同步、阻塞、非阻塞非同步
- 同步、非同步、阻塞、非阻塞非同步
- mysql半同步複製的設定MySql
- 設定ARC工程相容非ARC
- IO - 同步 非同步 阻塞 非阻塞的區別非同步
- 同步、非同步、阻塞、非阻塞的簡單理解非同步
- 同步與非同步、阻塞與非阻塞的理解非同步
- 如何設定tomcat的非debug模式?Tomcat模式
- 同步非同步 與 阻塞非阻塞非同步
- 理解阻塞、非阻塞、同步、非同步非同步
- 同步、非同步,阻塞、非阻塞理解非同步
- 同步、非同步、阻塞與非阻塞非同步
- 同步、非同步、阻塞和非阻塞非同步
- [譯] 非同步程式設計:阻塞與非阻塞非同步程式設計
- Oracle的commit做了什麼?OracleMIT
- Ubuntu的NTP同步時鐘設定方法Ubuntu
- 同步阻塞、同步非阻塞、多路複用的介紹
- win10怎麼用同步設定_windows10系統如何同步設定Win10Windows
- [轉]阻塞/非阻塞與同步/非同步非同步
- 同步與非同步 阻塞與非阻塞非同步
- oracle之commit控制OracleMIT
- 關於oracle commitOracleMIT
- mysql同步一張表設定MySql
- 設定 MySql 資料同步(轉)MySql
- MySQL半同步複製--after_commitMySqlMIT
- $.post 和 $.get 設定同步和非同步請求非同步
- JMeter定時器設定延遲與同步JMeter定時器