SlideShare a Scribd company logo
1 of 26
Download to read offline
ORACLE ARCHITECTURE
BY
TOTAL OUTPUT POWER
SOLUTIONS
28/07/2019 total output power solutions
ORACLE ARCHITECTURE
Data Files
Memory & Process Structures
I N S TA N C E
Logical Structures
Users Users
D A T A B A S E
LOG1A LOG1B
LOG2A
/u08
LOG2B
/u09 CNTRL2
/u04
CNTRL1
/u06 /u07 /u03
$ORACLE_
HOME/dbs
initSID.ora
DATA
/u01
INDX
/u02
SYSTEM
RBS
/u04
TEMP
/u05
/u03
Oracle Architecture Overview
PMON
SMON
RECO
SNPnn LCnn
Pnn
Snn
Dnn
Archived
Redo
Logs
DBWR CKPT LGWR ARCH
Server Process
User Process
PGA
L
R
U
Dirty
System Global Area
Database Buffer Cache
Redo Log
Buffer
Dictionary
Cache
Library
Cache
Shared Pool Area
/u10
BLOCK
1. Unit of storage
2. In multiples of OS block
3. Data, e.g. in Tables is stored in
a Block
4. Smallest unit of I /O
A Contiguous section of Blocks
forms an EXTENT
Header :Block Address, type of segment
Table Directory : Information about
tables having rows in this Block
Row Directory : Information about rows
Row Data
Free space : For inserting new rows &
updating existing rows. This is controlled
by PCTFREE & PCTUSED parameters
Transaction entries
Data Block Format
Table, Index, cluster or
Other segments
Data File
Data File
Extents
Extents
SEGMENT
Extents are allotted
To Segments
Extents can be allocated to Segments from multiple data files
Extents can not span data files
Segments can span data files & hence even different disks
Tablespace
Data Files
Segments are
created
in Tablespaces
EMP
DEPT
STAFF
System Temp
Rollback
User
D A T A B A S E
Tablespace
Tablespaces & Segments
Segments
• A Segment can span datafiles of one
tablespace
• A Segment occupies only one tablespace
• You can not control placement of extents
of a segment in datafiles.
• You segregate your objects (segments)
by keeping them in separate tablespaces.
• One tablespace can contain objects of
different schemas. I.e.. a tablespace is not
owned by a user.
s
emp
D A T A B A S E
dept
T A B L E S PA C E
ScottSchema
Ram
System Tablespace :
• Created by Oracle when database is
created.
• Contains Data Dictionary & Pl/SQL
units.
• User objects must be kept separate
• Users can be allotted quota on tablespaces.
• There is a default tablespace for a user in which his objects are created.
• Space utilization can be controlled by storage properties of TS & segments.
• Segregation of objects, applications can be controlled. Tablespaces can be taken
offline.
Criteria's for different Tablespaces : Growing/ Constant , Extents proportions
•Active/Inactive, Belonging to different apps, system/ temp/ user/index, to avoid
About Blocks,extents,segments & Tablespaces
• Data Block is the smallest unit of I/O.
• Segment represents objects in the Database such as
Tables,indexes,clusters as well as other structures such as
Rollback segments
• Physical storage in Datafiles is logically represented by
tablespace. User creates objects in tablespace. E. g.
• A segment is allotted space in only one Tablespace in
which it is created. Tablespace can contain multiple
segments.
• The size of a Tablespace is the size of the Datafiles
constituting the Tablespace.
• The size of database is the total size of Tablespaces
costituting the database.
Segments
Data Segments :These are created
in a particular tablespace with
the Create command.
• Storage parameters determine
how extents are allocated or
defaults of the tablespace are
used.
Index Segments : Every Index has a single
Index segment. Index segment with storage
parameters can be created with Create Index
command.
• Temporary segments : Oracle automatically
creates for intermediate & sorting operations.
It is created in the default Temporary
tablespace of the User. Oracle drops Temp.
segment, when statement completes.Rollback Segments :
Rollback Segments are used : To provide read consistency, To Rollback
transactions & to recover the database.
• Oracle automatically assigns rollback segments OR a transaction can use a
specific rollback segment.
• When a transaction is committed, rollback information is released, but not
destroyed immediately -- for creating read consistent views of data.
• A transaction writes to one extent at a time. When it is full, it can reuse existing
extent OR acquire a new extent -- this depends upon active extent and Maxextents
parameter.
• Rollback segment SYSTEM is created by Oracle when database is created. It is
in the System Tablespace. You should create additional Rollback segments.
Rollback Segments
Undo Information :
Block identification &
before image
Rollback Segment
The change here generates Redo log. The Rollback
segment data is restored & used after system crash
Changes of one transaction are chained in entries of a transaction table
Applied change
Select --( SCN=7920)-
7900
7902
7930
7900
7940
7910
7912
7915
Rollback
Segments
Transactions &
Read Consistency
Oracle uses rollback
entries in the Rollback
segments to create read
consistent results for
queries
If E3 is not active, it can be used.
Similarly when E1 is available it will be
used. Otherwise a new extent will be
added.
Memory required by Oracle
• Data Dictionary
• User Data
• SQL queries
• PL/SQL Blocks
• Rollback ( Undo) data
• REDO data
• Temporary data
FILE - I/O
Should be
minimum
USERS
Generate REDO
for Back-up
Generate Undo Information
for rollback and data
consistence during
transactions
Memory Structures Of Oracle
SHARED POOL
Dictionary
Cash
SQL
PL/SQL
Control
Structures
Control
Structures
DataBase
Buffer
Cache
REDO
LOG
BUFFER
Library Cache
Oracle Processes
Server Process :
• Parses & executes SQL statements.
• Reads data blocks from disk to Database Buffer
cache.
• Return the results of SQL statements to the User
Process.
PMON : Process Monitor
• Cleans abnormally terminated user sessions.
• Rolls back uncommitted transactions, releases
locks and frees SGA resources allotted to the user
process
SMON : System Monitor
• Performs automatic instance recovery.
• Reclaims space used by temporary segments
• Merges contiguous areas of free space in data files
( Coalescing or Defragging)
CKPT : Checkpoint
Process
• Updates file headers of
Control files & data files at
Checkpoint
D B W R : Database
Writer process
L G W R : Log writer
process
Dispatcher Process
RECO process
A R C H : Archiver
Process
Processes
Client Application Oracle Server
Single Task Oracle
Client
Application
NET 8
Server
Process
S G A
Client
Application
Server
Process
Dedicated Server
Listener
Multithreaded Server Configuration
Client
Application
Client
Application
Client
Application
Client
Application
M T S Dispatchers
Request Queue
Listener
Response Queue
Shared
Server
Processes
S G A
Server Side
Data Caching
User
Process
DBWR
User
Process
User
Process
User
Process
Database Buffer Cache & DBWR
LRU End MRU End
Dirty List
Dirty Buffer
User
Process
Cache Hit
Cache Miss
DBWR SQL Query
DBWR writes dirty buffers to disk when -
 Dirty Buffers reach a threshold value
 No free blocks are available in LRU list
