1650607.ppt

The Architecture of Oracle
David Konopnicki (Revised by
Mordo Shalom – 2004)
Source
• Oracle 9i Database Concepts
– Available on the course Web Site.
• We will learn the internal structure of
Oracle 9i.
The Oracle Server
• The Oracle server consists of an Oracle
database and an Oracle instance.
• Database structure:
– Physical DB struct: determined by the OS.
Three types of files: datafiles, redo log files,
control files.
– Logical DB struct: Tablespaces, Schema
objects.
Database Structure
• Structures: Structures are well-defined objects (such as
tables, views, indexes, and so on) that store or access the
data of a database. Structures and the data contained within
them can be manipulated by operations.
• Operations: Operations are clearly defined actions that
allow users to manipulate the data and structures of a
database. The operations on a database must adhere to a
predefined set of integrity rules.
• Integrity Rules:Integrity rules are the laws that govern
which operations are allowed on the data and structures of
a database. Integrity rules protect the data and the
structures of a database.
Schema Object - Table
• A table is the basic unit of data storage in an Oracle
database.
• The tables of a database hold all of the user-accessible
data.
• Table data is stored in rows and columns. Every table is
defined with a table name and set of columns.
• Each column is given a column name, a datatype and a
width.
• Once a table is created, valid rows of data can be
inserted into it. The table's rows can then be queried,
deleted, or updated.
• To enforce defined business rules on a table's data,
integrity constraints and triggers can also be defined for
a table.
Tables
Datatypes
Data Type Description Column Length (bytes)
CHAR (size) Fixed-length character
data of length size.
Fixed for every row in the table (with trailing
blanks);
VARCHAR2
(size)
Variable-length
character data.
Variable for each row, up to 2000 bytes per row.
NUMBER (p, s) Variable-length numeric
data.
Variable for each row. The maximum space
required for a given column is 21 bytes per row.
DATE Fixed-length date and
time data
Fixed at seven bytes for each row in the table.
LONG Variable-length
character data.
Variable for each row in the table, up to 2^31 - 1
bytes, or two gigabytes, per row.
RAW (size) Variable-length raw
binary data
Variable for each row in the table, up to 255
bytes per row.
LONG RAW Variable-length raw
binary data.
Variable for each row in the table, up to 2^31 - 1
bytes, or two gigabytes, per row.
ROWID Binary data representing
row addresses.
Fixed at six bytes for each row in the table.
MLSLABEL Variable-length binary
data representing
operating system labels.
Variable for each row in the table, ranging from
two to five bytes per row.
Schema Object - View
• A view is a custom-tailored presentation of the data in one
or more tables. A view can also be thought of as a "stored
query".
• Like tables, views can be queried, updated, inserted into,
and deleted from, with restrictions. All operations
performed on a view actually affect the base tables of the
view.
• Views are often used to do the following:
 Provide an additional level of table security by restricting
access to a predetermined set of rows and columns of a table.
 Hide data complexity.
 Simplify commands for the user.
 Present the data in a different perspective from that of the
base table.
 Store complex queries.
Views
Other Schema Objects
• Indexes are created on one or more columns of a table.
Once created, an index is automatically maintained and
used by Oracle. Changes to table data are automatically
incorporated into all relevant indexes with complete
transparency to the users.
• Clusters are groups of one or more tables physically stored
together because they share common columns and are
often used together.
• Hash clusters: a row is stored in a hash cluster based on
the result of applying a hash function to the row's cluster
key value. All rows with the same hash key value are
stored together on disk.
Indexes
Oracle uses B*-
tree indexes that
are balanced to
equalize access
times to any row
Clusters
Hash Clusters
Not Null Integrity Constraint
Unique Key
Unique Keys
Primary Key
Referencial Integrity
Foreign Key
Self-referential constaint
Schema Object – Program Unit
• The term "program unit" is used to refer to
stored procedures, functions, and packages.
• A procedure or function is a set of SQL and
PL/SQL (Oracle's procedural language
extension to SQL) statements grouped
together as an executable unit to perform a
specific task.
• Stored procedures.
The Data Dictionary
• An Oracle data dictionary is a set of tables
and views that are used as a read-only
reference about the database.
• Stores information about both the logical
and physical structure of the database.
 the valid users of an Oracle database
 information about integrity constraints defined for
