๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
ORACLE/ADMIN

[Oracle] SGA Redo Log Buffer ๋ฆฌ๋‘ ๋ฒ„ํผ ์‚ฌ์šฉ์›๋ฆฌ :: ๋งˆ์ด์ž๋ชฝ

by ๐ŸŒปโ™š 2020. 4. 2.

Database Buffer Cache ์ฐธ์กฐ๊ธ€

 

[Oracle] SGA Database Buffer Cache DBC ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฒ„ํผ ์บ์‹œ ์‚ฌ์šฉ์›๋ฆฌ :: ๋งˆ์ด์ž๋ชฝ

SGA Shared Pool ๊ด€๋ จ ๋งํฌ [Oracle] SGA Shared Pool ๊ณต์œ ํ’€ ์‚ฌ์šฉ ์›๋ฆฌ :: ๋งˆ์ด์ž๋ชฝ Shared Pool Library Cache : parsing๋œ ์ •๋ณด๋ฅผ ์ €์žฅ Data Dictionary Cache : Data Dictionary์˜ ์ •๋ณด๋ฅผ ์ €์žฅ --> Hard Parse..

myjamong.tistory.com

 

 

Redo Log Buffer

์ด์ „ ๊ธ€๋“ค์—์„œ๋Š” Shared Pool๊ณผ Database Buffer Cache์— ๋Œ€ํ•ด์„œ ํ•˜๋‚˜์˜ SELECT๋ฌธ์„ ํ†ตํ•ด ์–ด๋–ค ์›๋ฆฌ๋กœ ์‚ฌ์šฉ๋˜๋Š”์ง€ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค. ์ด๋ฒˆ ๊ธ€์—์„œ๋Š” UPDATE๋ฌธ์„ ๊ฐ–๊ณ  ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์žˆ์„ ๋•Œ Redo Log Buffer์—์„œ ์–ด๋–ค ์ž‘์—…์„ ํ•˜๋Š”์ง€ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

Redo Log Buffer๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ๋ฐœ์ƒํ•˜๋Š” ๋ชจ๋“  ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ €์žฅํ•˜๋Š” ๊ณต๊ฐ„์ž…๋‹ˆ๋‹ค. SELECT๋ฌธ์„ ์ œ์™ธํ•œ ๋‹ค๋ฅธ DML์ด๋‚˜ DDL๊ณผ ๊ฐ™์ด ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์žˆ๋Š” ๋ชจ๋“  ๋‚ด์šฉ์„ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ๋น„์ •์ƒ์ ์ธ ๋ฐฉ๋ฒ•์œผ๋กœ ์„œ๋ฒ„๊ฐ€ ๋‚ด๋ ค๊ฐ”์„๋•Œ Recovery ํšŒ๋ณต์„ ์œ„ํ•ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.

 

 

 

Update Process

Redo Log Buffer๋„ Execute๋‹จ๊ณ„์—์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

 

 

 

 

1. Query๋ฌธ ์‹คํ–‰ ์š”์ฒญ

2. Parse ์ž‘์—… ์™„๋ฃŒ

3. Data Block์„ DBC๋กœ ๋ณต์‚ฌ

4. ํ–‰๋ ˆ๋ฒจ LOCK

5. REDO LOG BUFFER์— ๋ณ€๊ฒฝ์‚ฌํ•ญ ๊ธฐ๋ก

6. UNDO BLOCK ๋ณ€๊ฒฝ์‚ฌํ•ญ ์ €์žฅ

์œ„์˜ ๋ชจ๋“  ๋‹จ๊ณ„๊ฐ€ ๋๋‚˜๋ฉด ์ตœ์ข…์ ์œผ๋กœ DBC์˜ ๋ฐ์ดํ„ฐ ๋‚ด์šฉ์„ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

 

 

 

LGWR(Log Writer) Background Process

LGWR Background Process๋Š” Log Buffer์— ์žˆ๋Š” ๋‚ด์šฉ์„ Log File์— ๊ธฐ๋กํ•˜๋Š” ์ผ์„ ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ์‹œ์ ์—์„œ ์ž‘์—…ํ•ฉ๋‹ˆ๋‹ค.

1. Commit ๋˜์—ˆ์„ ๋•Œ
์‚ฌ์šฉ์ž๊ฐ€ Commitํ•˜๊ฒŒ๋˜๋ฉด ๊ฐ€์žฅ ๋จผ์ € Log Buffer์— ์žˆ๋Š” ๋‚ด์šฉ์„ Log File์—๋‹ค ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” Fast Commit์„ ์œ„ํ•ด DBW๊ฐ€ ์•„๋‹Œ LGWR์ด ํ•ฉ๋‹ˆ๋‹ค. DBW๋Š” ์• ์ดˆ์— Random Access๋กœ ์ž‘์—…์„ ํ•ด์„œ ํ•˜๋‚˜ํ•˜๋‚˜์”ฉ Data Block์„ ์ฐพ์•„๊ฐ‘๋‹ˆ๋‹ค. Log Buffer๋Š” ์ˆœ์ฐจ์ ์œผ๋กœ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๊ธฐ๋กํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. LGWR Process๋กœ Sequentail Access๋ฅผ ํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ๋” ๋น ๋ฅธ ์†๋„๋ก ๊ธฐ๋ก์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

2. Log Buffer๊ฐ€ 1/3 ์ฐผ์„ ๋•Œ

3. Log Buffer๊ฐ€ 1MB ์‚ฌ์šฉํ–ˆ์„ ๋•Œ

4. timeout
LGWR๊ฐ€ ์•„์ง ์•ˆ์“ด ๋‚ด์šฉ์„ DBW๊ฐ€ ์“ฐ๋ฉด ์•ˆ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ DBW๊ฐ€ ์ž‘์—…์„ ์‹œ์ž‘ํ•  ๋•Œ LGWR์—๊ฒŒ ๋ฏธ๋ฆฌ ์‹ ํ˜ธ๋ฅผ ์ค๋‹ˆ๋‹ค.

์ƒํ™ฉ๊ณผ ์‹œ์ ์œผ๋กœ ๋ด์„œ๋Š” LGWR์€ ์‰ฌ์ง€์•Š๊ณ  ๊ณ„์† ์ผ์„ ํ•ด์ค„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

Log Switch ์ฐธ์กฐ๊ธ€

 

[Oracle] redo.log ์„œ๋ฒ„ ๋‚ด๋ถ€์  Log Switch ์ž‘๋™ ์›๋ฆฌ :: ๋งˆ์ด์ž๋ชฝ

Redo Log Buffer Update ์ฐธ์กฐ๊ธ€ [Oracle] SGA Redo Log Buffer ๋ฆฌ๋‘ ๋ฒ„ํผ ์‚ฌ์šฉ์›๋ฆฌ :: ๋งˆ์ด์ž๋ชฝ Redo Log Buffer ์ด์ „ ๊ธ€๋“ค์—์„œ๋Š” Shared Pool๊ณผ Database Buffer Cache์— ๋Œ€ํ•ด์„œ ํ•˜๋‚˜์˜ SELECT๋ฌธ์„ ํ†ตํ•ด ์–ด๋–ค ์›..

myjamong.tistory.com

 

 

๋Œ“๊ธ€