In this video, we will explain about the Oracle Database Writer and describe its function as the background process responsible for writing data blocks from memory to disk
- [Narrator] So far, we've talked about the SGA and PGA parts of the Oracle instance. The SGA and PGA are areas in memory used for caching various types of database data as well as database metadata. In addition to caching, the Oracle Instance also contain what are know to be the Oracle background processes. These are a bunch of dedicated server-side processes running in the background. And similarly to the way that different components of the SGA cache different types of data, similarly, different Oracle background processes have different functions.
Functions such as writing database blocks to disk, writing redo entries to disk, making sure all of the database files on disk are synchronized, and others. The background processes perform maintenance tasks required to operate the database and maximize performance for multiple users. This is why each background process handles a different task. So, are you ready to get to know this background processes? If so, let's dive right in. Take it all in.
Lots of confusing acronyms I have placed on your screen, but don't worry it will all make sense in a moment. These are just the names of some of the most important Oracle background processes and the ones you should be familiar with. We will now describe each one of those background processes and the unique function that it serves inside the Oracle instance. Starting things off with the Oracle Database Writer process, or DBW for short. It actually says DBW and the letter N.
That's because we can start multiple Database Writer processes for performance reasons if required. So what does the Database Writer do? Well, the Database Writer is the process responsible for writing contents of the database buffers to data files on disk. Remember that changes to data are first done directly inside the Oracle instance, which is solely memory. Well, the Database Writer is the process that is responsible for making sure these in-memory changes done inside the buffer cache, will eventually be written to the database storage.
Although one Database Writer process is usually enough for most instances, we can configure additional processes to improve write performance if your system modifies data heavily. There are actually two triggers that will cause the Database Writer process to write data from memory to disk. These triggers are, first of all, when the buffer caches out of space, and one of the Oracle server processes, or SPs, tries to load new data into the buffer cache, you know, from disk.
This type of event will signal that Database Writer to write so it can free room for the new data. Once data has been cleared from the buffer cache, and room is available, the server processes can now load the new data into memory. The second reason which causes the Database Writer to write to disk is, well, normal database operations. The Database Writer periodically writes buffers from the buffer cache to disk. This is a routine process that runs in the background asynchronously.
The Database Writer also advances the database checkpoint as part of its process. What's a database checkpoint, you ask? Well, the database checkpoint is a mechanism used by Oracle to keep track of which of the transactions that have been committed still have blocks in memory, block which contain rows affected by those transactions, that have not yet been written to disk. Remember from our previous chapter, under Redo Log Buffer, when you use a committed transaction, the only synchronous operation that occurs at the moment of the commitment is flushing the Redo Log entries from memory to disk.
This is done to ensure the transaction can be recovered in case the database fails. The actual rows that were modified as part of the transaction may still reside in blocks that are in memory only, inside the buffer cache. The database checkpoint is a synchronization event that occurs at a specific point in time and causes some of those dirty blocks in the buffer cache to be written to disk. Yes, that's the term Oracle uses to describe these types of blocks which have been modified but not yet written to disk.
Dirty blocks. Once the Database Writer flushed blocks containing modified rows from memory to disk it will advance the database checkpoint to signify this event. And, as I've mentioned, the Database Writer does this on a regular basis.
After completing this course, you'll have fundamentals required for installation, configuration, and administration of an Oracle 12c database.
- Database instance and storage
- Instance memory pools
- Instance background processes
- Client connections
- Database storage file types
- Control files and backup files
- Multitenant databases
- Starting and stopping the database
- Installing Oracle 12c software
- Using the developer tools
- Database management