Follow dba-ninja.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

dba-ninja.com Links

Dba_db2_button

Sqlserver_dba_button

A simple guide to MySQL backup history

27 June,2022 by Rambler

The main tables for accessing mysql backup history is : mysql.backup_progress    & mysql.backup_history   , when the mysqlbackup command is used 

Use the backup_progress table to review messages & changes related to a  mysql backup running job. 

Executing describe mysql.backup_progress   returns:


+---------------+---------------+------+-----+-------------------+-----------------------------+
| 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 | on update CURRENT_TIMESTAMP |
| current_state | varchar(200) | NO | | NULL | |
+---------------+---------------+------+-----+-------------------+-----------------------------+
6 rows in set (0.00 sec)

 

Use the backup_history  table - to view details of backups   generated by the mysqlbackup

Executing describe mysql.backup_history   returns:

+---------------------------+---------------+------+-----+---------------------+-------+
| 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)

 

To view the backup history ordered by the latest end_time use:

select * from mysql.backup_history order by start_time desc;

Columns notes:

tool_name  If you want to view the command used for the backup , check the tool_name column

backup_type & backup_format   Along with reviewing the backup_type options (FULL, PARTIAL,INCREMENTAL,TTS) check the backup_format options (IMAGE or DIRECTORY).   If it's a DIRECTORY use these instructions - How to MySQL restore files from a directory backup to their original location


Author: Rambler (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on A simple guide to MySQL backup history


dba-ninja.com