You are on page 1of 9

Oracle DBA 11gR2 Architecture

 System Global Area


 A System Global Area (SGA) is a group of shared memory structures
that contain data and control information for one Oracle database
instance. If multiple users are concurrently connected to the same
instance, then the data in the instance's SGA is shared among the
users. Consequently, the SGA is sometimes called the shared global
area.
 Database Buffer Cache  The database buffer cache is the portion of
the SGA that holds copies of data blocks read from datafiles. All user
processes concurrently connected to the instance share access to the
database buffer cache.
 Redo Log Buffer  The redo log buffer is a circular buffer in the SGA
that holds information about changes made to the database. This
information is stored in redo entries. Redo entries contain the
information necessary to reconstruct, or redo, changes made to the
database by INSERT, UPDATE, DELETE, CREATE, ALTER,
or DROP operations. Redo entries are used for database recovery, if
necessary.
Oracle DBA 11gR2 Architecture
 System Global Area
 Shared Pool  The shared pool portion of the SGA contains the library cache, the
dictionary cache, buffers for parallel execution messages, and control structures.
 Library Cache  The library cache includes the shared SQL areas, private SQL areas (in
the case of a shared server configuration), PL/SQL procedures and packages, and control
structures such as locks and library cache handles.
 Data Dictionary Cache  The data dictionary is a collection of database tables and
views containing reference information about the database, its structures, and its users.
Oracle accesses the data dictionary frequently during SQL statement parsing. This access
is essential to the continuing operation of Oracle.

 Stream Pool  In a single database, you can specify that Streams memory be allocated
from a pool in the SGA called the Streams pool. To configure the Streams pool, specify
the size of the pool in bytes using the STREAMS_POOL_SIZE initialization parameter. If
a Streams pool is not defined, then one is created automatically when Streams is first
used.
 Java Pool Java pool memory is used in server memory for all session-specific Java code
and data within the JVM. Java pool memory is used in different ways, depending on what
mode the Oracle server is running in.
 Fixed SGA The fixed SGA contains a set of variables that point to the other
components of the SGA and variables that contain the values of various parameters. The
size of the fixed SGA is something over which we have no control and it is generally very
small.
Oracle DBA 11gR2 Architecture
 Background Processes
 Background processes are used to perform various tasks within the RDBMS system.
These tasks vary from communicating with other Oracle instances and performing
system maintenance and cleanup to writing dirty blocks to disk. Following are brief
descriptions of the nine Oracle background processes:
 DBWR (Database Writer)--DBWR is responsible for writing dirty data blocks from the
database block buffers to disk.
 LGWR (Log Writer)--The LGWR process is responsible for writing data from the log
buffer to the redo log.
 CKPT (Checkpoint)--The CKPT process is responsible for signaling the DBWR process
to perform a checkpoint and to update all the datafiles and control files for the database
to indicate the most recent checkpoint. A checkpoint is an event in which all modified
database buffers are written to the datafiles by the DBWR. The CKPT process is optional.
If the CKPT process is not present, the LGWR assumes these responsibilities.
 PMON (Process Monitor)--PMON is responsible for keeping track of database
processes and cleaning up if a process prematurely dies (PMON cleans up the cache and
frees resources that might still be allocated). PMON is also responsible for restarting any
dispatcher processes that might have failed.
 SMON (System Monitor)--SMON performs instance recovery at instance startup. This
includes cleaning temporary segments and recovering transactions that have died
because of a system crash. The SMON also defragments the database by coalescing free
extents within the database.
Oracle DBA 11gR2 Architecture
 Background Processes
 RECO (Recovery)--RECO is used to clean transactions that were pending in a
distributed database. RECO is responsible for committing or rolling back the
local portion of the disputed transactions.
 ARCH (Archiver)--ARCH is responsible for copying the online redo log files to
archival storage when they become full. ARCH is active only when the RDBMS
is operated in ARCHIVELOG mode. When a system is not operated
in ARCHIVELOG mode, it might not be possible to recover after a system
failure. It is possible to run in NOARCHIVELOG mode under certain
circumstances, but typically should operate in ARCHIVELOG mode.
 MMAN (Memory Manager)--is used for internal database tasks that manage
the automatic shared memory. MMAN serves as the SGA Memory Broker and
coordinates the sizing of the memory components
 MMON (Memory Monitor)--The Oracle 10g background process to collect
statistics for the Automatic Workload Repository (AWR).
 MMNL (MMON Lite) is a background process that assists the MMON process.
This process will flush the ASH buffer to AWR tables when the buffer is full or a
snapshot is taken.
Oracle DBA 11gR2 Architecture
 PGA (Program Global Area)
 A Program Global Area (PGA) is a memory area used by a single Oracle
Database server process. When you connect to an Oracle database instance,
you create a session that uses a server process for communication between the
client and database instance. Each server process has its own PGA.

 User Session
 A User Session is a specific connection of a user to an Oracle instance through
a user process. when a user starts SQL*Plus, the user must provide a valid
username and password, and then a session is established for that user. A
session lasts from the time the user connects until the time the user
disconnects or exits the database application

 (SP) Server Process


 Server processes communicate with the user and interact with Oracle to carry
out the user's requests. If the user process requests a piece of data not already
in the SGA, the shadow process is responsible for reading the data blocks from
the datafiles into the SGA.
Oracle DBA 11gR2 Architecture
 how sql statement procees in oracle. These are the
statement which we are going to run.
 Sqlplus scott/tiger@prod
 SQL>select * from emp;
 SQL>update emp set salary=30000 where empid=10;
 SQL>commit;
 So we will understand what is happening internaly
Oracle DBA 11gR2 Architecture
1. Once we hit sqlplus statement as above client process(user) access sqlnet listener.
2. Sql net listener confirms that DB is open for buisness & create server process.
3. Server process allocates PGA.
4. ‘Connected’ Message returned to user.
5. SQL>select * from emp;
6. Server process checks the SGA to see if data is already in buffer cache.
7. If not then data is retrived from disk and copied into SGA (DB Cache).
8. Data is returned to user via PGA & server process.
9. Now another statement is SQL>Update emp set salary=30000 where empid=10;
10. Server process (Via PGA) checks SGA to see if data is already there in buffer cache.
11. In our situation chances are the data is still in the SGA (DB Cache).
12. Data updated in DB cache and mark as ‘Dirty Buffer’.
13. Update employee placed into redo buffer.
14. Row updated message returned to user
15. SQL>commit;
16. Newest SCN obtained from control file.
17. Data in DB cache is marked as ‘Updated and ready for saving’.
18. commit palced into redo buffer.
19. LGWR writes redo buffer contents to redo log files & remove from redo buffer.
20. Control file is updated with new SCN.
21. Commit complete message return to user.
22. Update emp table in datafile & update header of datafile with latest SCN.
23. SQL>exit;
24. Unsaved changes are rolled back.
25. Server process deallocates PGA.
26. Server process terminates.
27. After some period of time redo log are archived by ARCH process.
Oracle DBA 12C Architecture

You might also like