tables in the database
 how much space is allocated for a schema object
and how much of it is being used
Tablespaces and Data Files
Tablespace and Datafiles
Data Files
• Every Oracle database has one or more physical
datafiles.
• A database's datafiles contain all the database data
(e.g. tables and indexes).
• characteristics of datafiles:
 Associated with only one database.
 Automatically extend when the database runs out of space.
 One or more datafiles form a logical unit of database storage
called a tablespace.
Data Blocks, Extents and Segments
Segments
• A segment is a set of extents allocated for a
certain logical structure. the different types
of segments include the following:
– Data Segments: All of the table's data is stored
in the extents of its data segment.
– Index Segments:Each index has an index
segment that stores all of its data.
– Rollback Segments (Will be deprecated)
– Temporary Segments
Extents
• An extent is a specific number of contiguous
data blocks, obtained in a single allocation,
used to store a specific type of information.
Logical Database Structures
• Disk Space: Data Blocks
– At the finest level of granularity, an Oracle
database's data is stored in data blocks.
– One data block corresponds to a specific
number of bytes of physical database space on
disk. (Standard and non-standard block sizes)
– A data block size is specified for each Oracle
database when the database is created.
– A database uses and allocates free database
space in Oracle data blocks.
Data Blocks
• Header: general block
info: block address and the
type of segment; for
example, data, index, or
rollback.
• Table Directory: info
about the tables having
rows in this block.
• Row Directory: row info
about the actual rows in
the block
• Row Data
PCTFREE
The PCTFREE
parameter is used to
set the percentage of a
block to be reserved
(kept free) for possible
updates to rows that
already are contained
in that block.
PCTUSED
• After a data block becomes full,
as determined by PCTFREE,
Oracle does not consider the
block for the insertion of new
rows until the percentage of the
block being used falls below the
parameter PCTUSED. Before
this value is achieved, Oracle
uses the free space of the data
block only for updates to rows
already contained in the data
block.
PCTFREE and PCTUSED
Row Format and Sizes
Oracle stores each
row of a
database table
as one or more
row pieces
Allocation of space in Hash Clusters
Access Through Cache
• The data in a datafile is read, as needed, during
normal database operation and stored in the
memory cache of Oracle.
• Modified or new data is not necessarily written to
a datafile immediately. To reduce the amount of
disk access and increase performance, data is
pooled in memory and written to the appropriate
datafiles all at once, as determined by the DBWn
background process of Oracle.
Redo Log Files
• Every Oracle database has a set of two or more
redo log files. This is called the redo log.
• Records all changes made to data. Should a failure
prevent modified data from being permanently
written to the datafiles, the changes can be
obtained from the redo log and work is never lost.
• To protect against a failure involving the redo log
itself, Oracle allows a multiplexed redo log so that
two or more copies of the redo log can be
maintained on different disks.
Control File
• A control file contains entries that specify
the physical structure of the database.
• database name
 names and locations of a database's datafiles and
redo log files
 time stamp of database creation
