Home  >  Article  >  Database  >  DML操作Oracle在内部实现

DML操作Oracle在内部实现

WBOY
WBOYOriginal
2016-06-07 17:13:35908browse

DML操作Oracle在内部实现,对与DML操作oracle在内部按如下顺序执行:

对与DML操作Oracle在内部按如下顺序执行:
1,相应事务分配回滚段(undo segment).
2,分配回滚段后,在回滚段头上创建事务表slot(transaction table slot).
3.创建事务表后会生出TXID(TransactionID),再将TXID分配给当前事务。这个值指向分给事务的回滚段头上存在的事务表的准确位置。
4.事务对象的数据块载入到高速缓冲区,在块头的ITL(Intersted transaction list)上登记事务条目。
如果itl上没有所需空间,就会发生等待enq:TX-allocate ITL entry。
5.将需要修改的块的修改信息存储到PGA,存储的方式是change vector,,之后进程将PGA中的change vector以redo record复制到重做缓冲区。
6.将之前映像信息记录到撤销块,继而修改数据块,被修改的数据块变为脏状态。而且在高速缓冲区中创建以修改的数据块的CR块。
7.执行commit后给事务分配SCN,提交信息存储在重做缓冲区。
8.回滚段头的事务表中存储已成功提交的信息,结束包括TX锁在内的所有资源占有。
9.重做缓冲区的内容记录在重做日志文件上。
下面通过转储来探究一下这个过程:

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