Comments - Flashback

3 years, 4 months ago Wagner Bianchi
This comment has the status of 'removed' and can only be seen by you.

Works well in my labs; it's not that robust yet, but can get data back as consistent as possible:

[BIANCHI LABS] root@opmdb01: mysql # mariadb -e 'select * from wb.n;' +---+------+

ab

+---+------+

1A
2B
3C
4D
5F

+---+------+ [BIANCHI LABS] root@opmdb01: mysql # mysqlbinlog /var/lib/mysql/mariadb-bin.000001 -vv --start-position=849 --stop-position=942 -d wb -T n --flashback > /root/flashback.sql [BIANCHI LABS] root@opmdb01: mysql # mariadb < /root/flashback.sql [BIANCHI LABS] root@opmdb01: mysql # mariadb -e 'select * from wb.n;' +---+------+

ab

+---+------+

1A
2B
3C
4D
5E

+---+------+

The important piece of the docs:

"The real work of Flashback is done by mysqlbinlog with --flashback. This causes events to be translated: INSERT to DELETE, DELETE to INSERT, and for UPDATEs the before and after images are swapped.

When executing mysqlbinlog with --flashback, the Flashback events will be stored in memory. You should make sure your server has enough memory for this feature."

For real production environments, the DBA still needs to go in and analyse positions and datatime when a certain event occurred so to apply the --flashback or -B flag to revert data.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.