MySQL Enterprise Backup User's Guide (Version 4.1.3)
The mysql.backup_progress
table lets you
monitor backup jobs as they run, and the
mysql.backup_history
table lets you see the
results of completed jobs.
To skip updating these tables for a backup operation, use the
--no-history-logging
option.
backup_progress
Table
Each row in the backup_progress
table records a
state change or message from a running backup job. The
backup_progress
table has the following
columns:
mysql> DESCRIBE mysql.backup_progress; +---------------+---------------+------+-----+-------------------+-----------------------------------------------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------+------+-----+-------------------+-----------------------------------------------+ | backup_id | bigint(20) | NO | | NULL | | | tool_name | varchar(4096) | NO | | NULL | | | error_code | int(11) | NO | | NULL | | | error_message | varchar(4096) | NO | | NULL | | | current_time | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP | | current_state | varchar(200) | NO | | NULL | | +---------------+---------------+------+-----+-------------------+-----------------------------------------------+ 6 rows in set (0.00 sec)
Because the CSV storage engine cannot represent
NULL
values directly, the logs use a -1 value
instead, for example in the binlog_pos
column
if binary logging is not enabled.
Use the backup_id
value to group together the
information for a single backup operation, and to correlate with
the corresponding row in the backup_history
table after the job is finished.
Use the error_code
and
error_message
values to track the progress of
the job, and detect if a serious error occurs that requires
stopping the backup operation.
Use the current_time
and
current_state
values to measure how long each
part of the backup operation takes, to help with planning the time
intervals for future backups.
Because the table is created with the CSV storage engine, you can
query it from SQL, or parse the corresponding
.CSV
file with an application or script.
backup_history
Table
Each row in the backup_history
table records
the details of one completed backup, produced by
mysqlbackup command. The
backup_history
table has the following columns:
mysql> DESC backup_history; +---------------------------+---------------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------------+---------------+------+-----+---------------------+-------+ | backup_id | bigint(20) | NO | PRI | NULL | | | tool_name | varchar(4096) | NO | | NULL | | | start_time | timestamp | NO | | 0000-00-00 00:00:00 | | | end_time | timestamp | NO | | 0000-00-00 00:00:00 | | | binlog_pos | bigint(20) | NO | | NULL | | | binlog_file | varchar(255) | NO | | NULL | | | compression_level | int(11) | NO | | NULL | | | engines | varchar(100) | NO | | NULL | | | innodb_data_file_path | varchar(2048) | NO | | NULL | | | innodb_file_format | varchar(100) | NO | | NULL | | | start_lsn | bigint(20) | NO | | NULL | | | end_lsn | bigint(20) | NO | | NULL | | | incremental_base_lsn | bigint(20) | NO | | NULL | | | backup_type | varchar(50) | NO | | NULL | | | backup_format | varchar(50) | NO | | NULL | | | mysql_data_dir | varchar(2048) | NO | | NULL | | | innodb_data_home_dir | varchar(2048) | NO | | NULL | | | innodb_log_group_home_dir | varchar(2048) | NO | | NULL | | | innodb_log_files_in_group | varchar(100) | NO | | NULL | | | innodb_log_file_size | varchar(100) | NO | | NULL | | | backup_destination | varchar(4096) | NO | | NULL | | | lock_time | double(7,3) | NO | | NULL | | | exit_state | varchar(10) | NO | | NULL | | | last_error | varchar(4096) | NO | | NULL | | | last_error_code | int(11) | NO | | NULL | | | start_time_utc | bigint(20) | NO | | NULL | | | end_time_utc | bigint(20) | NO | | NULL | | | consistency_time_utc | bigint(20) | NO | | NULL | | | meb_version | varchar(20) | NO | | 0.0.0 | | | server_uuid | varchar(36) | NO | | NULL | | +---------------------------+---------------+------+-----+---------------------+-------+ 30 rows in set (0.00 sec)
Because a successful backup is always recorded as such in the
backup_history
table, a failure in the
apply-log
phase of a
backup-and-apply-log
command is not
reflected in the table. It is always important to check the
output of mysqlbackup to see if an operation
is completed fully without an error.
Use the end_lsn
value to automate operations
related to incremental backups. When you take a full or
incremental backup, you can specify the end LSN from that backup
as the starting LSN for the next incremental backup with the
start-lsn
option (an alternative to
specifying the start LSN value is to use the
incremental-base
option).
Use the values that correspond to backup-related configuration
settings, such as mysql_data_dir
,
innodb_data_home_dir
, and
backup_destination
, to confirm that the backups
are using the right source and destination directories.
Use the values exit_state
,
last_error
, and
last_error_code
to evaluate the success or
failure of each backup.
If last_error
is 'NO_ERROR'
,
the backup operation was successful. In case of any errors, you
can retrieve the full list of errors for that backup operation
from the backup_progress
table.