• Like the redo log, Oracle allows the control
file to be multiplexed for protection of the
control file.
An Oracle Instance
– The combination of the background processes
and memory buffers is called an Oracle
instance.
– A system global area (SGA) is allocated and
Oracle background processes are started at
instance startup.
– The system global area is a an area of memory
used for database information shared by the
database users.
An Oracle Instance
If the user and server processes are on different computers of a network, the user
process and server process communicate using SQL*Net. SQL*Net is Oracle's
interface to standard communications protocols that allows for the proper
transmission of data between computers.
Server Architecture
• An Oracle Server 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 or tasks that work in the
memory of these computers.
The SGA
• Users currently connected to an
Oracle Server share the data in
the system global area.
• For optimal performance, the
entire system global area should
be as large as possible (while
still fitting in real memory)
• Contains: The database buffers
(for data), Redo log buffer (for
log entries), The shared pool
(for SQL), and cursors.
• These areas have fixed sizes
and are created during instance
startup.
User Processes
• A user process is created
and maintained to execute
the software code of an
application program (such
as a Pro*C/C++ program)
or an Oracle tool (such as
sqlplus). The user process
also manages the
communication with the
server processes.
User Processes (Proxies)
• Oracle creates server
processes to handle
requests from connected
user processes.
• Carry out requests of the
associated user process
(e.g., read data into
buffers).
• Oracle can be configured
to vary the number of user
processes per server
process.
User Processes - Dispatcher
• In multithreaded
configurations, The
communication
between the user
processes and the
shared server
processes is optionally
done through the
dispatcher processes
Background Processes - DBWn
• Database Writer
(DBWn) writes
modified blocks from
the database buffer
cache to the datafiles.
• DBWn does not need
to write blocks when a
transaction commits
• DBWn is optimized to
minimize disk writes.
Background Processes - LGWR
• Log Writer (LGWR) The
Log Writer writes redo log
entries to disk.
• Redo log data is generated
in the redo log buffer of
the system global area.
• As transactions commit
and the log buffer fills,
LGWR writes redo log
entries into an online redo
log file.
Background Processes-CKPT
• Checkpoint (CKPT) At
specific times, all
modified database buffers
are written to the datafiles
by DBWn; this is a
checkpoint.
• CKPT is responsible for
signaling DBWn at
checkpoints and updating
all the datafiles and
control files to indicate the
most recent checkpoint.
Bacground Processes - ARCn
• Archiver (ARCn)
copies the online redo
log files to archival
storage when they are
full. (OPTIONAL)
Background Processes - SMON
• System Monitor
(SMON) performs
instance recovery at
instance startup.
• SMON also coalesces
free extents within the
database to make free
space contiguous and
easier to allocate.
Background Processes - PMON
• Process Monitor
(PMON) performs
process recovery when a
user process fails.
• PMON is responsible for
cleaning up the cache and
freeing resources that the
process was using.
• PMON also checks on
dispatcher and server
processes and restarts
them if they have failed.
Bacground Processes - RECO
• Recoverer (RECO)
used to resolve
distributed transactions
pending due to a
network or system
failure in a distributed
database.
Bacground Processes - LMS
• Lock Manager Server
(LMS) used for inter-
instance locking in
Oracle9i Real
Application Clusters.
• Oracle9i Real
Application Clusters
are multiple instances
accessing a common
database residing in
cluster disks.
1 von 53

Recomendados

Oracle Database Introduction von
Oracle Database IntroductionOracle Database Introduction
Oracle Database IntroductionChhom Karath
730 views13 Folien
Introduction to oracle database (basic concepts) von
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Bilal Arshad
3.4K views15 Folien
Oracle architecture with details-yogiji creations von
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsYogiji Creations
3.8K views99 Folien
Lecture2 oracle ppt von
Lecture2 oracle pptLecture2 oracle ppt
Lecture2 oracle pptHitesh Kumar Markam
4.6K views19 Folien
Oracle 10g Introduction 1 von
Oracle 10g Introduction 1Oracle 10g Introduction 1
Oracle 10g Introduction 1Eryk Budi Pratama
4.7K views34 Folien
Oracle dba interview von
Oracle dba interviewOracle dba interview
Oracle dba interviewNaveen P
187 views20 Folien

Más contenido relacionado

Similar a 1650607.ppt

All Oracle-dba-interview-questions von
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questionsNaveen P
337 views47 Folien
An Introduction To Oracle Database von
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle DatabaseMeysam Javadi
846 views36 Folien
Abap data dictionary von
Abap data dictionaryAbap data dictionary
Abap data dictionarySmartGokul4
538 views26 Folien
Getting to know oracle database objects iot, mviews, clusters and more… von
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Aaron Shilo
1.3K views72 Folien
12. oracle database architecture von
12. oracle database architecture12. oracle database architecture
12. oracle database architectureAmrit Kaur
2.9K views30 Folien
Oracle Database Overview von
Oracle Database OverviewOracle Database Overview
Oracle Database Overviewhonglee71
40.1K views42 Folien