after server process scans sp. buffers
 A timeout occurs : 3 secs
 A DBWR checkpoint takes place
Database
Buffer
Cache
Age
REDO -- SETUP
Buffer Cache
ON - LINE Re
Do Log Files
Data Files
Archive Logs
USER
USER LGWR
Archiver
Log
Buffer
DBWR
LGWR : Writes Redo in Log Buffer to On Line Redo
Log Files When
 The redo log buffer is 1/3 full
 A timeout occurs (about every 3 seconds)
 Before DBWR writes modified blocks to the data
files
 A transaction COMMITS
Shared Pool
Shared SQLArea
Parsed SQL Statement
Parsed SQL Statement
Parsed SQL Statement
Server1
Server n
Shared PL/SQLArea
Parsed/compiled PL/ SQL
Statement
Parsed/compiled PL/ SQL
StatementP G A
P G A
Program Global Area : Contains values specific to the sessions I.e. local, global or packaged
variables. Bind information in case of SQL statements. In MTS configuration user session info.
Is kept in the shared pool.
Dictionary Cache : Data Dictionary information is cached here for the user processes.
A Shared SQL area remains there until it is flushed out by LRU type mechanism
Dictionary cache
S G A size is determined by :
DB_BLOCK_SIZE : Size of a single data block DB_BLOCK_BFFERS : Number of
buffers in D.B. Buffer cache LOG_BUFFER : Size in bytes of Redo Log Buffers
SHARED_POOL_SIZE : Size in bytes of the shared pool
All the above are configured in the parameter file.
Processing SQL Statements
Parsing : SQL
User Process
SQL
Server Process
Shared
Pool
Check for
Syntax
Check for
Table / Column
definitions
Check for
Privileges
Prepare
Execution Plan
Load in
Shared Pool
Executing :
P G A
Parsed code
executed
Applied to
data buffers
Perform physical
reads
Perform constraint
checking
For Select or Query Read the block if already
in D.B. Buffer cache
Perform a physical read if
Block is not in memory
For DML
Statements :
Acquire data & rollback blocks
into D.B. buffer cache
Place exclusive row locks
on the rows about to change
Save rollback data into
rollback segment block buffer
Store change-records to
Redo Log buffer
Apply changes
to the Block
Oracle Database Files
Data Files :
• Store Data Dictionary, User
Objects, Data for Undoing
Transactions(Rollback)
Redo Log Files :
• Record changes made to Database
for using them in Recovery.
• There must be at least two Redo Log
groups . The groups are written in
circular fashion.
• Each Redo Log group must contain
same number of members.
Control Files :
A binary file that describes the
structure of the database.
 Required to mount, open, and
