DB2恢复

恢复数据库报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.

你可能感兴趣的:(db2)