Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

-:

) (SQL
Oracle Instance & Oracle Database
-:Oracle Instance . Oracle
Instance Oracle Instance
) SGA (System Global Area )(Background Operation

-:Oracle Database
)
(
.Instance
-: Instance
.
-: .SQL


Oracle Server

Oracle Instance Oracle Database

.

Oracle Instance



.memory structure and background processes

) SGA (system global area background processes


.


SQL Instance

SQL*Plus
.

Oracle instance
)(.

Connection

.
.1 Oracle Instance
.
.
.2
) (Oracle Instance /
.
.3
). ( Oracle Instance

.
.
.

Oracle Database

.
. ) ( .
datafiles .1 .
.2 redo log files
.
.3 control files .
.
.
-: Parameter file Oracle
instance
.SGA
-:Password file
. Oracle Instance

-: archived redo log files


Redo log files
) (.

) (
Physical structure
-:
)(control File
)(datafiles
)(Redo log files


Memory structure

SGA System Global Area oracle
instance .Oracle instance
PGA Program Global Area
. Server process

System Global Area


SGA -:
Shared pool
Database buffer cache
Redo log buffer
Other structures
)(lock and latch managements ,Statistical data
SGA
Large pool
Java pool
SGA
.
.SGA

Oracle 9i SGA
Instance . database buffer cache,
shared pool Instance
Instance
. sga_max_size
SGA
SGA -:
Db_cache_size 48MB on UNIX 52 MB on NT
Log_buffer ) (Bytes . redo log buffer
Shared_pool_size SQL PL/SQL.
Large_pool_size Large pool 0
parallel_automatic_tunning true . init.ora
java_pool_size Java pool 24MB
Performance tuning

System Global Area

SGA.
.sga_max_size
granule .SGA
o
o Granule .sga_max_size
granule SGA
sga_max_size-:
4MB SGA 128
16MB ) 128 (

show sga granule SGA 3


granules fixed SGA redo buffers database buffer cache
. Shared pool

Shared Pool
-:
SQL ) (
most recently data definition

Library cache
Data dictionary cache
shared_pool_size

Shared pool

.
.
Shared pool
. SQL ,
, PL/SQL cursor
. shared pool
shared_pool_size alter system set
SGA .sga_max_size

Library Cache
SQL PL/SQL ) (.
.
) ( LRU

Shared SQL Area o
Shared PL/SQL area o
Shared pool sizing
library cache ) (parse SQL
) ( PL/SQL Shared pool
library cache . library cache
LRU library cache
. SQL PL/SQL
.Library Cache
library cache -:
-: shared SQL ) ( execution plane
) ( parse tree SQL .
SQL
. SQL
)
.(execution plan
-: Shared PL/SQL PL/SQL
. .

Data Dictionary Cache

,,,,,, .

) (Parse phase
data dictionary
.
data dictionary
.DML
.shared pool sizing

Database buffer cache

.
.
.LRU
db_cache_size .

database buffer cache


. database buffer cache
) ( database buffer
cache LRU
database buffer cache
.

Database buffer cache


-:
db_cache_size
db_keep_cache_size
db_recycle_cache_size

db_cache_advice
.
v$db_cache_advice

Redo log buffer


) . (
.
.
.
log_buffer


)( insert,update,delete,create,alter and drop
log_buffer

Large pool
.SGA
.shared pool
-:
UGA .
.
.RMAN
LRU
large_pool_size

Java pool
.
.
. java_pool_size
9i .24MB

PGA Program Global Area

.
.
.
.
PGA
. PGA .
SGA PGA .
PGA
PGA instance shared server
dedicated server PGA-:
SQL -: .
SQL . SQL SQL

.SQL SQL cursor -:
o -: .cursor
o -: . insert,update,delete

SQL .
) (dedicated server SQL PGA
. ) (shared server .SGA
SQL user process
SQL open_cursors
.50
-:
.
.

-: SQL ) sort,hash-join,bitmap
( merge and bitmap create
Oracle9i
workarea_size_policy AUTO
pga_aggregrate_target
*_area_size .
Oracle 9i SQL

sort_area_size
hash_area_size
bitmap_merge_area_size
bitmap_create_area_size
.


Process structure
-: .
-: oracle instance .
-: .oracle instance


User process

.
.
.


. SQL*PLUS
. .
(User Program Interface) UPI
.


Server process
.
.
dedicated .shared

.
. dedicated server
. .
shared server .
Oracle Program ) OPI
. (Interface


Background processes
.
-:
PMON
CKPT
SMON
-:
LMDn
RECO
LMON
Snnn
Pnnn
QMNn

-DBWn
-LGWR
-ARCn
-CJQ0
-Dnnn
-LCKn


.
ARCn
.


)Database Writers (DBWn
.database buffer cache
DBWn dirty buffer database buffer cache .
DBWn buffers ) buffers
( .database buffer cache
database buffer cache.
DBWn -:

DBWn Database
buffer cache .


)Log Writers (LGWR
LGWR Redo Log Buffer redo log files
.
. .delete or update
Redo Log Buffer . .
1 Megabyte .Redo Log buffer
DBWn Database buffer cache
.
.
LGWR
) (commit .

LGWR
.


System Monitor
Oracle instance SGA
. .Oracle Instance instance
Oracle instance .
Instance -:
.1 .
. SGA
) (
.
.
.2 .
.
.3 SMON
.
SMON .
, , .
.


Process Monitor




) dead
( dispatchers

-:
.
.
.
dead dispatchers.


Checkpoint CKPT
CKPT
, .
buffers Database buffer cache
. ) (
DBWn .instance
buffers database buffer cache . Oracle 9i

. CKPT
.
-:

.
.instance
.
) (committed
.
CKPT ,
, , .
-:
CKPT .
CKPT
-:
DBWn .

.
.

)Archiver (ARCn
.
.ARCHIVELOG
.


ARCn . ,

. ARCn ) (
.
.


ARCHIVELOGE .NOARCHIVELOG
NOARCHIVELOG

).( log switch ARCn
.
. instance instance SGA
.
.
ARCHIVELOG ARCHIVELOG
.


.


Logical structure
.
TablespacesSegmentsExtentsDatablock

-:
Tablespace .
Tablespace .Segments
Segments .Extents
Extents ).(logical blocks
) (Block .

, ,
.(control file, online redo log files, and datafiles).
.Tablespaces, Segments, Extents, and Data blocks
Tablespaces:
.Tablespaces

.tablespaces
Tablespace .

Tablespace
.datafiles
Tablespace .Segments
Tablespace ) (Online .
system tablespace Tablespace undo segment
tablespace ).(offline
tablespace .
) (DATAFILES -:
Tablespace
datafiles
.
) (data file tablespace .
) (data file Tablespace
.

Tablespace .
Segments:
Segment .Tablespace
Tablespace .Segments
Segment Tablespace
.Tablespace
Extents:
Segment .Extent
Extents .Segment
o Segment Extent .
o Segment .Extents
o Extents .
Extent ) (data blocks.
Extent .
Data Block:

.
.

.

.
db_block_size
.

.
.

SQL
Processing SQL statements
instance-:
o
o
.SQL
o .
o DML .
o .commit
.SQL
SQL
.
)(Parse
o .
o , ,.
o .
o ).(Execution plan
):(Bind .
):(Execute .
):(Fetch .
:DML
) -: (Parse .
)-:(Bind .
)-:(Execute
o database buffer cache
. database buffer cache
o .
. DML
.
o .
o .
.database buffer cache database buffer cache
dirty buffer .
o delete Insert . delete
Insert
.
:DDL
DDL DML. DDL
.Data Dictionary

You might also like