SlideShare a Scribd company logo
1 of 5
Download to read offline
WareValley
http://www.WareValley.com
Database Audit and Protection [ DB 접근통제 ]
Database Encryption [ DB 암호화 ]
Database Vulnerability Assessment [ DB 취약점 분석 ]
Database SQL Query Approval [ DB 작업결재 ]
Database Performance Monitoring and Management [ DB 성능관리 및 개발 ]
WareValley
Oracle Architecture
DB Buffer Cache
오렌지팀 윤석준 선임연구원
Database security and management, WareValley.
http://www.WareValley.com
Database Buffer Cache & Block 단위 I/O
 사용자가 입력한 데이터를 Datafile에 저장하고
읽는 과정에서 거쳐가는 Cache 영역
 블록 단위 I/O
- Oracle에서는 모든 것이 Block 단위로 I/O (Buffer, Datafile)
- INDEX : Single block read
Full Scan : Multiblock read
DBWR : Multiblock write
(Dirty Buffer Block 을 주기적으로 Datafile로 Write)
- 1 Row의 1 Column만 필요하더라도 1 Block 전체를 읽어야 한다.
=> I/O 성능과 튜닝을 하는데 있어서 가장 중요한 것은
Access하는 Block 수를 줄이는 것이다. (Record 수가 아님)
RECYCLE DEFAULT
Data Buffer Cache
Database security and management, WareValley.
http://www.WareValley.com
Buffer Block & Hash Bucket
 Buffer Block : 바둑판 같은 배열에 Block 저장
 Hash Bucket
Data Block 주소
Hash 함수 계산 결과
Latch
LRU Chain
Buffer 여유 공간이 없을 때
가장 사용한지 오래된
(Least Recently Used)
Block을 해제
Hash Chain에 여러 개의
Process가 동시에 접근하지
못하도록 하기 위한
Lock 매커니즘
Hash Chain
같은 Hash 값을 가지는
Block 들의
Linked List
Database security and management, WareValley.
http://www.WareValley.com
Data Buffer Cache Status
Data Buffer Cache
LRU 작동
설명
Dirty Buffer
Buffer에 캐싱된 후 변경되었지만, Disk에 기록되지 않은 버퍼.
Disk에 기록하는 순간 Free Buffer가 된다.
Pinned Buffer 현재 I/O 중인 버퍼 ( Lock 중인 버퍼 이기도 함)
Free Buffer
아직 Data가 없거나, 있더라도 지워도 되는 Buffer.
Data 변경이 일어나는 순간 Dirty Buffer가 된다.
Database security and management, WareValley.
http://www.WareValley.com
Buffer Lock & Buffer Pinning
 Buffer Lock
Latch 획득 Lock 설정 Data Access
Latch 해제
Shared 모드 : 읽기만 할 때
Exclusive 모드 : 데이터 변경이 필요하거나, SELECT만 하더라도 Cleanout이 필요할때
Latch 획득 Lock 해제
Latch 해제
Pinned Buffer
 Buffer Busy Waits
Latch 획득 Lock 시도 Buffer Lock Waiter List
Latch 해제
 Buffer Pinning : DB Call이 유지되는 동안 Latch 획득 과정을 생략. Block Read 회수를 줄여주는 기능
하나의 DB Call (Parse Call, Execute Call, Fetch Call) 내에서만 유효

More Related Content

More from Seok-joon Yun

