2009년 7월 29일 수요일

사용자 설정

▣ 사용자 생성 by Em

  1. 사용자 role 설정
  2. 시스템 관련 권한 설정
  3. 객체 관련 권한 설정
  4. 사용자가 사용할 수 있는 공간 지정
  5. Resource group 지정
  6. Proxy users

▣ Role 설정

▣ Privileges 설정

   

▣ 사용자 생성 by Script

   

▣ Script로 생성 시 접속 권한 설정

   

▣ with admin option

※ with admin option은 중간 사용자의 권한을 해제 하더라도 중간 사용자의 하위 사용자에게는 권한 해제의 영향을 받지 않는다.

   

▣ with grant option

   

※ with grant option은 중간 사용자의 권한을 해제하면 하위 사용자의 권한도 해체 된다.

Checkpoint and Redo Tuning

▣ 개요

   

   

▣ setting 방법

1. mttr advice로 간격 결정

2. redo log file size advice 실행

3. mttr을 0으로 바꿈(무한)

4. 완성 : 튀는 것 사라짐

   

▣ 10g 방식의 check 빈도 설정

1. 예상 mttr 값 결정

   

   

   

3. 모든 redologGroup의 크기를 redolog Advisor가 지시한 값으로 변경

- 주의 : current Group은 inactive로 바꾸고 설정할 것

   

   

4. fast_start_mttr_target=0 으로 바꿔 준다.

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월 27일 월요일

테이블 스페이스 관리(생성/삭제)

▣ by Script

   

   

▣ by Em

   

   

   

   

▣ 테이블 스페이스 상태 변경(online/offline)

   

   

▣ 각 t/s 의 데이터 파일과 파일번호 출력

   

   

▣ users t/s 사용하는 유저리스트 출력

   

   

▣ example t/s 를 사용하는 객체 중 가능 용량이 큰 객체 출력

   

   

▣ 내부에 사용중인 객체가 있는 테이블 스페이스 삭제 (예제 1)

   

   

▣ 내부에 사용중인 객체가 있는 테이블 스페이스 삭제 (예제 2)