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這兩個參數來管理資料庫日志的歸檔。