access the database.
 Synchronization info needed
for recovery is stored in the
control file
 Recommended configuration is
a min of two control files on
separate disks.
Parameter File :
Used to size the SGA and
locate the control files at
instance start up.
Contains all the database
initialization parameters.
Archieved Redo Log File :
Offline storage of Redo Logs for
complete Database Recovery
Trace File :Contain internal errors
Alert Files : Logs deadlock, Startup /
Shutdowns , Initialization parameters at
instance startup.
InitOrcl.ora ( Initialazation / Parameter File )
# Example INIT.ORA file
db_name = oracle
db_files = 20
control_files = C:ORAWIN95DATABASEctl1orcl.ora
compatible = 7.2.0.0.0
db_block_buffers = 200
shared_pool_size = 3500000
log_checkpoint_interval = 10000
processes = 50
log_buffer = 8192
max_dump_file_size = 10240
# log_archive_start = true
# define directories to store trace and alert files
background_dump_dest=%RDBMS72%trace
user_dump_dest=%RDBMS72%trace
db_block_size = 2048
Oracle Startup
NOMOUNT
•Read Init.ora
• Identify Control File
• Create & Initialize SGA
• Start Background Processes
MOUNT
• Open Control Files
• Get Instance lock on Database
OPEN
• Open & lock datafiles
• Open On - Line Redo Log
• Perform Crash Recovery
Startup
Nomount
Startup Mount
Startup Open
Instance Started
Database Mounted
Database Opened
Oracle Database Shutdown
Stop access to database
Wait until Users Exit
Flush Redo logs & Database
buffer caches.
Drop File locks
Complete ongoing transactions
Cancel Active
Transactions & Rollback
Update File Headers
Synchronize Control files & D B files
Shutdown Immediate
Shutdown Normal
Shutdown Abort
28/07/2019 total output power solutions

More Related Content

What's hot

Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360
Carlos Sierra
 
Less04 database instance
Less04 database instanceLess04 database instance
Less04 database instance
Amit Bhalla
 

What's hot (20)

Oracle dba training
Oracle  dba    training Oracle  dba    training
Oracle dba training
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
 
01 oracle architecture
01 oracle architecture01 oracle architecture
01 oracle architecture
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Less07 storage
Less07 storageLess07 storage
Less07 storage
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 
Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rman
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
Less10 undo
Less10 undoLess10 undo
Less10 undo
 
Less04 database instance
Less04 database instanceLess04 database instance
Less04 database instance
 
Backup and recovery in oracle
Backup and recovery in oracleBackup and recovery in oracle
Backup and recovery in oracle
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
Oracle Data Guard
Oracle Data GuardOracle Data Guard
Oracle Data Guard
 
Oracle User Management
Oracle User ManagementOracle User Management
Oracle User Management
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creations
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1
 
