Home  >  Article  >  Database  >  Oracle commit详细用法

Oracle commit详细用法

WBOY
WBOYOriginal
2016-06-07 17:27:133354browse

commit工作过程 commit提交之前 Oracle在SGA撤销段缓冲区中生成撤销记录,撤销记录包含更新和删除表行的旧值 Oracle在SGA重做

commit工作过程

  • commit提交之前
  • Oracle在SGA撤销段缓冲区中生成撤销记录,撤销记录包含更新和删除表行的旧值
    Oracle在SGA重做日志缓冲区生成重做日志记录
    Oracle修改SGA数据库中的缓冲区

  • commit提交时
  • 重做记录中的事务被标记上为所提交事务的唯一scn

    日志写入程序将事务重做日志信息和事务scn,从重做日志缓冲区写到磁盘上的重做日志文件

    释放Oracle持有的锁,标记事务为完成

     

    commit参数

    commit_wait初始化参数

    commit_wait={nowait|wait|force_wait}

    Oracle默认是commit方式是wait

    作用:控制重做日志写入方式

    备注:nowait适用场景(a,有大量的事务redo,信息需要写入redo log;b,容忍部分数据丢失;c,等待LGWR写对运用程序来说不可以忍受)。

    force_wait:将会适用oracle默认方式提交

     

    commit_logging 初始化参数

    commit_logging={immediat|batch}

    immediat:LGWR将redo信息立即写入到重做日志文件

    batch:redo信息会被buffer,即redo不立即写入到重做日志文件

     

    commit用法

    commit

    commit write wait;

    commit write nowait

    commit write batch;

    commit write immediate;

     

    wait、nowait控制什么时候将redo信息写入到redo logs

    immediat 、batch控制redo信息以怎样的方式写入到redo logs

    备注:pl/sql默认方式batch nowait

    linux

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn