C H A P T E R  5

Caches and Copies

Caching means keeping copies of things that we expect to use soon, and keeping them close by so that we can access them quickly. Chapter 2 described how Oracle changes various types of data blocks (including undo blocks) and showed you a few of the structures that you can see stored in blocks, but it didn’t say anything about how Oracle manages to keep a selection of recently used or popular blocks in memory. Chapter 2 simply assumed that whenever we needed a block, the correct version of that block would be available.

In Chapter 4, you saw a simplified diagram of the library cache and learned how you can use hash chains (or buckets) to ensure that you can find an object quickly, provided that you can work out a sensible way of turning an object’s identity into a “magic number” that you can use as the number of the bucket it belongs to.

In this chapter, you will see how this pattern echoes through the structures in the data cache as Oracle copies data blocks into memory, accesses those blocks rapidly when it needs them, and juggles multiple copies of the same block as the data is changed by multiple concurrent processes.

Before we get down to blocks and buffers, though, we’ll take a look at the large-scale structures, starting with granules and then considering how granules are linked to create buffer pools.

Following a brief discussion on the different buffer pools we can create—and why we might not want to create them—we’ll start to slice the buffer pools into the working data sets that Oracle uses to handle the problems of freeing buffers for reuse and reading data into memory.

Working data sets give us only one of the chains running through the buffer cache, though, and don’t give us a method for finding specific data blocks quickly, so we will also spend time looking at the much shorter hash chains that Oracle uses in its strategy for locating data in memory quickly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.195.162