I. Structure of the database
Second, Oracle memory structure
III. structure of the process
1. User process: Start when the database user requests to connect to the Oracle server
2. Server process: You can connect to an Oracle instance, which starts when a user establishes a session
3. Background process: Start the Oracle instance again
Iv. Oracle Instance Management
1. System Monitor (Smon): Perform crash recovery task when starting instance after failure
2. Process Monitor (Pmon): Perform process cleanup tasks when a user process fails
3. Database write Process (DBWN): Writes the modified block from the database buffer cache to the data file on the disk
4. Checkpoint (CKPT): Indicates the latest checkpoint by updating all data files and control files in the database
5. Log write Process (LGWR): Write redo log entries to disk
6. Archive process (ARCn): Copy redo log files to archive storage when log switching occurs
V. Server processes and database buffer caching
When a query is processed, the Oracle server process looks for all the data blocks it needs in the database buffer cache. If a block of data is not found in the database cache cache, the server process reads the data block from the data file and adds a copy to the database cache cache. Because subsequent requests for the same block of data may find the block in memory, these requests may not require physical read operations. Oracle servers use recently used algorithms to free up recently inaccessible buffers to provide space for new blocks of data in the database buffer cache.
Buffers in the buffer cache may be in one of four states:
① connected: Prevents multiple sessions from writing to the same data block at the same time. At this point, another session is waiting to access the block.
② Clean: The buffer is now disconnected, and if the current content (data block) is not referenced again, the buffer is a candidate that can be freed immediately. At this point, the content that is not a buffer is synchronized with the contents of the block of data stored on the disk, which is a consistent read (CR) snapshot of the buffer containing the block.
③ idle or unused: instance just started, buffer is empty. This state is very similar to the "clean" state, except that the buffer is not in use.
④ Gray data: The buffer is no longer connected, but the content (data block) has changed, DBWN must first flush the content to disk before freeing up the buffer.