ORACLE9i_性能调优基础四(Buffer Cache )
2015-04-19 21:21
513 查看
Object
1.Employ the buffer cache sizing advisor2.Describle how the buffer cache is used by different Oracle processes
3.Create and manage different buffer caches
4.Monitor the use of the buffer caches
5.Identify and resolve buffer cache performance problems
Oracle Architecture
Buffer Cache Characteristics
Dynamic Advisory Parameter
Views
SQL> select name, size_for_estimate,estd_physical_read_factor,estd_physical_reads from v$db_cache_advice order by name, size_for_estimate;
Managing Buffer Cache
Tuning Goals and Techniques
Diagnostic Tools
Performance Indicators
SQL> select name,value from V$sysstat where name like '%free buffer in%'; NAME VALUE ---------------------------------------- ---------- free buffer inspected 0
SQL> select event, total_waits FROM v$system_event where event in('free buffer waits','buffer busy waits'); EVENT TOTAL_WAITS ---------------------------------------------------------------- ----------- buffer busy waits 9
SQL> select name,parameter1,parameter2,parameter3 from v$event_name where name='buffer busy waits'; NAME PARAMETER1 PARAMETER2 PARAMETER3 ---------------------------------------- ---------- ---------- ---------- buffer busy waits file# block# class#
Buffer Busy Waits Cause
Free Buffer Waits Caus
Measuring Cache Hit Ratio
Guidelines of Hit Ratio
1.Full table scans2.Data or application design
3.Large table with random access
4.Uneven distribution of cace hist
Hit Ratio Isn't Everything
1.A badly tuned database can still have a hit ratio of 99% or better2.Hit ratio is only one part in determining tuning performance
3.Hit ratio does not determine whether a database is aptimally tuned
4.Use the oracle wait interface to examine what is causing a bottleneck
a.v$session_wait
b.v$session_event
c.v$system_event
5.Tune SQL statements
Increase the Cache Size
1.Increase thecache size ratio under the following conditions:a.Any wait events have been tuned
b.SQL statements have been tuned
c.There is no undue page faulting
d.The previous increase of the buffer cache was effective
e.Low cache hit ratio
Enabling MBP
Calculating Hit Ratio
Identifying Pool Segments
1.Keep poola.Blocks are accessed repeatedly
b.Segment size is less than 10% of the default buffer pool size
2.Recycle pool
a.Blocks are not resued outside of transaction
b.Segment size is more than twice the default buffer pool size
Dictionary Views
select id, name, block_size, buffers from v$buffer_pool;
Caching Tables:
1.Enable caching during full table sacns by:a.Creating the tble with the CACHE clause
b.Altering the table with the CACHE clause
c.Using the CACHE hint in a query
2.Guideline : Do not overcrowd the buffer cache
3.Use a keep pool
原因: 进行全表扫描的时候 一般都会放在LRU list的末端 被淘汰出去,但是我们希望能在buffer里多留一段时间,因为这些表都是小表,而且常用,所以就有 Caching Talbes的由来 和 pin不一样, Cache table只是保证被淘汰出去的概率少点
ASSM
1.Manages free space automatically inside database setments2.Tracks segment free/used space with bitmaps instead of free lists
3.Provides better space utilization, especiall for objects with highly varying size rows
4.Specified when creating a tablespace
5.Supported by Oracle Enterprise Manager
Free Lists (手动管理方式 已过时)
Multiple DBWn Processes
1.Multiple DB Writer(DBWn)processes:a.Can be deployed with DB_WRITER_PROCESSES(DBW0 to DBW9)
b.Can be useful for SMP systems with large numbers of CPUS
c.Can not concurrently be used with multiple I/O slaves
2.The DBA can turn asynchronous I/O on or off wit the DISK_ASYNCH_IO parameter
Resize Instance
show parameter sga_max_size NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sga_max_size big integer 272M
Unit of Allocation
1.In the dynamic SGA model, the unit of memory allocation is called a granule.2.SGA memory is tracked in granules by SGA components
3.A granule is a unit of contiguous virtual memory allocation
4.Use v$buffer_pool to monitor size of the buffer caches
SQL> select name,block_size,resize_state,current_size,buffers from v$buffer_pool; NAME BLOCK_SIZE RESIZE_STA CURRENT_SIZE BUFFERS -------------------- ---------- ---------- ------------ ---------- DEFAULT 8192 STATIC 176 21956
相关文章推荐
- ORACLE9i_性能调优基础九(Managing Statistics)
- ORACLE9i_性能调优基础五(Sizing Other SGA structures)
- ORACLE9i_性能调优基础六(Optimizing Sort Operations)
- ORACLE9i_性能调优基础三(Tuning the Shared Pool)
- ORACLE9i_性能调优基础二(Database Configuration and IO Issues)
- ORACLE9i_性能调优基础十四(LOCK)
- ORACLE9i_性能调优基础八(SQL tuning)
- ORACLE9i_性能调优基础十二(Application Tuning)
- ORACLE9i_性能调优基础十三(Materialized Views)
- ORACLE9i_性能调优基础十(Oracle Blocks Efficiently)
- ORACLE9i_性能调优基础十一(Data Storage Structures)
- ORACLE9i_性能调优基础一(Diagnostic and Tuning Tools)
- ORACLE9i_性能调优基础七(Using Resource Manager)
- MYSQL数据库性能调优之一:调优技术基础
- ORACLE 性能调优基础--OWI
- oracle性能调优之--Buffer cache 的调整与优化
- 《Spark商业案例与性能调优实战100课》第18课:商业案例之NBA篮球运动员大数据分析代码实战之核心基础数据项编写
- Drools规则工作流引擎全面开发教程(基础语法、性能调优、常用工具)
- Redis基础、高级特性与性能调优
- Redis基础、高级特性与性能调优-Redis的数据结构和相关常用命令