[Oracle]-[LRU and DBWR]-LRU algorithm and Applications in DBWR the Oracle architecture often see LRU algorithm, Least Recently Used, this is also called the "least recently used page replacement algorithm". In short, Oracle will remove databases that are not used in memory recently from the memory to free up space for loading additional data. Although the implementation of algorithms cannot be obtained, it is not necessary for many of us to understand them. It is more important to know its role and analyze and judge some problems based on it. There is an ideal Calculation for this algorithm, that is, each swap out of the memory will be used at the latest in all memory, and the swap can be postponed to the maximum extent, however, this algorithm is ideal for memory replacement and cannot be implemented. In order to reduce the gap with the ideal algorithm, various exquisite algorithms have emerged. LRU is one of them.
It is based on: the data in the previous memory is likely to be frequently used later. In other words, the data in the memory that has been useless for a long time may not be used in the future, this is a well-known principle of locality. It runs based on the same principle and is faster than the memory speed. Therefore, we only need to find the least recently used memory data to call up the memory every time we change the memory, which is the content of the LRU algorithm. As mentioned in some books, "If the database is transferred by air, eventually DBWR will write all the buffer areas to the disk", DBWR will write the dirty buffer to the disk, using the LRU algorithm, as described above, based on several conditions triggered by DBWR, And the LRU algorithm, DBWR will write all buffer caches to the disk.