Similar a 1650607.ppt(20)

All Oracle-dba-interview-questions von Naveen P
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
Naveen P337 views
An Introduction To Oracle Database von Meysam Javadi
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
Meysam Javadi846 views
Abap data dictionary von SmartGokul4
Abap data dictionaryAbap data dictionary
Abap data dictionary
SmartGokul4538 views
Getting to know oracle database objects iot, mviews, clusters and more… von Aaron Shilo
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
Aaron Shilo1.3K views
12. oracle database architecture von Amrit Kaur
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
Amrit Kaur2.9K views
Oracle Database Overview von honglee71
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
honglee7140.1K views
Implementing the Databese Server session 02 von Guillermo Julca
Implementing the Databese Server session 02Implementing the Databese Server session 02
Implementing the Databese Server session 02
Guillermo Julca239 views
Bt0066 database management system1 von Techglyphs
Bt0066 database management system1Bt0066 database management system1
Bt0066 database management system1
Techglyphs84 views
CS3270 - DATABASE SYSTEM - Lecture (2) von Dilawar Khan
CS3270 - DATABASE SYSTEM - Lecture (2)CS3270 - DATABASE SYSTEM - Lecture (2)
CS3270 - DATABASE SYSTEM - Lecture (2)
Dilawar Khan878 views
Oracle DBA Tutorial for Beginners -Oracle training institute in bangalore von TIB Academy
Oracle DBA Tutorial for Beginners -Oracle training institute in bangaloreOracle DBA Tutorial for Beginners -Oracle training institute in bangalore
Oracle DBA Tutorial for Beginners -Oracle training institute in bangalore
TIB Academy267 views
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer... von Michael Rys
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Michael Rys5.8K views
Oracle Database Architecture von Hamzaakmak1
Oracle Database ArchitectureOracle Database Architecture
Oracle Database Architecture
Hamzaakmak168 views
Introduction to Oracle Database von puja_dhar
Introduction to Oracle DatabaseIntroduction to Oracle Database
Introduction to Oracle Database
puja_dhar21.3K views
DBA 101 : Calling all New Database Administrators (WP) von Gustavo Rene Antunez
DBA 101 : Calling all New Database Administrators (WP)DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)
Sql introduction von vimal_guru
Sql introductionSql introduction
Sql introduction
vimal_guru302 views
Introduction to oracle(2) von Sumit Tambe
Introduction to oracle(2)Introduction to oracle(2)
Introduction to oracle(2)
Sumit Tambe213 views

Más de KalsoomTahir2

005813616.pdf von
005813616.pdf005813616.pdf
005813616.pdfKalsoomTahir2
1 view17 Folien
009576860.pdf von
009576860.pdf009576860.pdf
009576860.pdfKalsoomTahir2
1 view29 Folien
005813185.pdf von
005813185.pdf005813185.pdf
005813185.pdfKalsoomTahir2
1 view45 Folien
HASH FUNCTIONS.pdf von
HASH FUNCTIONS.pdfHASH FUNCTIONS.pdf
HASH FUNCTIONS.pdfKalsoomTahir2
2 views21 Folien
6. McCall's Model.pptx von
6. McCall's Model.pptx6. McCall's Model.pptx
6. McCall's Model.pptxKalsoomTahir2
4 views13 Folien
ch02-Database System Concepts and Architecture.ppt von
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.pptKalsoomTahir2
12 views53 Folien

Más de KalsoomTahir2(20)

ch02-Database System Concepts and Architecture.ppt von KalsoomTahir2
ch02-Database System Concepts and Architecture.pptch02-Database System Concepts and Architecture.ppt
ch02-Database System Concepts and Architecture.ppt
KalsoomTahir212 views
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt von KalsoomTahir2
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir23 views

Último

Class 9 lesson plans von
Class 9 lesson plansClass 9 lesson plans
Class 9 lesson plansTARIQ KHAN
53 views34 Folien
Mineral nutrition and Fertilizer use of Cashew von
 Mineral nutrition and Fertilizer use of Cashew Mineral nutrition and Fertilizer use of Cashew
