Oracle System Architecture
Transcript of Oracle System Architecture
-
7/29/2019 Oracle System Architecture
1/23
Neenu Prasad
-
7/29/2019 Oracle System Architecture
2/23
Oracle Database
A database is collection of data files plus programs that manipulate
those data files
Two types of information are stored in an Oracle database
User data, relevant to a particular application
System data, that the database needs to manage itself
-
7/29/2019 Oracle System Architecture
3/23
-
7/29/2019 Oracle System Architecture
4/23
-
7/29/2019 Oracle System Architecture
5/23
Oracle server
An Oracle server consists of :
1. Oracle databasethe collection of stored data, including log
and control files
2. Oracle Instancethe processes, including Oracle (system)
processes and user processes taken together, created for aspecific instance of the database operation.
Oracle server supports SQL to define and manipulate data,
PL/SQLto control the flow of SQL, to use variables, and to
provide error-handling procedures.
Oracle can also be accessed through general purposeprogramming languages such as C or JAVA.
-
7/29/2019 Oracle System Architecture
6/23
Oracle database
Components Database files contain all database data
Control files contain info to access and manipulate thedata
Redo Logs
record all the transactions on the database
Tablespaces logical divisions of a database
Segments set of database blocks
Extents
allocation of contiguous space on disk exp inbytes.
-
7/29/2019 Oracle System Architecture
7/23
Oracle Database Structure
Database files
An Oracle database consists of one or more database files.
These files contain data that can be accessed with the help of SQL.
A file can be associated with one and only one tablespace.
The database when created initially, has only one physical file.
The maximum number of files that can be opened at a time are 32by
default.
One or more physical files form a logical unit called tablespace.
-
7/29/2019 Oracle System Architecture
8/23
Cont.
Control files
A databases overall physical architecture is maintained by its control
files.
These record control information about all the files within the database.
A control file is associated with a single database
Control files are automatically modified by Oracle; a user cannot edit
them.
They are used to maintain internal consistency and guide recovery
operations
-
7/29/2019 Oracle System Architecture
9/23
Cont..
Redo Log files
A Redo Log contains all the transactions that have occurred againstthe database.
No activity in the database can take place without being recorded in Redo Logs.
The Redo Logs are necessary to protect against data loss.
Redo Logs are also called transaction logs.
Every database requires a minimum of two Redo Logs.
These are used in recovery operations to restore lost or damaged files.
-
7/29/2019 Oracle System Architecture
10/23
TABLESPACES
Tablespaces
A database is divided into logical divisions called tablespaces
A database may have one or more tablespaces
Each logical tablespace corresponds to one or more physical database files.
The typical tablespace present in an Oracle database are :
-
7/29/2019 Oracle System Architecture
11/23
Cont..
SYSTEMstores all information needed to manage itself
TEMPstores all temporary tables
TOOLSstores database objects needed to support different tools
USERinformation about users is stored
DATA & INDEXholds the actual data and the indexes
ROLLBACKwhere all undo information is stored
-
7/29/2019 Oracle System Architecture
12/23
Segments & Extents
Segments & Extents
All data in tablespace are stored in allocations of database space called segments.
For each table there is a table segment. For indexes so-called index segments are
allocated. The segment associated with a database object belongs to exactly one
tablespace.
An Oracle database requires upto five types of segments, viz: Data segments, Index
segments, Rollback segments, Temporary segments, Bootstrap segments
An extent is an allocation of contiguous database space expressed in bytes
-
7/29/2019 Oracle System Architecture
13/23
Oracle Instance
the set of processes that constitute an instance of
the servers operation is called an Oracle Instance
Consists of :
System Global Area
set of background processes.
-
7/29/2019 Oracle System Architecture
14/23
System Global Area(SGA)
Shared memory area
Oracle assigns an SGA area when an instance starts
SGA is divided into 3
1. Database buffer cache: This keeps the most recently
accessed data blocks from the database.
2. Redo log buffer, which is the buffer for the redo log file and
is used for recovery purposes.
3. Shared pool, which contains shared memory constructs
Eg: shared SQL areas,
-
7/29/2019 Oracle System Architecture
15/23
User processes
Each user process corresponds to the execution of some
application (for example, an Oracle Forms application) or
some tool
-
7/29/2019 Oracle System Architecture
16/23
Program global area (PGA)
This is a memory buffer that contains data and
control information for a server process.
A PGA is created by Oracle when a server
process is started.
-
7/29/2019 Oracle System Architecture
17/23
Oracle Processes
Oracle creates server processes to handle requests from
connected user processes
The background processes are created for each instance
of Oracle; they perform I/O asynchronously and provide
parallelism for better performance and reliability.
-
7/29/2019 Oracle System Architecture
18/23
background processes
Database Writer (DBWR): Writes the modified blocks from
the buffer cache to the data files on disk.
Log writer (LGWR): Writes from the log buffer area to the on-
line disk log file.
Checkpoint (CKPT): Refers to an event at which all modified
buffers in the SGA since the last checkpoint are written to the
data files
System monitor (SMON): Performs instance recovery,
manages storage areas by making the space contiguous, and
recovers transactions skipped during recovery.
-
7/29/2019 Oracle System Architecture
19/23
Cont..
Process monitor (PMON): Performs process recovery
when a user process fails. It is also responsible for managing
the cache and other resources used by a user process.
Archiver (ARCH):Archives on-line log files to archival
storage (for example, tape) if configured to do so.
Recoverer process (RECO): Resolves distributed
transactions that are pending due to a network or systems
failure in a distributed database
-
7/29/2019 Oracle System Architecture
20/23
Cont..
Dispatchers (Dnnn): In multithreaded server configurations,
route requests from connected user processes to available
shared server processes. There is one dispatcher per
standard communication protocol supported .
Lock processes (LCKn): Used for inter-instance locking
when Oracle runs in a parallel server mode.
-
7/29/2019 Oracle System Architecture
21/23
Oracle Startup and
Shutdown
Starting a database
1. Starting an instance of the database
2. Mounting a database
3. Opening a database
-
7/29/2019 Oracle System Architecture
22/23
Oracle Startup and
Shutdown Shutdown
1. Close the database.
2. Dismount the database.
3. Shut down the Oracle instance.
-
7/29/2019 Oracle System Architecture
23/23