[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
Seok-joon Yun
 

More from Seok-joon Yun (20)

Doing math with python.ch07
Doing math with python.ch07Doing math with python.ch07
Doing math with python.ch07
 
Doing math with python.ch06
Doing math with python.ch06Doing math with python.ch06
Doing math with python.ch06
 
Doing math with python.ch05
Doing math with python.ch05Doing math with python.ch05
Doing math with python.ch05
 
Doing math with python.ch04
Doing math with python.ch04Doing math with python.ch04
Doing math with python.ch04
 
Doing math with python.ch03
Doing math with python.ch03Doing math with python.ch03
Doing math with python.ch03
 
Doing mathwithpython.ch02
Doing mathwithpython.ch02Doing mathwithpython.ch02
Doing mathwithpython.ch02
 
Doing math with python.ch01
Doing math with python.ch01Doing math with python.ch01
Doing math with python.ch01
 
Pro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScriptPro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScript
 
C++ Concurrency in Action 9-2 Interrupting threads
C++ Concurrency in Action 9-2 Interrupting threadsC++ Concurrency in Action 9-2 Interrupting threads
C++ Concurrency in Action 9-2 Interrupting threads
 
Welcome to Modern C++
Welcome to Modern C++Welcome to Modern C++
Welcome to Modern C++
 
[2015-07-20-윤석준] Oracle 성능 관리 2
[2015-07-20-윤석준] Oracle 성능 관리 2[2015-07-20-윤석준] Oracle 성능 관리 2
[2015-07-20-윤석준] Oracle 성능 관리 2
 
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
 
오렌지6.0 교육자료
오렌지6.0 교육자료오렌지6.0 교육자료
오렌지6.0 교육자료
 
[2015-06-26] Oracle 성능 최적화 및 품질 고도화 3
[2015-06-26] Oracle 성능 최적화 및 품질 고도화 3[2015-06-26] Oracle 성능 최적화 및 품질 고도화 3
[2015-06-26] Oracle 성능 최적화 및 품질 고도화 3
 
[2015-06-19] Oracle 성능 최적화 및 품질 고도화 2
[2015-06-19] Oracle 성능 최적화 및 품질 고도화 2[2015-06-19] Oracle 성능 최적화 및 품질 고도화 2
[2015-06-19] Oracle 성능 최적화 및 품질 고도화 2
 
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
 
[2015-06-05] Oracle TX Lock
[2015-06-05] Oracle TX Lock[2015-06-05] Oracle TX Lock
[2015-06-05] Oracle TX Lock
 
[KOSSA] C++ Programming - 18th Study - STL #4
[KOSSA] C++ Programming - 18th Study - STL #4[KOSSA] C++ Programming - 18th Study - STL #4
[KOSSA] C++ Programming - 18th Study - STL #4
 
[KOSSA] C++ Programming - 17th Study - STL #3
[KOSSA] C++ Programming - 17th Study - STL #3[KOSSA] C++ Programming - 17th Study - STL #3
[KOSSA] C++ Programming - 17th Study - STL #3
 
[KOSSA] C++ Programming - 16th Study - STL #2
[KOSSA] C++ Programming - 16th Study - STL #2[KOSSA] C++ Programming - 16th Study - STL #2
[KOSSA] C++ Programming - 16th Study - STL #2
 

[2015 03-27] db buffer cache

  • 1. WareValley http://www.WareValley.com Database Audit and Protection [ DB 접근통제 ] Database Encryption [ DB 암호화 ] Database Vulnerability Assessment [ DB 취약점 분석 ] Database SQL Query Approval [ DB 작업결재 ] Database Performance Monitoring and Management [ DB 성능관리 및 개발 ] WareValley Oracle Architecture DB Buffer Cache 오렌지팀 윤석준 선임연구원
  • 2. Database security and management, WareValley. http://www.WareValley.com Database Buffer Cache & Block 단위 I/O  사용자가 입력한 데이터를 Datafile에 저장하고 읽는 과정에서 거쳐가는 Cache 영역  블록 단위 I/O - Oracle에서는 모든 것이 Block 단위로 I/O (Buffer, Datafile) - INDEX : Single block read Full Scan : Multiblock read DBWR : Multiblock write (Dirty Buffer Block 을 주기적으로 Datafile로 Write) - 1 Row의 1 Column만 필요하더라도 1 Block 전체를 읽어야 한다. => I/O 성능과 튜닝을 하는데 있어서 가장 중요한 것은 Access하는 Block 수를 줄이는 것이다. (Record 수가 아님) RECYCLE DEFAULT Data Buffer Cache
  • 3. Database security and management, WareValley. http://www.WareValley.com Buffer Block & Hash Bucket  Buffer Block : 바둑판 같은 배열에 Block 저장  Hash Bucket Data Block 주소 Hash 함수 계산 결과 Latch LRU Chain Buffer 여유 공간이 없을 때 가장 사용한지 오래된 (Least Recently Used) Block을 해제 Hash Chain에 여러 개의 Process가 동시에 접근하지 못하도록 하기 위한 Lock 매커니즘 Hash Chain 같은 Hash 값을 가지는 Block 들의 Linked List
  • 4. Database security and management, WareValley. http://www.WareValley.com Data Buffer Cache Status Data Buffer Cache LRU 작동 설명 Dirty Buffer Buffer에 캐싱된 후 변경되었지만, Disk에 기록되지 않은 버퍼. Disk에 기록하는 순간 Free Buffer가 된다. Pinned Buffer 현재 I/O 중인 버퍼 ( Lock 중인 버퍼 이기도 함) Free Buffer 아직 Data가 없거나, 있더라도 지워도 되는 Buffer. Data 변경이 일어나는 순간 Dirty Buffer가 된다.
  • 5. Database security and management, WareValley. http://www.WareValley.com Buffer Lock & Buffer Pinning  Buffer Lock Latch 획득 Lock 설정 Data Access Latch 해제 Shared 모드 : 읽기만 할 때 Exclusive 모드 : 데이터 변경이 필요하거나, SELECT만 하더라도 Cleanout이 필요할때 Latch 획득 Lock 해제 Latch 해제 Pinned Buffer  Buffer Busy Waits Latch 획득 Lock 시도 Buffer Lock Waiter List Latch 해제  Buffer Pinning : DB Call이 유지되는 동안 Latch 획득 과정을 생략. Block Read 회수를 줄여주는 기능 하나의 DB Call (Parse Call, Execute Call, Fetch Call) 내에서만 유효