DB2日誌相關

abstractcyj發表於2020-12-22

日誌控制檔案:

SQLOGCTL.LFH

例:

[root@dporacle01 ~]# find / -name SQLOGCTL*

/database/db2inst1/NODE0000/SQL00001/SQLOGCTL.LFH.1

/database/db2inst1/NODE0000/SQL00001/SQLOGCTL.LFH.2

LSN(Log Sequence Number)

此檔案有點類似與oracle的控制檔案,但是這裡記錄了minbufLSN, lowtranLSN以及其他重要的LSN, 崩潰恢復時,會從這裡讀取兩個LSN, 用於確定崩潰日誌應用的起點。(Oracle在做checkpoint時,也會將SCN更新到控制檔案)


DB2獲取日誌相關配置方法:

[db2inst1@dporacle01 ~]$ db2 get db cfg for testdb | grep "log"

 User exit for logging status                            = NO

 Catalog cache size (4KB)              (CATALOGCACHE_SZ) = 300

 Number of primary log files                (LOGPRIMARY) = 13

 Number of secondary log files               (LOGSECOND) = 4

 Changed path to log files                  (NEWLOGPATH) = 

 Path to log files                                       = /database/db2inst1/NODE0000/SQL00001/SQLOGDIR/

 Overflow log path                     (OVERFLOWLOGPATH) = 

 Mirror log path                         (MIRRORLOGPATH) = 

 First active log file                                   = 

 Block log on disk full                (BLK_LOG_DSK_FUL) = NO

 Block non logged operations            (BLOCKNONLOGGED) = NO

 Percent max primary log space by transaction  (MAX_LOG) = 0

 Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0

 Percent log file reclaimed before soft chckpt (SOFTMAX) = 520

 User exit for logging enabled                (USEREXIT) = OFF

 HADR log write synchronization mode     (HADR_SYNCMODE) = NEARSYNC

 First log archive method                 (LOGARCHMETH1) = OFF

 Options for logarchmeth1                  (LOGARCHOPT1) = 

 Second log archive method                (LOGARCHMETH2) = OFF

 Options for logarchmeth2                  (LOGARCHOPT2) = 

 Failover log archive path                (FAILARCHPATH) = 

 Number of log archive retries on error   (NUMARCHRETRY) = 5


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-2744266/,如需轉載,請註明出處,否則將追究法律責任。

相關文章