Internal Implementation of DML Oracle operations

Source: Internet
Author: User

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:

  1. Session 1
  2. SQL>Update emp setSal=Sal+ 100 whereRownum=1;
  3. 1 rows updated.
  4. Obtain the position of the row where update has been executed.
  5. SQL>Select rowid, dbms_rowid.rowid_relative_fno (rowid) as fno,
  6. 2 dbms_rowid.rowid_block_number (rowid) as blkno
  7. 3 from emp whereRownum=1;
  8. ROWID FNO BLKNO
  9. --------------------------------------
  10. AAAQ + LAAEAAAAAfAAA 4 31
  11. The file number is 4, the block number is 31, and the dump block.
  12. SQL>Alter system dump datafile 4 block 31;
  13. System altered.
  14. SQL>L
  15. 1 SELECT a. VALUE
  16. 2 | B. symbol
  17. 3 | c. instance_name
  18. 4 | '_ ora _'
  19. 5 | d. spid
  20. 6 | '. trc' trace_file
  21. 7 FROM (SELECT VALUE
  22. 8 FROM v $ parameter
  23. 9 WHERENAME='User _ dump_dest'),
  24. 10 (select substr (VALUE,-6, 1) symbol
  25. 11 FROM v $ parameter
  26. 12 WHERENAME='User _ dump_dest') B,
  27. 13 (SELECT instance_name
  28. 14 FROM v $ instance) c,
  29. 15 (SELECT spid
  30. 16 FROM v $ session s, v $ process p, v $ mystat m
  31. 17 * WHERES. paddr=P. Addr ANDS. SID=M. Sid and m. statistic # = 0) d
  32. SQL>/
  33. TRACE_FILE
  34. --------------------------------------------------------------------
  35. /Opt/app/oracle/diag/rdbms/liqian/trace/liqian_ora_4118.trc
  • 1
  • 2
  • 3
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.