0% found this document useful (0 votes)
17 views

Background Processes and File Details

The document discusses the key components of Oracle database architecture including memory structures, process structures, storage structures, and background processes. It provides details on the roles and functions of various background processes like SMON, PMON, DBWR, LGWR, CKPT, ARCn, and recoverer process.

Uploaded by

iqra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Background Processes and File Details

The document discusses the key components of Oracle database architecture including memory structures, process structures, storage structures, and background processes. It provides details on the roles and functions of various background processes like SMON, PMON, DBWR, LGWR, CKPT, ARCn, and recoverer process.

Uploaded by

iqra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Database Administration and Management

Instructor: Iqra Saher


Database Architecture:
Summary of Structural Components

 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.

1. Job queue processes


 are used for batch processing.
 They run user jobs.
 They can be viewed as a scheduler service that can be used to schedule jobs as PL/SQL
statements or procedures on an Oracle instance.
 Given a start date and an interval, the job queue processes try to run the job at the next
occurrence of the interval.
2.Database Writer Process (DBWn)

 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

Database buffer Database writer Data files


cache process
Server Process and Database
Buffer Cache
SGA

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

Redo log buffer LogWriter process Redo log files

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.

CKPT Control file

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)

 Performs process recovery when a user process fails


 Cleans up the database buffer cache
 Frees resources that are used by the user process
 Monitors sessions for idle session timeout
 Dynamically registers database services with listeners

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

Recoverer process In-doubt transaction


in database A in database B

The recover process automatically cleans up


failed or suspended distributed transactions.
8.Archiver Processes (ARCn)
 The Archiver process reads the redo log files once Oracle has filled them and
writes a copy of the used redo log files to the specified archive log destination(s).
 Up to 10 archiver processes are possible.
 Log_Archieve_Max_Processes initialization parameters specifies the maximum
limit.
 Default value is 2 and is rarely changed.
 Actually, for most databases, ARCH has no effect on the overall system
performance. On some large database sites, however, archiving can have an
impact on system performance.

ARCn

Archiver process Copies of redo log Archive destination


files
Logical and Physical Database
Structures Logical Physical

Database

Schema Tablespace Data file

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

Data file 1 Data file 2

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.

Oracle Default Temporary tablespace


 When you create a user without specifying a temporary
tablespace, Oracle assigns the default temporary tablespace
TEMP to the user. If you want to change the default
temporary tablespace, you can use the following command:
 ALTER DATABASE DEFAULT TEMPORARY TABLESPACE
tablespace_name
What is undo tablespace?
Segments, Extents, and
Blocks
 Segments exist in a tablespace.
 Segments are collections of extents.
 Extents are collections of data blocks.
 Data blocks are mapped to disk blocks.

Segment Extents Data Disk


blocks blocks
Blocks
 A database block is the smallest unit of storage in the Oracle database. The size of a
block is a specific number of bytes of storage within a given tablespace within the
database.
 The default block size is specified by the Oracle initialization parameter
DB_BLOCK_SIZE.

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.

What is Trace File?


 Trace file is a file that the Oracle database creates to help you
diagnose and resolve operating problems.
 Each server and background process writes to trace file.
 When a process detects an internal error, it writes information
about the error to its trace file.
Oracle Database Startup Mode
 Mount Mode

 Non Mount Mode


Open Mode
How to Start Oracle Database?
Shut Down Command
 To stop a database, enter SQL> SHUTDOWN [mode]
 Where mode is normal, immediate, or abort.

Shut Down Mode


 In a normal shutdown, the Oracle Database waits for all currently
connected users to disconnect and disallows any new connection before
shutting down. This is the default mode.
 In an immediate shutdown, the Oracle database terminates and rolls back
active transactions, disconnects clients, and shuts down.
 In an abort shutdown, the Oracle database terminates active transactions
and disconnects users, it does not roll back transactions. The database
performs automatic recovery and rollback the next time it is started. Use this
mode only in emergencies.
 The SHUTDOWN TRANSACTIONAL waits for all uncommitted transactions
to complete before shutting down the database instance. This saves the work
for all users without requesting them to log off. The database instance also
does not accept any new transaction after a SHUTDOWN
TRANSACTIONAL.
Shut Down Modes

.
Oracle Managed Files

You might also like