In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the arrangement of knowledge points in oracle affairs". In the daily operation, I believe that many people have doubts about the arrangement of knowledge points in oracle affairs. The editor has consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "arrangement of knowledge points in oracle affairs"! Next, please follow the editor to study!
DML statement flow
1 get transaction lock and ITL
2 Lock candidate rows
3 generate redo
4 generate undo
5 generate redo record to write to log buffer and change data block
Transaction commit
1 assign SCN
2 update the transaction table and change the transaction slot status to 0x09
3 Recycling undo blocks
4 create commit redo record
5 refresh redo from log buffer
6 release table lock and row lock
Lock
A transaction consists of 1 TX and several TM, while rolling back the savepoint does not release the TX lock
ITL points to the transaction slot through XID, which in turn points to the undo record, and its UBA also points to the undo record
The difference between the two is that the transaction slot points to the starting position of the undo chain, while the UBA points to the last change of the transaction
Undo chain: the undo record of the same transaction forms an one-way linked list, and the newly generated one is inserted into the queue head.
A undo block can only be used by 1 transaction
Construct CR block
Session A DML the block has not been submitted. Session B will detect an open ITL when reading the block at this time. Check the transaction table of the rollback segment header and find that the status is active, then you need to construct a CR block.
Clone the current block and undo its most recent operation by rolling back the segment header and the rollback block
You can view buffer status through x$bh.state
0 FREE no valid block image
1 XCUR a current mode block, exclusive to this instance
2 SCUR a current mode block, shared with other instances
3 CR a consistent read (stale) block image
4 READ buffer is reserved for a block being read from disk
5 MREC a block in media recovery mode
6 IREC a block in instance (crash) recovery mode
Delayed block cleanup
When a transaction is committed, it is only guaranteed to change the transaction slot status to inactive. If the block is no longer in buffer, the ITL is still open.
Next time, update the flag and Commit SCN of ITL according to the transaction slot information, and release the row lock and fsc (free space credit), during which redo will be generated
There are two exceptions:
1 transaction table slot has been reused, that is, wrap# > XID.wrap#, uses the CSCN of the rollback segment header as the upper bound SCN
2 if the rollback segment has been deleted, it will be updated with SCN in undo$ (flag of ITL is CU--)
Http://www.laoxiong.net/about-block-delay-cleanout-and-consistent-reads.html
Fast block cleanup
The block is still in memory at the time of submission, and the commit SCN (lock flag is not updated) and flag (- flag -) of its ITL are updated, and the blocks involved are up to 10% of buffer cache.
If the block has been synchronized to disk, that is, the status is clean, this operation will make it need to be refreshed again for dirty.
The next time the block is read, the ITL will be closed by checking the transaction slot to confirm that it has been committed. If the corresponding rollback segment has been deleted, look for the SCN record in undo$.
Transaction recovery
1 rollback
Reverse scan all undo records (latest first) and apply them in turn, and ITL will be updated accordingly
2 process crash
PMON is responsible for recovery; it can be viewed through the 10012 event.
3 Database crash
SMON is responsible for recovery. When starting again, priority is given to restoring transactions of system rollback segments. Set other rollback segment transactions to DEAD first, then scan these rollback segments again after database OPEN and perform rollback.
The dead transaction and the cflags=0x10 of its transaction slot can be queried through xsimplktuxe.ktuxecflags
10013 events track transaction recovery at database startup; 10015 rollback segment headers before and after dump transaction recovery
10153 it is forbidden to roll back dead transactions when the block is started
Implied parameter
_ offline_rollback_segments & _ corruupted_rollback_segments
The specified rollback segment will not be scanned when the database starts, and the active transactions it contains will not be rolled back.
If a block contains open ITL pointing to _ offline rollback segment, the transaction table will be accessed when the block is re-read. If the transaction has been committed, block cleanup will be performed. If active can only construct CR blocks.
At this point, the study of "sorting out the knowledge points of oracle affairs" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.