Professional Documents
Culture Documents
Oracle Architecture
Oracle Architecture
Oracle Architecture
Oracle Architecture
Oracle Day 1
Objectives
• Why RDBMS?
• Keys
• SQL
• Embedded SQL
• Transaction processing
• Database Servers
• Application Development Tools
Instance
User
process Shared Pool SGA
Archived
Datafiles Control files Redo Log
Parameter files Log files
file
Password
file
Database
Oracle Database:
– Is a collection of data that is treated as a unit
– Consists of three file types
Oracle Database
Datafiles Control
files Redo
Log files
Oracle Instance:
Instance
Shared Pool SGA
Server
Connection process
established Session created
User Oracle Server
process
Database user
Oracle Database
Datafiles Control
Parameter files Redo Archived
file Log files Log files
Password
file
– Used to store:
• Most recently executed SQL statements
• Most recently used data definitions
– It consists of two key performance-related memory structures:
• Library Cache
• Data Dictionary Cache
– Sized by the parameter SHARED_POOL_SIZE
Shared Pool
Library
Cache
Data
Dictionary
Cache
– Stores information about the most recently used SQL and PL/SQL
statements
– Enables the sharing of commonly used statements
– Is managed by a least recently used (LRU) algorithm
– Consists of two structures:
• Shared SQL area
• Shared PL/SQL area
– Size determined by the Shared Pool sizing
– Stores copies of data blocks that have been retrieved from the
datafiles
– Enables great performance gains when you obtain and update data
– Managed through the LRU algorithm
– DB_BLOCK_SIZE determines the block size
Database Buffer
Cache
Redo Log
Buffer
User
process
Server
process
User
process
Connection
established
Database user
Server
Connection process
established Session created
User Oracle server
process
Database user
Database
Redo
Datafiles Control Log
files files
Database
Instance • Responsibilities:
SGA – Instance recovery
• Rolls forward changes
in redo logs
• Opens database for
user access
SMON
• Rolls back
uncommitted
transactions
Redo – Coalesces free space
Datafiles Control Log
files files – Deallocates temporary
segments
Database
PGA area
Redo
Datafiles Control Log
files files
Database
Redo ARCn
Datafiles Control Log
files files Archived Redo
Log files
Control
files
Redo
Log
files
Tablespace
Datafile
Segment Segment
Extent Blocks
Tablespace
Datafiles
– SYSTEM tablespace
• Created with the database
• Contains the data dictionary
• Contains the SYSTEM undo segment
– Non-SYSTEM tablespace
• Separate segments
• Eases space administration
• Controls amount of space allocated to a user
– Data Segment
– Index Segment
– Rollback Segment
– Temporary Segment
Old image
Table
New image
Rollback segment
Update transaction
Transaction rollback
Read consistency
Transaction recovery
Rollback segment
SELECT *
Table FROM table
Header
Free space
Data
PCTFREE
PCTUSED
Pointer
Control Redo
Data files Log
files files Database
Data Dictionary
tables
– Logical
• Single column or concatenated
• Unique or nonunique
• Function-based
• Domain
– Physical
• Partitioned or nonpartitioned
• B-tree
– Normal or reverse key
• Bitmap
B-tree Bitmap
•Suitable for high-cardinality •Suitable for low-cardinality
columns columns
•Updates on keys relatively •Updates to key columns very
inexpensive expensive
•Inefficient for queries •Efficient for queries
using OR predicates using OR predicates
• SYS
– Password: change_on_install
– Owner of the database data dictionary
• SYSTEM
– Password: manager
– Owner of additional internal tables and views used by Oracle
tools
Granting Privileges
– Use the CASCADE clause to drop all objects in the schema if the
schema contains objects.