Mineral nutrition and Fertilizer use of CashewAruna Srikantha Jayawardana
52 views107 Folien
CUNY IT Picciano.pptx von
CUNY IT Picciano.pptxCUNY IT Picciano.pptx
CUNY IT Picciano.pptxapicciano
56 views17 Folien
The Accursed House by Émile Gaboriau von
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile GaboriauDivyaSheta
234 views15 Folien
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... von
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Ms. Pooja Bhandare
166 views45 Folien
Computer Introduction-Lecture06 von
Computer Introduction-Lecture06Computer Introduction-Lecture06
Computer Introduction-Lecture06Dr. Mazin Mohamed alkathiri
117 views12 Folien

Último(20)

Class 9 lesson plans von TARIQ KHAN
Class 9 lesson plansClass 9 lesson plans
Class 9 lesson plans
TARIQ KHAN53 views
CUNY IT Picciano.pptx von apicciano
CUNY IT Picciano.pptxCUNY IT Picciano.pptx
CUNY IT Picciano.pptx
apicciano56 views
The Accursed House by Émile Gaboriau von DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta234 views
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... von Ms. Pooja Bhandare
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Ms. Pooja Bhandare166 views
Narration lesson plan von TARIQ KHAN
Narration lesson planNarration lesson plan
Narration lesson plan
TARIQ KHAN64 views
How to empty an One2many field in Odoo von Celine George
How to empty an One2many field in OdooHow to empty an One2many field in Odoo
How to empty an One2many field in Odoo
Celine George97 views
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx von Ms. Pooja Bhandare
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptxPharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Ms. Pooja Bhandare120 views
Relationship of psychology with other subjects. von palswagata2003
Relationship of psychology with other subjects.Relationship of psychology with other subjects.
Relationship of psychology with other subjects.
palswagata200377 views
GCSE Geography von WestHatch
GCSE GeographyGCSE Geography
GCSE Geography
WestHatch47 views
JQUERY.pdf von ArthyR3
JQUERY.pdfJQUERY.pdf
JQUERY.pdf
ArthyR396 views
The basics - information, data, technology and systems.pdf von JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena1156 views

