头图

作者:俊达

备份部分表
如果实例设置了参数innodb_file_per_table,xtrabackup可以备份部分表。

通过--tables,--tables-file,--databases,--databases-file等参数指定需要备份的表。

备份demo数据库下的表:

# xtrabackup --backup -u root -H 127.0.0.1 -pabc123 -P 3380 --tables='demo[.].*' --target-dir=/data/backup/partial 2>/data/backup/partial/backup.log

查看日志,确认备份成功:

# tail -2 /data/backup/partial/backup.log
2023-06-27T11:41:57.616173+08:00 0 [Note] [MY-011825] [Xtrabackup] Transaction log of lsn (61246195) to (61251119) was copied.
2023-06-27T11:41:57.837563+08:00 0 [Note] [MY-011825] [Xtrabackup] completed OK!

通过这种方式备份的数据库,只能通过import tablespace的方式恢复。具体操作方法参考上一篇文章。

更多技术信息请查看云掣官网https://yunche.pro/?t=yrgw


云掣科技
40 声望12 粉丝

专注于云msp服务