Documente Academic
Documente Profesional
Documente Cultură
Components
Objectives
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 Instance
An Oracle Instance:
– Is a means to access an Oracle database
– Always opens one and only one database
– Consists of memory and background process
structures
Instance
Shared Pool SGA
Library Memory
Database Redo Log
Cache
Buffer Cache Buffer structures
Data Dictionary
Cache Java Pool Large Pool
Background
PMON SMON DBWR LGWR CKPT Others process structures
Establishing a Connection
and Creating a Session
Connecting to an Oracle Instance:
– Establishing a user connection
– Creating a session
Server
Connection process
established Session created
User Oracle Server
process
Database user
Oracle Database
An Oracle database:
– Is a collection of data that is treated as a unit
– Consists of three file types
Oracle Database
Redo
Parameter Datafiles Control Log
Archived
files files
file Log files
Password
file
Physical Structure
The physical structure includes three types
of files:
– Control files
– Datafiles
– Redo log files
Header
Control
files
Datafiles
(includes
Online
Data
Redo Log
Dictionary)
files
Memory Structure
– SGA is dynamic
– Sized by the SGA_MAX_SIZE parameter
– Allocated and tracked in granules by SGA
components
Contiguous virtual memory allocation
Granule size based on total estimated
SGA_MAX_SIZE
Shared Pool
– 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
ALTER SYSTEM SET Cache
SHARED_POOL_SIZE = 64M;
Library Cache
Database Buffer
Cache
Database Buffer Cache
Server
process
User
process
Connection
established
Database user
Server Process
Database user
Background Processes
Database
System Monitor (SMON)
Instance
Responsibilities:
SGA
– Instance recovery
Rolls forward
changes in redo
logs
Opens database for
SMON user access
Rolls back
uncommitted
Redo transactions
Datafiles Control Log
files files – Coalesces free space
– Deallocates temporary
segments
Database
Process Monitor (PMON)
Instance Cleans up after
SGA
failed processes by:
– Rolling back the
transaction
– Releasing locks
PMON
– Releasing other
resources
– Restarting dead
PGA area dispatchers
Checkpoint (CKPT)
Instance Responsible for:
SGA
– Signaling DBWn at
checkpoints
– Updating datafile
headers with
DBWn LGWR CKPT checkpoint
information
– Updating control
Redo files with
Datafiles Control Log
files files checkpoint
information
Database
Archiver (ARCn)
Redo ARCn
Datafiles Control Log Archived
files files Redo Log
files
Logical Structure
Extent Blocks
Tablespaces and 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
Creating Tablespaces
Causes a checkpoint
Data available only for read operations
Objects can be dropped from tablespace
Taking a Tablespace Offline
– ALTER TABLESPACE
Tablespace must be offline
Target datafiles must exist
ALTER TABLESPACE userdata RENAME
DATAFILE '/u01/oradata/userdata01.dbf'
TO '/u02/oradata/userdata01.dbf';
– ALTER DATABASE
Database must be mounted
Target datafile must exist
ALTER DATABASE RENAME
FILE '/u01/oradata/system01.dbf'
TO '/u03/oradata/system01.dbf';
Dropping Tablespaces