DB2恢復

sqiutz發表於2010-03-09

恢復資料庫報ROLL-FORWARD錯誤(SQL57019),則執行日誌回滾

restore db dbname from 路徑 taken at *** logtarget 路徑

日誌路徑即DATABASE DIRECTORY+SQLLOGDIR(通過list database directory on /home/db2inst1獲取)

還原後執行 rollforward db dbname to end of logs and stop

注意這是線上備份資料庫造成的錯誤,離線沒有此錯誤丟擲 注意資料夾的許可權允許日誌寫入 另附上恢復時出現的異常情況: SQL2581N Restore is unable to extract log files or restore a log directory from the backup image to the specified path. Reason code rc. Explanation An error occurred while attempting to extract a log file from the backup image. This could be because one of the following reasons: 1 The backup image does not include logs. 2 The log target path specified could be full or invalid. 3 A log file name in the backup image matches a log file which already exists in the log target path. 4 There was an I/O error while trying to write the file. 5 The primary log directory on disk contains log files that will be destroyed by restore. 6 The mirror log directory on disk contains log files that will be destroyed by restore. User response 1 Check that the backup image contains log files to be restored. If it does not, resubmit the command without specifying the LOGTARGET parameter. 2 Check that the specified LOGTARGET path is valid and that there is enough space available for all log files in the backup image to be extracted. Resubmit the command. 3 Check that there are no existing log files in the log target path with the same name as log files in the backup image being restored. Resubmit the command. 4 See the DB2 diagnostics log for additional information. Try to resolve the problem and resubmit the command. 5 or 6 You can do one of the following: Manually copy or move the log files from the primary log directory so you can archive those log files; and then call the RESTORE DATABASE command again. Call the RESTORE DATABASE command again with the LOGTARGET parameter and either the INCLUDE FORCE parameter or the EXCLUDE FORCE parameter.

相關文章