Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Oracle
Quick-Start to the Oracle DB
Architecture
Oracle Server Architecture
An Oracle server:
• Is a database Oracle Server
management system
that provides an open,
comprehensive,
integrated approach to
information management
• Consists of an Oracle
instance and an Oracle
database
Oracle RDBMS Architecture
Oracle Instance
SMON SNPn LCKn RECO Snnn Dnnn
PMON
Pnnn
SGA Redo Log
Shared Pool Database Buffer Cache Buffer
DBWR CKPT
LGWR ARCH
Server User
Processes Processes
Oracle Database
• Parameter Files
• Control Files
• Data Files
• Redo Log Files
• Undo Data Files
PFILE Example
# Initialization Parameter File: initdb01.ora
db_name = db01
instance_name = db01
control_files = (
/u03/oradata/db01/control01db01.ctl,
/u03/oradata/db01/control02db01.ctl)
db_block_size = 4096
db_block_buffers = 500
shared_pool_size = 31457280 # 30M Shared Pool
db_files = 1024
background_dump_dest = /u05/oracle10g/admin/db01/bdump
user_dump_dest = /u05/oracle10g/admin/db01/udump
core_dump_dest = /u05/oracle10g/admin/db01/cdump
undo_management = auto
undo_tablespace = undtbs
. . .
SPFILE spfileSID.ora
• Binary file with the ability to make changes
persistent across shutdown and startup
• Maintained by the Oracle server
• Records parameter value changes made
with the ALTER SYSTEM command
• Can specify whether the change being
made is temporary or persistent
• Values can be deleted or reset to allow an
instance to revert to the default value
Control File
The control file is a binary file that defines the
current state of the physical database..
• Is read at MOUNT stage
• Is required to operate
• Is linked to a single database
Database
• Should be multiplexed
Control
• Maintains integrity of database files
Database Files
• Parameter Files
• Control Files
• Data Files
• Tablespaces
• Data Types
• Tables
• Indexes
• Redo Log Files
• Undo Data Files
Resizing a Tablespace
100M
100M 200M
100M
app_data_01.dbf app_data_02.dbf app_data_03.dbf
Classification of Indexes
• Logical
• Single column or concatenated
• Unique or nonunique
• Function Based
• Domain Based
• Physical
• Partitioned or nonpartitioned
• B-tree
• Normal or reverse key
• Bitmap
Handout
B-Tree Index Handout
Index entry
Root
Branch
Table File 3
Block 10
Block 11
Index Block 12
start end
key ROWID ROWID bitmap
<Blue, 10.0.3, 12.8.3, 1000100100010010100>
<Green, 10.0.3, 12.8.3, 0001010000100100000>
<Red, 10.0.3, 12.8.3, 0100000011000001001>
<Yellow, 10.0.3, 12.8.3, 0010001000001000010>
Handout
Comparing B-Tree and Handout
Bitmap Indexes
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
Redo
log files
How Redo Logs Work
Old image
Table
New
image
Undo segment
Update transaction
Handout
Undo Segments: Purpose Handout
Transaction rollback
SELECT *
Table FROM table
New image
Image at start of statement
Memory Structure
LGWR ARCH
Server User
Processes Processes
Oracle Database
Database
System Monitor (SMON)
Instance
Responsibilities:
SGA • Instance recovery:
• Rolls forward
changes in the
redo logs
• Opens the
database for user
SMON access
• Rolls back
uncommitted
transactions
Data Control Redo log • Coalesces free space
files files files
every 3 sec
• Deallocates temporary
Database segments
Process Monitor (PMON)
Instance
SGA
Cleans up after
failed processes by:
• Rolling back the
transaction
• Releasing locks
PMON • Releasing other
resources
• Restarts dead
dispatchers
PGA area
Checkpoint (CKPT)
Instance
SGA
Responsible for:
Redo Log • Signalling DBWn
Buffer at checkpoints
• Updating datafile
DBWn LGWR
DWW0 CKPT headers with
checkpoint
information
Data
files
Control
files
Redo log
files • Updating control
files with
checkpoint
information
Archiver (ARCn)
Extent Blocks
Database Schema
• A schema is a named
collection of objects Schema Objects
Tables
• A user is created, and a
corresponding schema Triggers
can be created Constraints
Indexes
• User can be associated
only with one schema Views
Sequences
• Username and schema
Stored program units
are often used
interchangeably Synonyms
User-defined data types
• Users are not
Database links
necessarily associated
with a schema
Introducing Oracle 10g
Microsoft Other
15% 14,3%
IBM
22%
Oracle
48.6%
* http://www.developer.com/db/article.php/10920_3599691_1
Oracle Database 10g
Express Edition
(Oracle Database XE)
You need a FREE database?
• Need a “starter” database for the next
generation of developers, DBAs, ISVs
• Free to download
• Free to develop
• Free to deploy
• Free to distribute
Oracle Database 10g Express Edition
• Small-footprint starter database
• Runtime criteria (hard-coded limitations):
• 4GB user data (plus Oracle system data)
• Single instance per machine
• May be installed on a multiple CPU server,
but only executes on 1 CPU
• May be installed on a server with any amount of
memory, but will only use up to 1GB RAM
• 32-bit Linux and Windows
• Oracle Application Express (HTML DB)
• Free OTN online community forum
SQL Developer
(formerly known as Project Raptor)
Released March 2006!
• Database Development
Productivity Tool
• Targeted at the DBA -
Developer
• Rich Client SQL plus
functionality
• Requires no Oracle home;
simple to install
• Included in the DB licence
Oracle Application Express
• Quick assembly of reporting and
data entry applications
• No programming or scripting
• Instant deployment on the Web
• Use the full power of Oracle
Database 10g
• Addresses MS Access proliferation
problem
• Included in the DB licence
Oracle is difficult to install?
Install
• CD contents (10g R2 – 1xDVD)
• Database CD
• Enterprise Edition
• Standard Edition
• Personal Edition (Windows)
• Client CD
• e.g. Enterprise Manager Java Console (~ 'old' EM)
• Companion CD
• Demos / examples
• Legato
• Workflow
• Accelerators
• Application Express (Formerly known as HTML DB)
• Oracle HTTP server (Apache)
Oracle Database 10g for
Windows
Windows Platform Support
OS 9iR2 10gR1 10gR2
Windows NT Yes Yes
Windows 2000 Yes Yes Yes
Windows XP Professional Yes Yes Yes
Windows Server 2003, 32-bit Yes Yes Yes
Windows XP & Windows Server Yes Yes Yes
2003 for 64-bit Itanium Systems
Windows XP & Windows Server Developer Yes
2003, x64 Editions (Intel EM64T Release
and AMD Opteron) (May 04)
Integration with Windows Services
60% Oracle
IBM
40%
Others
20%
0%
2003 2004 2005