0% found this document useful (0 votes)
18 views4 pages

Oracle Dat Admin - $@@#2

Oracle Dat Admin

Uploaded by

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

Oracle Dat Admin - $@@#2

Oracle Dat Admin

Uploaded by

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

Ramkumar Swamminathan

A typical computer has basically primary 3 components.

Memory (RAM) - Not permanent


CPU (Processor)
Storage - Permanent

Processor cannot do any processing on the disk, it can do it only from the RAM. So
for CPU to work on any data, it has to 1st bring it from the DISK to RAM and then
work on that data.

Reading or writing to the storage is slow comapared to Ram. It is 1000s of times


faster.

This is the foundation to understand the oracle architecture.

Components of the Oracle Database.


-----------------------------------

The components that sit in the storage is the Database (Files)

The Instance sits in the Memory (SGA and bunch of processes)

SGA is a memory allcoation like Shrared pool, Buffer cache and other components).
and set of processes called as Background processes which are going to use the CPU
to do some activity.

Database is just a collection of files


Instance is a memory component which is the SGA (which is pure memory) and set of
processes which enable the utilization of CPU on the hardware.

These components togerther form the Oracle database. When ever user connects to the
database, he is actually connecting to Instance. which is combination of SGA and
processes, and these processes will interact with the database files to fetch data.

--------------------------------

Primary components in Oracle Database

Database: bunch of files. it is made up of :


Data files: all the data resides, system metadata and user data
Control files: Information about name of database and what are other files part of
it. like redo log files etc.It is a binary file that holds database status-related
information like Database Name, Data File, and Redo Log file Names, File Locations,
and Log Sequence Number

Redo Log: is a log file, as and when you make changes to the data, it is logged and
kept in redo log.These files are used to hold the changes made in the database.
Redo log files can be utilized during the database recovery process to retrieve the
original information.

Parameter File: Used to create the instance, and components of the instance is
created based on this. THis is called PFILE, SP File is server parameter file.This
file contains the parameters which define the way the database is expected to start
up
Password file:This file holds the user passwords and thus maintains the security of
databases.
Compenents of Instance:
Shared Pool
Buffer Cache
Redo Log Buffer
Large Pool
Java Pool
etc.

The Shared Pool is a portion of the SGA that contains shared memory structures,
such as shared SQL and PL/SQL areas. It is used to store the parsed representation
of SQL statements, execution plans, and PL/SQL program units. This allows for the
efficient reuse of frequently executed statements, reducing the need for reparsing
and improving performance.

The Buffer Cache is a portion of the SGA that stores copies of data blocks read
from datafiles. It is used to cache frequently accessed data blocks, reducing the
number of disks I/Os required to access the data. This can improve performance by
reducing disk I/O time and increasing the speed of data retrieval.

Redo log Buffer: The most crucial structure for recovery operations is the redo
log, which consists of two or more preallocated files that store all changes made
to the database as they occur. Every instance of an Oracle Database has an
associated redo log to protect the database in case of an instance failure

Java pool: The Java Pool is an optional portion of the SGA that is used by Java
Virtual Machine (JVM) and related components. It is used to store Java-related data
structures, such as Java classes and objects. This pool is used when the Oracle
Database is configured to run Java applications or when using Oracle JVM.

Large Pool: The Large Pool is an optional portion of the SGA that can be used for
large memory allocation, such as backup and restore operations and I/O server
processes. It is typically used to improve the performance of these operations by
reducing the amount of disk I/O required.

Background processes: Oracle has a collection of processes that are called


background processes. These processes are responsible for managing memory,
performing I/O operations, and other maintenance activities. Following are some
important background processes that are required:

System Monitor Process (SMON): These processes are responsible for performing
system-level recovery and maintenance activities.
Process Monitor Process (PMON): The task of these processes is to monitor other
background processes.
Database Writer Process (DBWR): This process performs the task of writing data
blocks from the Database Buffer Cache (present in SGA) to physical data
files(Present in the Database system).
Log Writer Process (LGWR): This process writes the Redo blocks from Redo Log Buffer
(present in SGA) to Redo Log Files(present in the Database system).
CheckPoint (CKPT): This process maintains data files and control files with the
most recent checkpoint information.

-------------------
From Ramkumar Swaminathan - Video 3

Database is a bunch of files present in the storage


Instance is made up of 2 components, SGA and bunch of processes
SGA is called as System Global Area or Shared Global Area
Because it is shared by all users who connect to the database
Important components in these
Database contains Data files (primarily 3 files)
this is the place where all data resides, system metadata or user data that is put
in
Then we have control file, has info about what is name of DB, what are other files
part of it (redo log etc)
Then we have Redo Log file, its a log file.as and when you make changes to data, it
is logged and kept in redo log.
Apart from this we have parameter file and a password file
Parameter file is used to create the instance, when we start a database, a instance
is created and components in the database is created based on the pfile or spfile
(parameter file)

Coming to Instance
Primary component of SGA are, shared pool, buffer cache, redo log buffer,
optionally large pool, java pool and streams pool. Primary 5.

Shared pool is where all executables are available, all library of PLSQL and SQL
that we execute are kept here. Plus it also has a cache of the data dictionary. so
a shared pool is made up of Library Cache and Data dictionary cache. Thats what is
shared pool.

Buffer cache contains whatever data you query upon, SQL query pulls the data from
the data files and places it in buffer cache where the processing happens.

Redo Log buffer, when ever we change data , entries are made in redo log buffer.

Processes: SMON, PMON, DBWR, CKPT, LGRW. These 5 are very important processes.

Whenever we make change to data, it is in temporary memory, DBWR will write down
what is called as Dirty buffer. What is the dirty buffer? any block that is read
into buffer cache and changed is called as dirty buffer and it is the
responsibility of DBWR to write it to the Dirty buffer. LGWR - as and when we make
changes in buffer cache, redo log entries are made and LGWR responsibility is to
write it into the REDO LOG files in DB.

SMON is System monitor, which is generally used in recovery of DB instance. PMON is


process monitor which basically monitors all processes are working fine, and it
will take care of any process failure and instance is going to crash, it will take
care of that.
CKPT takes care of syncronization of redo log and data files in other words writing
the buffer cache and redo log at the same time so that all changes available in the
memory are syncronized in the Data files.

---------------------------

Video 4 - Memory structures of Oracle database instance


Instance is made up of 2 components, SGA and Bunch of processes
We will see in detail about memory components
SGA has Shared pool, buffer cache, log buffer, java pool, large pool, streams pool

Shared pool consists of 2 components, library cache and dictionary cache.

All executable code called by any session connected to the instance is kept in
library cache. it could be SQL or PLSQL. For SQL, a sql comes from user session and
undergoes a parse, a hash value is created and the optimizer generates a execution
plan.
Every sql has a SQL area which is available in Library cache, if same SQL is
executed again, it can reuse whatever is already parsed and kept and execute the
statement.

Similarly, for PLSQL, there can be two types like stored plsql like procedure,
functions, packages OR we could call anonymous block. If it is anonymous block, it
has to be compiled at run time and executed, whereas if it is stored plsql block,
it has to read it from dictionary i.e. system metadata oracle maintains in
dictionary cache, which is pulled from the system tablespace and executed. That is
what is there in library cache

Dictionary Cache: if a sql is parsed, it has to know if the tables, columns


referenced are valid and has necessary user pemissions. This information is present
here.
These are the primary content of shared pool
----------------------------

You might also like