Perform Oracle operations with DML in the following internal order:
1. The corresponding transaction is allocated a rollback segment (undo segment ).
2. After a rollback segment is allocated, create the transaction table slot (transaction table slot) on the rollback segment header ).
3. After the transaction table is created, TXID (TransactionID) is generated, and then TXID is allocated to the current transaction. This value points to the exact location of the transaction table that exists in the rollback segment of the transaction.
4. The data block of the transaction object is loaded into the high-speed buffer, and transaction entries are registered on the ITL (Intersted transaction list) block header.
If there is no required space on the itl, it will wait for enq: TX-allocate ITL entry.
5. Store the modification information of the block to be modified to PGA. The storage method is change vector. Then, the process copies the change vector in PGA to the redo record to the redo buffer.
6. Record the previous image information to the Undo block, modify the data block, and change the modified data block to a dirty state. In addition, the CR block of the data block to be modified is created in the high-speed buffer.
7. Execute commit and allocate SCN to the transaction. commit information is stored in the redo buffer.
8. The transaction table of the rollback segment header stores information that has been successfully submitted and ends possession of all resources including the TX lock.
9. Redo buffer content is recorded in the redo log file.
The following describes the process through dump:
- Session 1
- SQL>Update emp setSal=Sal+ 100 whereRownum=1;
- 1 rows updated.
- Obtain the position of the row where update has been executed.
- SQL>Select rowid, dbms_rowid.rowid_relative_fno (rowid) as fno,
- 2 dbms_rowid.rowid_block_number (rowid) as blkno
- 3 from emp whereRownum=1;
- ROWID FNO BLKNO
- --------------------------------------
- AAAQ + LAAEAAAAAfAAA 4 31
- The file number is 4, the block number is 31, and the dump block.
- SQL>Alter system dump datafile 4 block 31;
- System altered.
- SQL>L
- 1 SELECT a. VALUE
- 2 | B. symbol
- 3 | c. instance_name
- 4 | '_ ora _'
- 5 | d. spid
- 6 | '. trc' trace_file
- 7 FROM (SELECT VALUE
- 8 FROM v $ parameter
- 9 WHERENAME='User _ dump_dest'),
- 10 (select substr (VALUE,-6, 1) symbol
- 11 FROM v $ parameter
- 12 WHERENAME='User _ dump_dest') B,
- 13 (SELECT instance_name
- 14 FROM v $ instance) c,
- 15 (SELECT spid
- 16 FROM v $ session s, v $ process p, v $ mystat m
- 17 * WHERES. paddr=P. Addr ANDS. SID=M. Sid and m. statistic # = 0) d
- SQL>/
- TRACE_FILE
- --------------------------------------------------------------------
- /Opt/app/oracle/diag/rdbms/liqian/trace/liqian_ora_4118.trc