활발이님 | 기타 | 2013-11-11 18:02:07
archive mod에서 test를 하다가 궁금한점에 대해 질문 드립니다.
db 환경은 아래와 같습니다.
Log file size (4KB) (LOGFILSIZ) = 25
Number of primary log files (LOGPRIMARY) = 13
Number of secondary log files (LOGSECOND) = 4
Changed path to log files (NEWLOGPATH) =
Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/
First active log file = S0000022.LOG
Group commit count (MINCOMMIT) = 1
Percent log file reclaimed before soft chckpt (SOFTMAX) = 520
Log retain for recovery enabled (LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = OFF
First log archive method (LOGARCHMETH1) = DISK:/archive/
Options for logarchmeth1 (LOGARCHOPT1) =
Second log archive method (LOGARCHMETH2) = OFF
Options for logarchmeth2 (LOGARCHOPT2) =
---------------------------------------------------------------------------------------------------------------------------------
data를 4번에 걸쳐 insert를 합니다.
처음 db 상태
Tablespace Space Total # of High
Name Used Size Extents WaterMark
TESTTBS 640.0K 1.0G 8,192 640.0K 640.0K 0% 0% Normal
File number of first active log = 0
File number of last active log = 12
File number of current active log = 2
-active log (/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/)
S0000000.LOG S0000002.LOG S0000004.LOG S0000006.LOG S0000008.LOG S0000010.LOG S0000012.LOG
S0000001.LOG S0000003.LOG S0000005.LOG S0000007.LOG S0000009.LOG S0000011.LOG
-archive log (/archive/)
S0000000.LOG S0000001.LOG
1번째 insert
Tablespace Space Total # of High
Name Used Size Extents WaterMark
TESTTBS 896.0K 1.0G 8,192 896.0K 896.0K 0% 0% Normal
File number of first active log = 3
File number of last active log = 15
File number of current active log = 8
-active log (/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/)
S0000003.LOG S0000005.LOG S0000007.LOG S0000009.LOG S0000011.LOG S0000013.LOG S0000015.LOG
S0000004.LOG S0000006.LOG S0000008.LOG S0000010.LOG S0000012.LOG S0000014.LOG
-archive log (/archive/)
S0000000.LOG S0000001.LOG S0000002.LOG S0000003.LOG S0000004.LOG S0000005.LOG S0000006.LOG S0000007.LOG
2번째 insert
Tablespace Space Total # of High
Name Used Size Extents WaterMark
TESTTBS 1.1M 1.0G 8,192 1.1M 1.1M 0% 0% Normal
File number of first active log = 9
File number of last active log = 21
File number of current active log = 14
-active log (/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/)
S0000009.LOG S0000011.LOG S0000013.LOG S0000015.LOG S0000017.LOG S0000019.LOG S0000021.LOG
S0000010.LOG S0000012.LOG S0000014.LOG S0000016.LOG S0000018.LOG S0000020.LOG
-archive log (/archive/)
S0000000.LOG S0000002.LOG S0000004.LOG S0000006.LOG S0000008.LOG S0000010.LOG S0000012.LOG
S0000001.LOG S0000003.LOG S0000005.LOG S0000007.LOG S0000009.LOG S0000011.LOG S0000013.LOG
3번째 insert
Tablespace Space Total # of High
Name Used Size Extents WaterMark
TESTTBS 1.3M 1.0G 8,192 1.3M 1.3M 0% 0% Normal
File number of first active log = 15
File number of last active log = 27
File number of current active log = 21
-active log (/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/)
S0000015.LOG S0000017.LOG S0000019.LOG S0000021.LOG S0000023.LOG S0000025.LOG S0000027.LOG
S0000016.LOG S0000018.LOG S0000020.LOG S0000022.LOG S0000024.LOG S0000026.LOG
-archive log (/archive/)
S0000000.LOG S0000003.LOG S0000006.LOG S0000009.LOG S0000012.LOG S0000015.LOG S0000018.LOG
S0000001.LOG S0000004.LOG S0000007.LOG S0000010.LOG S0000013.LOG S0000016.LOG S0000019.LOG
S0000002.LOG S0000005.LOG S0000008.LOG S0000011.LOG S0000014.LOG S0000017.LOG S0000020.LOG
4번째 insert
Tablespace Space Total # of High
Name Used Size Extents WaterMark
TESTTBS 1.6M 1.0G 8,192 1.6M 1.6M 0% 0% Normal
File number of first active log = 22
File number of last active log = 34
File number of current active log = 27
-active log (/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/)
S0000022.LOG S0000024.LOG S0000026.LOG S0000028.LOG S0000030.LOG S0000032.LOG S0000034.LOG
S0000023.LOG S0000025.LOG S0000027.LOG S0000029.LOG S0000031.LOG S0000033.LOG
-archive log (/archive/)
S0000000.LOG S0000003.LOG S0000006.LOG S0000009.LOG S0000012.LOG S0000015.LOG S0000018.LOG S0000021.LOG S0000024.LOG
S0000001.LOG S0000004.LOG S0000007.LOG S0000010.LOG S0000013.LOG S0000016.LOG S0000019.LOG S0000022.LOG S0000025.LOG
S0000002.LOG S0000005.LOG S0000008.LOG S0000011.LOG S0000014.LOG S0000017.LOG S0000020.LOG S0000023.LOG S0000026.LOG
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
testtbs에 축척되는 size를 보면 한 insert 트랜잭션당 256k정도의 data가 들어가고요
primarylog 는 13개고 한개당 100k로 지정해 놓았습니다. (archivelog 를 생성하기 위해 작게 잡았습니다)
싱글 디비 한개 생성하고 한 트랜잭션 insert 하고 commit 후 test진행하였습니다.
(다른 insert나 붙는 application은 없습니다)
여기서 궁금한 것은
1. 1번째 insert 부분을 보면 data가 insert되어 현재 activelog를 8번을 사용하고 있고
그래서 아카이빙도 7번까지 되었습니다. 여기서 아카이빙 되면 (/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/)
경로에 있는 로그 3~7번은 지워지고 16~20번의 log가 생성되어야 되는것 아닌가요?
(제가 생각한것이 2번째 insert때 일어납니다...)
이러한 archiving 시점 및 activelog를의 삭제 시점을 알고 싶습니다.