Oracle学习笔记<<2>>

本文详细介绍了Oracle数据库的内存结构,包括System Global Area (SGA) 和 Program Global Area (PGA)两个主要区域。SGA进一步分为多个组件如Shared Pool、Database Buffer Cache、Redo Log Buffer等,而PGA则为每个连接到Oracle数据库的用户进程预留了内存。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[size=large][color=blue]Oralce Architectural Components[/color][/size]
[size=medium][color=red][b]Meroy Structure[/b][/color][/size]
Oracle’s memory structure consists of two memory areas known as :
System Grobal Area(SGA):allocated at instance start up,and is fundamental component of an Oralce instance
Program Global Area(PGA):allocated where the server process is started


[size=medium][b][color=red]SGA:System Grobal Area[/color][/b][/size]
Is dynamic,sized
Size 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
SGA可以动态改变,最大的尺寸可以通过SGA_MAX_SIZE来改变。Granules是SGA的最小单位。SGA是连续的内存区域,并且最大不能超过 SGA_MAX_SIZE.
可以通过show sga 查看SGA 大小.
可以通过语句
select component,granule_size from v$sga_dynamic_components.
查看granule的大小

1.The SGA consists of several memory structures:
Shared Pool: SHARED_POOL_SIZE
Database Buffer Cache: DB_CACHE_SIZE
Redo Log Buffer: LOG_BUFFER
Other structures(for example ,lock and latch management,statistical data)
2.There are two additional memory structures that can be configured within the SGA:
Large Pool: LARGE_POOL_SIZE
Java Pool: JAVA_POOL_SIZE

[color=red][b]Shared Pool[/b][/color]
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
每一个SQL将被解析,制定执行计划。解析SQL语句被存到共享池中。包含两部分重要内容。为Library Cache和Data Dictionary Cache


[b]Library Cache[/b]
Stores information about the most recently used SQL and PL/SQL statements
Enables the sharing of commonly used statements
Is manager by a least recently user(LRU) algorithm
Consists of two structures:
Shared SQL area
Shared PL/SQL area
Size determined by the Shared Pool sizing
存储的是经过编译解析后的SQL语句和PL/SQL语句的内容.
包含两部分。一部分是SQL area ,一部分是PL/SQL area
大小由Shared Pool 管理

[b]Data Dictionary Cache[/b]
A collection of the most recently used definitions in the database
Includes information about database files, tables , indexes , columns , users, privileges ,and others database objects.
During the parse phase ,the server process looks at the data dictionary for information to resolve object names and validate access
Improves response time on queries and DML
Size determined by the Shared Pool sizing.
数据字典是使用最频繁的,各种数据操作都需要使用到.各种数据库信息被保存在这里.用来响应各种查询和DML操作
大小由Shared Pool 管理


[b][color=red]Database Buffer Cache[/color][/b]
Stores copies of data block that have been retrieved from the data files
Enables great performance gains when you bobtain and update data
Manager through an LRU algorithm
DB_BLOCK_SIZE determines primary block size
缓存数据文件中的数据。
Consists of independent subcaches
DB_CACHE_SIZE
DB_KEEP_CACHE_SIZE
DB_RECYCLE_CACHE_SIZE
Can be dynamically resized
DB_CACHE_ADVICE Set to gather statistics for predicting different cache size behavior
Statistics displayed by V$DB_CACHE_ADVICE


[color=red][b]Redo Log Buffer[/b][/color]
Records all changes made to the database data blocks
Primary purpose is recovery
Changer recorded within are called redo entries
Redo entries contain information to reconstruct or redo changes
Size defined by LOG_BUFFER
主要用来恢复数据文件。每做一次操作,就会形成一个操作记录。


[b][color=red]Large Pool[/color][/b]
An optional area of memory in the SGA
Relieves the burden placed on the Shared Pool
Used For:
Session memory(UGA) for the Shared Server
I/O server processes
Backup and restore operations or RMAN
Parallel execution message buffers
PARALLEL_ATUOMATIC_TUNING set to TRUE
Dose not use an LRU list
Sized by LARGE_POOL_SIZE
Can be dynamically resized


[b][color=red]JAVA Pool[/color][/b]
Services parsing requirements for java commands
Requied if installing and using java
Size by JAVA_POOL_SIZE parameter


[b][size=medium][color=red]PGA: Program Global Area[/color][/size][/b]
Memory reserved for each user process connecting to an Oracle database
Allocated when a process is created
Deal located when the process is terminated
Used by only one process
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值