Each running Oracle database is associated with an Oracle instance. When a database is started on a database server, the Oracle software allocates a shared memory area called the System Global Area (SGA) and starts several Oracle background processes. This combination of the SGA and the Oracle processes is called an Oracle instance.After starting an instance, the Oracle software associates the instance with a specific database. This is called mounting the database. The database is then ready to be opened, which makes it accessible to authorized users. Multiple instances can execute concurrently on the same computer, each accessing its own physical database.You can look at the Oracle database architecture as various interrelated structural components.An Oracle database uses memory structures and processes to manage and access the database. All memory structures exist in the main memory of the computers that constitute the database server. Processes are jobs that work in the memory of these computers. A process is defined as a “thread of control” or a mechanism in an operating system that can run a series of steps.
The basic memory structures associated with an Oracle instance include the following:
- System Global Area (SGA): Shared by all server and background processes
- Program Global Area (PGA): Private to each server and background process. There is one PGA for each process.
The SGA is a memory area that contains data and control information for the instance.
The SGA includes the following data structures:
- Database buffer cache: Caches blocks of data retrieved from the database
- Redo log buffer: Caches redo information (used for instance recovery) until it can be written to the physical redo log files stored on the disk
- Shared pool: Caches various constructs that can be shared among users
- Large pool: Is an optional area that provides large memory allocations for certain large processes, such as Oracle backup and recovery operations, and I/O server processes
- Java pool: Is used for all session-specific Java code and data within the Java Virtual Machine (JVM)
- Streams pool: Is used by Oracle Streams
When you start the instance by using Enterprise Manager or SQL*Plus, the amount of memory allocated for the SGA is displayed.
A Program Global Area (PGA) is a memory region that contains data and control information for each server process. An Oracle server process services a client’s requests. Each server process has its own private PGA that is created when the server process is started. Access to the PGA is exclusive to that server process, and the PGA is read and written only by the Oracle code acting on its behalf.
With the dynamic SGA infrastructure, the size of the database buffer cache, the shared pool, the large pool, the Java pool, and the Streams pool changes without shutting down the instance.
The Oracle database uses initialization parameters to create and configure memory structures. For example, the SGA_TARGET parameter specifies the total size of the SGA. If you set SGA_TARGET to 0, Automatic Shared Memory Management is disabled.
When you invoke an application program or an Oracle tool, such as Enterprise Manager, the Oracle server creates a server process to execute the commands issued by the application. The Oracle server also creates a set of background processes for an instance that interact with each other and with the operating system to manage the memory structures, asynchronously perform I/O to write data to disk, and perform other required tasks. Which background processes are present depends on the features that are being used in the database.
- System Monitor (SMON): Performs crash recovery when the instance is started following a failure
- Process Monitor (PMON): Performs process cleanup when a user process fails
- Database Writer (DBWn): Writes modified blocks from the database buffer cache to the data files on the disk
- Checkpoint (CKPT): Updates all the data files and control files of the database to indicate the most recent checkpoint
- LogWriter (LGWR): Writes redo log entries to the disk
- Archiver (ARCn): Copies redo log files to the archival storage when a log switch occurs