This function reads a specified log file up to the specified label and applies its content to the database.
MCO_RET mco_translog_apply (mco_db_h db,
char const *file_path,
int label_id);
db
file_path
label_id
MCO_TRANSLOG_ALL_LABELS.This function reads a specified log file up to the specified label and, if the log file is “compatible”,
applies its content to the database. To determine whether the log file is compatible, first the dictionary,
runtime and data sizes are checked, and finally the database transaction counter is compared to the
transaction counter stored in the log file. The log file compatibility can first be checked by calling the
function mco_translog_query_info().
Note that the label_id argument refers to labels inserted into the log by calls to
mco_translog_label(). If labels are present in the log, specifying the
desired label number allows the log to be restored up to that label. The constant
MCO_TRANSLOG_ALL_LABELS means to read the complete log. (For example, it is possible to write
labels once an hour and then restore and inspect the database state at a specified hour.)
MCO_S_OK
MCO_E_TL_LOG_NOT_OPENED
MCO_E_TL_IO_ERROR
MCO_E_VERS_MISMATCH
MCO_E_TL_INVFORMAT
MCO_S_TL_INVDATA
MCO_E_NOMEM