Oracle archi ppt
Oracle archi pptOracle archi ppt
Oracle archi ppt
 
Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)
 

Similar to ORACLE ARCHITECTURE

Oracle Instance Architecture.ppt
Oracle Instance Architecture.pptOracle Instance Architecture.ppt
Oracle Instance Architecture.ppt
HODCA1
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
vivaankumar
 

Similar to ORACLE ARCHITECTURE (20)

App D
App DApp D
App D
 
Less01 Dba1
Less01 Dba1Less01 Dba1
Less01 Dba1
 
Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
ora_sothea
ora_sotheaora_sothea
ora_sothea
 
Oracle 10g Introduction 1
Oracle 10g Introduction 1Oracle 10g Introduction 1
Oracle 10g Introduction 1
 
Less01_Architecture.ppt
Less01_Architecture.pptLess01_Architecture.ppt
Less01_Architecture.ppt
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
exploring-the-oracle-database-architecture.ppt
exploring-the-oracle-database-architecture.pptexploring-the-oracle-database-architecture.ppt
exploring-the-oracle-database-architecture.ppt
 
Exploring the Oracle Database Architecture.ppt
Exploring the Oracle Database Architecture.pptExploring the Oracle Database Architecture.ppt
Exploring the Oracle Database Architecture.ppt
 
DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)
 
DBA 101 : Calling all New Database Administrators (PPT)
DBA 101 : Calling all New Database Administrators (PPT)DBA 101 : Calling all New Database Administrators (PPT)
DBA 101 : Calling all New Database Administrators (PPT)
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Oracle Instance Architecture.ppt
Oracle Instance Architecture.pptOracle Instance Architecture.ppt
Oracle Instance Architecture.ppt
 
Adavanced Databases and Mangement system
Adavanced Databases and Mangement systemAdavanced Databases and Mangement system
Adavanced Databases and Mangement system
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
Sql introduction
Sql introductionSql introduction
Sql introduction
 
Ora01_OraArc.pdf
Ora01_OraArc.pdfOra01_OraArc.pdf
Ora01_OraArc.pdf
 

More from Manohar Tatwawadi

More from Manohar Tatwawadi (20)

Power Plant Operations.pdf
Power Plant Operations.pdfPower Plant Operations.pdf
Power Plant Operations.pdf
 
Frequently Asked Questions on TURBINE Part 3
Frequently Asked Questions on TURBINE Part 3Frequently Asked Questions on TURBINE Part 3
Frequently Asked Questions on TURBINE Part 3
 
Green building concepts and good building practices
Green building concepts and good building practicesGreen building concepts and good building practices
Green building concepts and good building practices
 
Auxiliary Consumption and Saving due to Increase in Boiler Efficiency
Auxiliary Consumption and Saving due to Increase in Boiler EfficiencyAuxiliary Consumption and Saving due to Increase in Boiler Efficiency
Auxiliary Consumption and Saving due to Increase in Boiler Efficiency
 
COMPRESSED AIR SYSTEM . ENERGY CONSERVATION OPPORTUNITIES
COMPRESSED AIR SYSTEM . ENERGY CONSERVATION OPPORTUNITIESCOMPRESSED AIR SYSTEM . ENERGY CONSERVATION OPPORTUNITIES
COMPRESSED AIR SYSTEM . ENERGY CONSERVATION OPPORTUNITIES
 
FAQ on Turbines Part 2
FAQ on Turbines Part 2FAQ on Turbines Part 2
FAQ on Turbines Part 2
 
Frequently asked questions on turbines Part 1
Frequently asked questions on turbines Part 1Frequently asked questions on turbines Part 1
Frequently asked questions on turbines Part 1
 
Cooling towers in thermal power plants
Cooling towers in thermal power plantsCooling towers in thermal power plants
Cooling towers in thermal power plants
 
Electrical safety in power stations
Electrical safety in power stationsElectrical safety in power stations
Electrical safety in power stations
 
Cost accounting, cost control and cost reduction in TPS
Cost accounting, cost control and cost reduction in TPSCost accounting, cost control and cost reduction in TPS
Cost accounting, cost control and cost reduction in TPS
 
Environmental and pollution control in Thermal Power Stations
Environmental and pollution control in Thermal Power StationsEnvironmental and pollution control in Thermal Power Stations
Environmental and pollution control in Thermal Power Stations
 
