레이블이 Memory관련인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Memory관련인 게시물을 표시합니다. 모든 게시물 표시

2009년 7월 29일 수요일

ASMM

▣ 최소 할당 단위(Granule)

   

   

   

sga_target = 0 으로 바꾸는 방법

   

dynamic component 값이 적용된것, sga_target 0으로 바꿔 놓을 것

ASMM 켤 때 주의 사항 : shared_pool_size 줄여줄것 -> 그 공간만큼 db_cache_size가 잡힌다.

※ ASMM 끌 때는 설정값 확인한다.

2009년 7월 28일 화요일

Buffer cache

Buffer Cache 부족시 증상

a. Latch : cache buffer chains

b. Latch : cache buffer LRU chains

c. Buffer busy waits

d. Read waits

e. Free buffer waits

f. Cache hit ratio

   

▣ hot Block 검색

관련질의

select * from (select owner,object_name,

object_type,statistic_name,sum(value)

from v$segment_statistics

group by owner,object_name,object_type,statistic_name

order by sum(value) desc)

where rownum<10

   

▣ Buffer Busy Waits

   

▣ Calculating the Buffer Cache Hit Ratio(캐시 값 확인)

   

▣ Read Waits

※ Timeouts이 없다는 것은 정상

   

▣ db_cache_advice의 value를 on 해야 뷰 확인 가능

   

▣ Caching tables 생성 방법

Alter table 테이블명 cache;

and

EM 지원

   

▣ Automatically Tuned Multiblock Read

아무리 크게 잡혀 있어도 64*1024 만큼 돈다

   

db_file_multiblock_read_count에서의 value는 8로 하나 16으로 하나 값은 64*1024에 따르기 때문에 8로 해도 상관 없음

   

▣ 버퍼캐시 모니터링 하는 뷰

Shared Pool-2

▣ Mutex

메모리가 모자라면 객체 1개당 sql문 1개 shared pool에 배치

생성여부 : wait의 존재여부 확인 가능(mutext의 발생은 sharedpool이 부족함을 나타낸다)

▣ Data Dictionary Cache 적중률

※ Row cache 모자라면 shared pool 늘려줌

   

Tuning the Shared pool Reserved Space (큰 객체 사용시에만 사용)

if

Request_failures

  

  

Action

>0 and increasing

And

Request_misses>0

Increase shared_pool_reserved_size

>0 and increasing

And

Free_memory=>50% of shared_pool_reserved_size

Increase shared_pool_size

=0

Or

Free_memory=>50% of shared_pool_reserved_size

Decrease shared_pool_reserved_size

   

Keeping Large Objects

자주 쓰고 큰 객체는 메모리에 계속 상주하게 할것

   

관련질의

select * from v$db_object_cache

where sharable_mem>10000

and(type='PACKAGE' or type='PACKAGE BODY' or

type='FUNCTION' or type='PROCEDURE')

and kept='NO'

/

 

execute dbms_shared_pool.keep('package_name');

2009년 7월 26일 일요일

Shared pool

Shared pool operation

a. library cache : 파싱된 sql

b. dictionary cache : 객체번호, 주소

c. shared pool이 부족하면 기존의 내용 지워짐

d. memory chunk가 생성된다.

   

▣ shared pool에 속한 영역의 할당량 혹은 사용가능 용량

   

▣ KGH : 커널에서 가지고 있는 heap영역 -> OS : 전체 양에서 사용량을 빼고 남는 메모리, 사용할수 있는 메모리

   

아래와 같이 용량을 비워둠

작은 용량의 청크가 들어오면 빈 공간을 free list로 날리고 할당할 수 있다

큰 용량의 청크가 들어왔을 때 사용하기 위해 reserved area를 미리 존재한다.

   

   

select * from x$ksuse where addr='30F0A9B4';

이렇게 사용하면 내용이 많기 때문에 내부 질의 볼때는 print_table.sql 질의를 사용한다.

   

   

커서 적중 부분 설정값 확인

   

   

▣ Cursor_sharing 사용하지 않았을 경우

   

Cursor sharing 사용

   

@cursor_sharing_test1과 2의 결과 비교해 볼것

질의

S SYS> select * from v$system_event where event='latch: library cache';

   

EVENT

--------------------------------------------------------------------------------------------------------------

TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT TIME_WAITED_MICRO EVENT_ID WAIT_CLASS_ID WAIT_CLASS#

----------- -------------- ----------- ------------ ----------------- ---------- ------------- -----------

WAIT_CLASS

--------------------------------------------------------------------------------------------------------------

latch: library cache

931 0 1820 1.95 18197060 589947255 3875070507 4

Concurrency

reloads

   

invalidations

   

   

   

Terminology

  1. Gets : 적중횟수(soft parsing+cursor 적중포함)
  2. Pins : 실행횟수
  3. Reloads : 없어서 비적중
  4. Invalidation : 수정되서 비적중

    ※ 3, 4 : hard parsing