2010-01-29-10.19.25.544030+480 I54728390A401 LEVEL: Error
PID : 434422 TID : 1 PROC : db2logmgr (MYDB) 0
INSTANCE: db2inst1 NODE : 000
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3160
MESSAGE : Failed to archive log file S0002000.LOG to USEREXIT from
/home/db2inst1/db2inst1/NODE0000/SQL00004/SQLOGDIR/ with rc = 8.
2010-01-29-10.19.25.544197+480 I54728792A380 LEVEL: Warning
FUNCTION: DB2 UDB, data protection services, sqlpgRetryFailedArchive, probe:4780
MESSAGE : Still unable to archive log file 2000 due to rc 8 for LOGARCHMETH1
using method 4 and target .
2010-01-29-10.19.34.944387+480 I54729173A401 LEVEL: Error
MESSAGE : Failed to archive log file S0002132.LOG to USEREXIT from
2010-01-29-10.19.34.944553+480 I54729575A319 LEVEL: Error
FUNCTION: DB2 UDB, data protection services, sqlpgArchivePendingLogs, probe:1500
MESSAGE : Log archive failed with rc 8 for LOGARCHMETH1.
解決思路 :
1 從 Failed to archive log file S0002132.LOG to USEREXIT from 。。。看出歸檔到userexit 指定的路徑失敗!是以應該檢視userexit 指定的歸檔路徑是什麼地方。
2 編譯使用者出口程式
先改成C檔案,并設定權限
mv /home/db2inst/sqllib/samples/c/db2uext.cdisk /home/db2inst/db2uext.c
chmod 777 /home/db2inst/db2uext.c
然後修改該檔案,主要修改以下幾個關鍵項
vi /home/db2inst/db2uext.c
#define ARCHIVE_PATH "/u/" /* path must end with a slash */
#define RETRIEVE_PATH "/u/" /* path must end with a slash */
#define AUDIT_ACTIVE 1 /* enable audit trail logging */
#define ERROR_ACTIVE 1 /* enable error trail logging */
#define AUDIT_ERROR_PATH "/u/" /* path must end with a slash */
#define AUDIT_ERROR_ATTR "a" /* append to text file */
#define BUFFER_SIZE 32 /* # of 4K pages for output buffer */
3 看出這裡的歸檔路徑,(實際上該資料庫是由TSM來管理備份的),TSM 失效,導緻歸檔失敗!
解決辦法:
将userexit 設定為off ,将logarchmeth1設定為本地磁盤路徑,DISK:具體的路徑
附上:
userexit 參數的含義:當使用該參數時,日志的歸檔和檢索使用使用者出口程式自動執行的,這個出口程式是由db2uext2 調用的。這個程式用于将線上歸檔日志移動到與活動日志目錄不同的目錄中,或者移動到另一個媒介(此案例是在TSM 指定 的目錄)。當在ROLLFORARD 操作期間需要某些離線歸檔日志時,這個程式還可以用于将歸檔日志取出到活動日志目錄中。在windows下,db2uext2 必須在sqllib/bin 目錄下,在unix下,db2uext2 必須在sqllib/adm目錄下。
v9 版本以後 就不再推薦使用該參數了!而是使用 logarchmeth1 和logarchmeth2這兩個參數來管理資料庫日志的歸檔。