1650607.ppt

  • 1. The Architecture of Oracle David Konopnicki (Revised by Mordo Shalom – 2004)
  • 2. Source • Oracle 9i Database Concepts – Available on the course Web Site. • We will learn the internal structure of Oracle 9i.
  • 3. The Oracle Server • The Oracle server consists of an Oracle database and an Oracle instance. • Database structure: – Physical DB struct: determined by the OS. Three types of files: datafiles, redo log files, control files. – Logical DB struct: Tablespaces, Schema objects.
  • 4. Database Structure • Structures: Structures are well-defined objects (such as tables, views, indexes, and so on) that store or access the data of a database. Structures and the data contained within them can be manipulated by operations. • Operations: Operations are clearly defined actions that allow users to manipulate the data and structures of a database. The operations on a database must adhere to a predefined set of integrity rules. • Integrity Rules:Integrity rules are the laws that govern which operations are allowed on the data and structures of a database. Integrity rules protect the data and the structures of a database.
  • 5. Schema Object - Table • A table is the basic unit of data storage in an Oracle database. • The tables of a database hold all of the user-accessible data. • Table data is stored in rows and columns. Every table is defined with a table name and set of columns. • Each column is given a column name, a datatype and a width. • Once a table is created, valid rows of data can be inserted into it. The table's rows can then be queried, deleted, or updated. • To enforce defined business rules on a table's data, integrity constraints and triggers can also be defined for a table.
  • 7. Datatypes Data Type Description Column Length (bytes) CHAR (size) Fixed-length character data of length size. Fixed for every row in the table (with trailing blanks); VARCHAR2 (size) Variable-length character data. Variable for each row, up to 2000 bytes per row. NUMBER (p, s) Variable-length numeric data. Variable for each row. The maximum space required for a given column is 21 bytes per row. DATE Fixed-length date and time data Fixed at seven bytes for each row in the table. LONG Variable-length character data. Variable for each row in the table, up to 2^31 - 1 bytes, or two gigabytes, per row. RAW (size) Variable-length raw binary data Variable for each row in the table, up to 255 bytes per row. LONG RAW Variable-length raw binary data. Variable for each row in the table, up to 2^31 - 1 bytes, or two gigabytes, per row. ROWID Binary data representing row addresses. Fixed at six bytes for each row in the table. MLSLABEL Variable-length binary data representing operating system labels. Variable for each row in the table, ranging from two to five bytes per row.
  • 8. Schema Object - View • A view is a custom-tailored presentation of the data in one or more tables. A view can also be thought of as a "stored query". • Like tables, views can be queried, updated, inserted into, and deleted from, with restrictions. All operations performed on a view actually affect the base tables of the view. • Views are often used to do the following:  Provide an additional level of table security by restricting access to a predetermined set of rows and columns of a table.  Hide data complexity.  Simplify commands for the user.  Present the data in a different perspective from that of the base table.  Store complex queries.
  • 10. Other Schema Objects • Indexes are created on one or more columns of a table. Once created, an index is automatically maintained and used by Oracle. Changes to table data are automatically incorporated into all relevant indexes with complete transparency to the users. • Clusters are groups of one or more tables physically stored together because they share common columns and are often used together. • Hash clusters: a row is stored in a hash cluster based on the result of applying a hash function to the row's cluster key value. All rows with the same hash key value are stored together on disk.
  • 11. Indexes Oracle uses B*- tree indexes that are balanced to equalize access times to any row
  • 14. Not Null Integrity Constraint
  • 21. Schema Object – Program Unit • The term "program unit" is used to refer to stored procedures, functions, and packages. • A procedure or function is a set of SQL and PL/SQL (Oracle's procedural language extension to SQL) statements grouped together as an executable unit to perform a specific task. • Stored procedures.
  • 22. The Data Dictionary • An Oracle data dictionary is a set of tables and views that are used as a read-only reference about the database. • Stores information about both the logical and physical structure of the database.  the valid users of an Oracle database  information about integrity constraints defined for tables in the database  how much space is allocated for a schema object and how much of it is being used
  • 25. Data Files • Every Oracle database has one or more physical datafiles. • A database's datafiles contain all the database data (e.g. tables and indexes). • characteristics of datafiles:  Associated with only one database.  Automatically extend when the database runs out of space.  One or more datafiles form a logical unit of database storage called a tablespace.
  • 26. Data Blocks, Extents and Segments
  • 27. Segments • A segment is a set of extents allocated for a certain logical structure. the different types of segments include the following: – Data Segments: All of the table's data is stored in the extents of its data segment. – Index Segments:Each index has an index segment that stores all of its data. – Rollback Segments (Will be deprecated) – Temporary Segments
  • 28. Extents • An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store a specific type of information.
  • 29. Logical Database Structures • Disk Space: Data Blocks – At the finest level of granularity, an Oracle database's data is stored in data blocks. – One data block corresponds to a specific number of bytes of physical database space on disk. (Standard and non-standard block sizes) – A data block size is specified for each Oracle database when the database is created. – A database uses and allocates free database space in Oracle data blocks.
  • 30. Data Blocks • Header: general block info: block address and the type of segment; for example, data, index, or rollback. • Table Directory: info about the tables having rows in this block. • Row Directory: row info about the actual rows in the block • Row Data
  • 31. PCTFREE The PCTFREE parameter is used to set the percentage of a block to be reserved (kept free) for possible updates to rows that already are contained in that block.
  • 32. PCTUSED • After a data block becomes full, as determined by PCTFREE, Oracle does not consider the block for the insertion of new rows until the percentage of the block being used falls below the parameter PCTUSED. Before this value is achieved, Oracle uses the free space of the data block only for updates to rows already contained in the data block.
  • 34. Row Format and Sizes Oracle stores each row of a database table as one or more row pieces
  • 35. Allocation of space in Hash Clusters
  • 36. Access Through Cache • The data in a datafile is read, as needed, during normal database operation and stored in the memory cache of Oracle. • Modified or new data is not necessarily written to a datafile immediately. To reduce the amount of disk access and increase performance, data is pooled in memory and written to the appropriate datafiles all at once, as determined by the DBWn background process of Oracle.
  • 37. Redo Log Files • Every Oracle database has a set of two or more redo log files. This is called the redo log. • Records all changes made to data. Should a failure prevent modified data from being permanently written to the datafiles, the changes can be obtained from the redo log and work is never lost. • To protect against a failure involving the redo log itself, Oracle allows a multiplexed redo log so that two or more copies of the redo log can be maintained on different disks.
  • 38. Control File • A control file contains entries that specify the physical structure of the database. • database name  names and locations of a database's datafiles and redo log files  time stamp of database creation • Like the redo log, Oracle allows the control file to be multiplexed for protection of the control file.
  • 39. An Oracle Instance – The combination of the background processes and memory buffers is called an Oracle instance. – A system global area (SGA) is allocated and Oracle background processes are started at instance startup. – The system global area is a an area of memory used for database information shared by the database users.
  • 40. An Oracle Instance If the user and server processes are on different computers of a network, the user process and server process communicate using SQL*Net. SQL*Net is Oracle's interface to standard communications protocols that allows for the proper transmission of data between computers.
  • 41. Server Architecture • An Oracle Server 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 or tasks that work in the memory of these computers.
  • 42. The SGA • Users currently connected to an Oracle Server share the data in the system global area. • For optimal performance, the entire system global area should be as large as possible (while still fitting in real memory) • Contains: The database buffers (for data), Redo log buffer (for log entries), The shared pool (for SQL), and cursors. • These areas have fixed sizes and are created during instance startup.
  • 43. User Processes • A user process is created and maintained to execute the software code of an application program (such as a Pro*C/C++ program) or an Oracle tool (such as sqlplus). The user process also manages the communication with the server processes.
  • 44. User Processes (Proxies) • Oracle creates server processes to handle requests from connected user processes. • Carry out requests of the associated user process (e.g., read data into buffers). • Oracle can be configured to vary the number of user processes per server process.
  • 45. User Processes - Dispatcher • In multithreaded configurations, The communication between the user processes and the shared server processes is optionally done through the dispatcher processes
  • 46. Background Processes - DBWn • Database Writer (DBWn) writes modified blocks from the database buffer cache to the datafiles. • DBWn does not need to write blocks when a transaction commits • DBWn is optimized to minimize disk writes.
  • 47. Background Processes - LGWR • Log Writer (LGWR) The Log Writer writes redo log entries to disk. • Redo log data is generated in the redo log buffer of the system global area. • As transactions commit and the log buffer fills, LGWR writes redo log entries into an online redo log file.
  • 48. Background Processes-CKPT • Checkpoint (CKPT) At specific times, all modified database buffers are written to the datafiles by DBWn; this is a checkpoint. • CKPT is responsible for signaling DBWn at checkpoints and updating all the datafiles and control files to indicate the most recent checkpoint.
  • 49. Bacground Processes - ARCn • Archiver (ARCn) copies the online redo log files to archival storage when they are full. (OPTIONAL)
  • 50. Background Processes - SMON • System Monitor (SMON) performs instance recovery at instance startup. • SMON also coalesces free extents within the database to make free space contiguous and easier to allocate.
  • 51. Background Processes - PMON • Process Monitor (PMON) performs process recovery when a user process fails. • PMON is responsible for cleaning up the cache and freeing resources that the process was using. • PMON also checks on dispatcher and server processes and restarts them if they have failed.
  • 52. Bacground Processes - RECO • Recoverer (RECO) used to resolve distributed transactions pending due to a network or system failure in a distributed database.
  • 53. Bacground Processes - LMS • Lock Manager Server (LMS) used for inter- instance locking in Oracle9i Real Application Clusters. • Oracle9i Real Application Clusters are multiple instances accessing a common database residing in cluster disks.