Energy Audit & Energy Conservation Opportunities in Electrical Equipments ...
Energy Audit & Energy  Conservation  Opportunities in  Electrical Equipments ...Energy Audit & Energy  Conservation  Opportunities in  Electrical Equipments ...
Energy Audit & Energy Conservation Opportunities in Electrical Equipments ...
 
Fuels and Combustion Equations
Fuels and Combustion EquationsFuels and Combustion Equations
Fuels and Combustion Equations
 
Basics of thermal power stations
Basics of thermal power stationsBasics of thermal power stations
Basics of thermal power stations
 
Boiler light up & loading
Boiler light up & loadingBoiler light up & loading
Boiler light up & loading
 
Handling of turbine during emergencies
Handling of turbine during emergenciesHandling of turbine during emergencies
Handling of turbine during emergencies
 
Effect of Coal Quality and Performance of Coal pulverisers / Mills
Effect of Coal Quality and Performance of Coal pulverisers / MillsEffect of Coal Quality and Performance of Coal pulverisers / Mills
Effect of Coal Quality and Performance of Coal pulverisers / Mills
 
Thermal power plant efficiency
Thermal power plant efficiencyThermal power plant efficiency
Thermal power plant efficiency
 
210 mw turbine cycle heat rate
210 mw turbine cycle heat rate210 mw turbine cycle heat rate
210 mw turbine cycle heat rate
 
ENERGY AUDIT METHODOLOGY FOR TURBINE CYCLE IN A POWER PLANT
ENERGY AUDIT METHODOLOGY FOR TURBINE CYCLE IN A POWER PLANTENERGY AUDIT METHODOLOGY FOR TURBINE CYCLE IN A POWER PLANT
ENERGY AUDIT METHODOLOGY FOR TURBINE CYCLE IN A POWER PLANT
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

