Background Processes and File Details
Background Processes and File Details
Memory structures:
System Global Area (SGA): Database buffer cache, redo buffer, and
various pools
Program Global Area (PGA)
Process structures:
User process and server process
Background processes: SMON, PMON, DBWn, CKPT, LGWR, ARCn, and so
on
Storage structures:
Logical: Database, schema, tablespace, segment, extent, and Oracle
block
Physical: Data files, control files, and redo log files
Oracle Background Process
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 system. Processes are jobs that work in the memory of these
computers.
Oracle creates a set of background processes for each instance. The background
processes consolidate functions that would otherwise be handled by multiple Oracle
programs running for each user process. They asynchronously perform I/O and monitor
other Oracle processes to provide increased parallelism for better performance and
reliability.
Although there is only one SMON and one PMON process running per
database instance, one can have multiple DBWR processes running at the same
time. An Oracle Instance can have to 20DBW processes to handle the I/O load to
multiple datafiles.
the number of DBWR processes running is set via the
DB_WRITER_PROCESSES
Writes modified (dirty) buffers in the database buffer cache to disk:
Periodically to advance the checkpoint
To free space in the buffer cache, the blocks written out are the least
recently used blocks.
DBWn
Server
Database
process
buffer
cache
DBWn
Database
Data files writer
process
3.LogWriter Process (LGWR)
Writes the redo log buffer to a redo log file on disk
Writes:
When a user process commits a transaction
When the redo log buffer is one-third full
Before a DBWn process writes modified buffers to the disk
Redo log buffer entries always contain the most up-to-date status of the database.
LGWR
Note LGWR is the only process that writes to the online redo log files
and the only one that directly reads the redo log buffer during normal
database operation.
4.Checkpoint Process (CKPT)
All modified information in the database buffer in the SGA is written to the
data files by a database write process (DBWR). This event indicates a
checkpoint.
Records checkpoint information in
Updates Each data file header whenever a checkpoint is performed
The checkpoint process is responsible for signaling DBWR at checkpoints
and updating all of the data files and control files of the database.
Checkpoint
process
Data files
5.System Monitor Process (SMON)
Maintain Overall health and safety for an oracle Instance.
This database background process performs instance recovery When
the instance is started after a failure.
SMON also cleans up unused temporary segments that are no
longer in use and recovers dead transactions skipped during crash and
instance recovery because of file-read or offline errors.
Clean up adjacent pieces of free space in the data files by merging
them in to one piece and gets rid of space used for sorting rows when
that space is no longer needed.
Instance
SMON
System Monitor
process
Temporary
segment
6.Process Monitor Process (PMON)
PMON User
Failed user
process
Process Monitor
process Database buffer
cache
7.Recoverer Process
Used with the distributed database configuration
Automatically connects to other databases involved in in-doubt
distributed transactions
Automatically resolves all in-doubt transactions
Removes any rows that correspond to in-doubt transactions
RECO
ARCn
Database
Segment
Extent
Oracle data
OS block
block
Tablespaces
Oracle stores data logically in Tablespaces and physically in Data files
Oracle Tablespaces consist of one or more data files.
Data files belong to only one tablespace.
Are further divided into logical units of storage
USERS tablespace
SYSTEM and SYSAUX Tablespaces
For an installation of Oracle 12c, a minimum of two tablespaces
are created: the SYSTEM tablespace and the SYSAUX tablespace;
A default installation of Oracle 12c creates six tablespaces.
The SYSTEM and SYSAUX tablespaces are mandatory
tablespaces that are created at the time of database creation.
They must be online.
The SYSTEM tablespace is used for core functionality (for
example, contains a data dictionary.
The auxiliary SYSAUX tablespace is used for additional
database components such as controlling the amount of Space
allocated to the User, separating the segments, ease space
administration and contains schemas.
Oracle Temporary Tablespace
A temporary tablespace, as its name implies, stores the
temporary data that only exists during the database session.
Oracle uses temporary tablespaces to improve the
concurrency of multiple sort operations that do not fit in
memory.
Oracle stores temporary tables, temporary indexes, and
temporary B-trees in temporary tablespaces.
Extents
The extent is the next level of logical grouping in the database. An extent consists
of one or more database blocks. When you enlarge a database object, the space
added to the object is allocated as an extent
Segments
A segment is a group of extents that form a database object that Oracle treats as a
unit, such as a table or index. As a result, this is typically the smallest unit of
storage that an end user of the database will deal with. Four types of segments are
found in an Oracle database: table segments (non-partitioned tables and each
partition of a partitioned table), index segments, temporary segments, and rollback
segments.
Data Segment- It is a storage Part
Index Segment- Its hold all of its data
Temporary Segment-It’s a temporary workspace
Undo Segment-to do a transaction undo
Alert Log File
The Alert log file is the chronological log of messages and errors
written out by an Oracle Database.
Typical messages found in this file is database startup, shutdown,
space errors, etc.
This file should constantly be monitored to detect unexpected
messages and corruptions.
Oracle will automatically create a new alert log file whenever the
old one is deleted.
.
Oracle Managed Files