ORACLE ARCHITECTURE

  • 1. ORACLE ARCHITECTURE BY TOTAL OUTPUT POWER SOLUTIONS 28/07/2019 total output power solutions
  • 2. ORACLE ARCHITECTURE Data Files Memory & Process Structures I N S TA N C E Logical Structures Users Users D A T A B A S E
  • 3. LOG1A LOG1B LOG2A /u08 LOG2B /u09 CNTRL2 /u04 CNTRL1 /u06 /u07 /u03 $ORACLE_ HOME/dbs initSID.ora DATA /u01 INDX /u02 SYSTEM RBS /u04 TEMP /u05 /u03 Oracle Architecture Overview PMON SMON RECO SNPnn LCnn Pnn Snn Dnn Archived Redo Logs DBWR CKPT LGWR ARCH Server Process User Process PGA L R U Dirty System Global Area Database Buffer Cache Redo Log Buffer Dictionary Cache Library Cache Shared Pool Area /u10
  • 4. BLOCK 1. Unit of storage 2. In multiples of OS block 3. Data, e.g. in Tables is stored in a Block 4. Smallest unit of I /O A Contiguous section of Blocks forms an EXTENT Header :Block Address, type of segment Table Directory : Information about tables having rows in this Block Row Directory : Information about rows Row Data Free space : For inserting new rows & updating existing rows. This is controlled by PCTFREE & PCTUSED parameters Transaction entries Data Block Format
  • 5. Table, Index, cluster or Other segments Data File Data File Extents Extents SEGMENT Extents are allotted To Segments Extents can be allocated to Segments from multiple data files Extents can not span data files Segments can span data files & hence even different disks
  • 6. Tablespace Data Files Segments are created in Tablespaces EMP DEPT STAFF System Temp Rollback User D A T A B A S E Tablespace
  • 7. Tablespaces & Segments Segments • A Segment can span datafiles of one tablespace • A Segment occupies only one tablespace • You can not control placement of extents of a segment in datafiles. • You segregate your objects (segments) by keeping them in separate tablespaces. • One tablespace can contain objects of different schemas. I.e.. a tablespace is not owned by a user. s emp D A T A B A S E dept T A B L E S PA C E ScottSchema Ram System Tablespace : • Created by Oracle when database is created. • Contains Data Dictionary & Pl/SQL units. • User objects must be kept separate • Users can be allotted quota on tablespaces. • There is a default tablespace for a user in which his objects are created. • Space utilization can be controlled by storage properties of TS & segments. • Segregation of objects, applications can be controlled. Tablespaces can be taken offline. Criteria's for different Tablespaces : Growing/ Constant , Extents proportions •Active/Inactive, Belonging to different apps, system/ temp/ user/index, to avoid
  • 8. About Blocks,extents,segments & Tablespaces • Data Block is the smallest unit of I/O. • Segment represents objects in the Database such as Tables,indexes,clusters as well as other structures such as Rollback segments • Physical storage in Datafiles is logically represented by tablespace. User creates objects in tablespace. E. g. • A segment is allotted space in only one Tablespace in which it is created. Tablespace can contain multiple segments. • The size of a Tablespace is the size of the Datafiles constituting the Tablespace. • The size of database is the total size of Tablespaces costituting the database.
  • 9. Segments Data Segments :These are created in a particular tablespace with the Create command. • Storage parameters determine how extents are allocated or defaults of the tablespace are used. Index Segments : Every Index has a single Index segment. Index segment with storage parameters can be created with Create Index command. • Temporary segments : Oracle automatically creates for intermediate & sorting operations. It is created in the default Temporary tablespace of the User. Oracle drops Temp. segment, when statement completes.Rollback Segments : Rollback Segments are used : To provide read consistency, To Rollback transactions & to recover the database. • Oracle automatically assigns rollback segments OR a transaction can use a specific rollback segment. • When a transaction is committed, rollback information is released, but not destroyed immediately -- for creating read consistent views of data. • A transaction writes to one extent at a time. When it is full, it can reuse existing extent OR acquire a new extent -- this depends upon active extent and Maxextents parameter. • Rollback segment SYSTEM is created by Oracle when database is created. It is in the System Tablespace. You should create additional Rollback segments.
  • 10. Rollback Segments Undo Information : Block identification & before image Rollback Segment The change here generates Redo log. The Rollback segment data is restored & used after system crash Changes of one transaction are chained in entries of a transaction table Applied change Select --( SCN=7920)- 7900 7902 7930 7900 7940 7910 7912 7915 Rollback Segments Transactions & Read Consistency Oracle uses rollback entries in the Rollback segments to create read consistent results for queries If E3 is not active, it can be used. Similarly when E1 is available it will be used. Otherwise a new extent will be added.
  • 11. Memory required by Oracle • Data Dictionary • User Data • SQL queries • PL/SQL Blocks • Rollback ( Undo) data • REDO data • Temporary data FILE - I/O Should be minimum USERS Generate REDO for Back-up Generate Undo Information for rollback and data consistence during transactions
  • 12. Memory Structures Of Oracle SHARED POOL Dictionary Cash SQL PL/SQL Control Structures Control Structures DataBase Buffer Cache REDO LOG BUFFER Library Cache
  • 13. Oracle Processes Server Process : • Parses & executes SQL statements. • Reads data blocks from disk to Database Buffer cache. • Return the results of SQL statements to the User Process. PMON : Process Monitor • Cleans abnormally terminated user sessions. • Rolls back uncommitted transactions, releases locks and frees SGA resources allotted to the user process SMON : System Monitor • Performs automatic instance recovery. • Reclaims space used by temporary segments • Merges contiguous areas of free space in data files ( Coalescing or Defragging) CKPT : Checkpoint Process • Updates file headers of Control files & data files at Checkpoint D B W R : Database Writer process L G W R : Log writer process Dispatcher Process RECO process A R C H : Archiver Process
  • 14. Processes Client Application Oracle Server Single Task Oracle Client Application NET 8 Server Process S G A Client Application Server Process Dedicated Server Listener
  • 15. Multithreaded Server Configuration Client Application Client Application Client Application Client Application M T S Dispatchers Request Queue Listener Response Queue Shared Server Processes S G A Server Side
  • 17.
  • 18. Database Buffer Cache & DBWR LRU End MRU End Dirty List Dirty Buffer User Process Cache Hit Cache Miss DBWR SQL Query DBWR writes dirty buffers to disk when -  Dirty Buffers reach a threshold value  No free blocks are available in LRU list after server process scans sp. buffers  A timeout occurs : 3 secs  A DBWR checkpoint takes place Database Buffer Cache Age
  • 19. REDO -- SETUP Buffer Cache ON - LINE Re Do Log Files Data Files Archive Logs USER USER LGWR Archiver Log Buffer DBWR LGWR : Writes Redo in Log Buffer to On Line Redo Log Files When  The redo log buffer is 1/3 full  A timeout occurs (about every 3 seconds)  Before DBWR writes modified blocks to the data files  A transaction COMMITS
  • 20. Shared Pool Shared SQLArea Parsed SQL Statement Parsed SQL Statement Parsed SQL Statement Server1 Server n Shared PL/SQLArea Parsed/compiled PL/ SQL Statement Parsed/compiled PL/ SQL StatementP G A P G A Program Global Area : Contains values specific to the sessions I.e. local, global or packaged variables. Bind information in case of SQL statements. In MTS configuration user session info. Is kept in the shared pool. Dictionary Cache : Data Dictionary information is cached here for the user processes. A Shared SQL area remains there until it is flushed out by LRU type mechanism Dictionary cache S G A size is determined by : DB_BLOCK_SIZE : Size of a single data block DB_BLOCK_BFFERS : Number of buffers in D.B. Buffer cache LOG_BUFFER : Size in bytes of Redo Log Buffers SHARED_POOL_SIZE : Size in bytes of the shared pool All the above are configured in the parameter file.
  • 21. Processing SQL Statements Parsing : SQL User Process SQL Server Process Shared Pool Check for Syntax Check for Table / Column definitions Check for Privileges Prepare Execution Plan Load in Shared Pool Executing : P G A Parsed code executed Applied to data buffers Perform physical reads Perform constraint checking For Select or Query Read the block if already in D.B. Buffer cache Perform a physical read if Block is not in memory For DML Statements : Acquire data & rollback blocks into D.B. buffer cache Place exclusive row locks on the rows about to change Save rollback data into rollback segment block buffer Store change-records to Redo Log buffer Apply changes to the Block
  • 22. Oracle Database Files Data Files : • Store Data Dictionary, User Objects, Data for Undoing Transactions(Rollback) Redo Log Files : • Record changes made to Database for using them in Recovery. • There must be at least two Redo Log groups . The groups are written in circular fashion. • Each Redo Log group must contain same number of members. Control Files : A binary file that describes the structure of the database.  Required to mount, open, and access the database.  Synchronization info needed for recovery is stored in the control file  Recommended configuration is a min of two control files on separate disks. Parameter File : Used to size the SGA and locate the control files at instance start up. Contains all the database initialization parameters. Archieved Redo Log File : Offline storage of Redo Logs for complete Database Recovery Trace File :Contain internal errors Alert Files : Logs deadlock, Startup / Shutdowns , Initialization parameters at instance startup.
  • 23. InitOrcl.ora ( Initialazation / Parameter File ) # Example INIT.ORA file db_name = oracle db_files = 20 control_files = C:ORAWIN95DATABASEctl1orcl.ora compatible = 7.2.0.0.0 db_block_buffers = 200 shared_pool_size = 3500000 log_checkpoint_interval = 10000 processes = 50 log_buffer = 8192 max_dump_file_size = 10240 # log_archive_start = true # define directories to store trace and alert files background_dump_dest=%RDBMS72%trace user_dump_dest=%RDBMS72%trace db_block_size = 2048
  • 24. Oracle Startup NOMOUNT •Read Init.ora • Identify Control File • Create & Initialize SGA • Start Background Processes MOUNT • Open Control Files • Get Instance lock on Database OPEN • Open & lock datafiles • Open On - Line Redo Log • Perform Crash Recovery Startup Nomount Startup Mount Startup Open Instance Started Database Mounted Database Opened
  • 25. Oracle Database Shutdown Stop access to database Wait until Users Exit Flush Redo logs & Database buffer caches. Drop File locks Complete ongoing transactions Cancel Active Transactions & Rollback Update File Headers Synchronize Control files & D B files Shutdown Immediate Shutdown Normal Shutdown Abort
  • 26. 28/07/2019 total output power solutions