Skip to main content

Posts

Showing posts with the label MySQL Enterprise Backup

MySQL Enterprise Incremental Backup Python | MEB Incremental Bckup Python | mysqlbackup

 MySQL Enterprise Incremental Backup: ## Script Name : MEB_IncreBkup.py ## Script Purpose: Execute incremental backup of the MySQL Enterprise, compress it, check status, if script fail send notification, and email backup log # Import python libraries import os import time import datetime import pipes import socket host = socket . gethostname () date = time . strftime ( '%Y%b%d-%H%M%S' ) date1 = time . strftime ( '%Y-%m-%d.%H-%M-%S' ) incremental = "--incremental --incremental-base=history:last_backup" backupdir = "--backup-dir=/tmp/backup" + date backupimage = "--backup-image=/mysql/NFS" + host + "....

MySQL Enterprise Full Backup - MEB Full Backup Python script

MySQL Enterprise Backup - MEB - Python script: ## Script Name : bkup.py ## Script Purpose: Execute full backup of the MySQL Enterprise, compress it, check backup job status, email backup log, if backup fail send notification # Import python libraries import os import time import datetime import pipes import socket host = socket.gethostname() date = time.strftime('%Y%b%d-%H%M%S') date1 = time.strftime('%Y-%m-%d.%H-%M-%S') backupdir="--backup-dir=/tmp/backup" + date backupimage="--backup-image=/mysql/<NFS>/"+host+".mts.backup.mbi_" + date image="backup-to-image --compress" logfile="/tmp/backup"+date+...

MEB - MySQL Enterprise Backup

MEB - MySQL Enterprise Backup: Backup using backup command: #/bin/mysqlbackup \ --user=<id> \ --password=<code> \ --socket=/mysql/mysql.sock \ --backup-dir=/mysql/mysql-backup-dir-`date +'%F_%H-%M-%S'` backup it will create directory /mysql/mysql-backup-dir-`date +'%F_%H-%M-%S'` --> backup the database in directory /datadir which resides inside the /mysql/mysql-backup-dir.... Backup and apply log: Add following connection id, code, and socket in /etc/my.cnf file [mysqlbackup] host=localhost user=<id> password=<code> socket=/mysql/mysql.sock #/bin/mysqlbackup \ --backup-dir=/mysql/mysql-backup-dir-`date +'%F_%H-%M-%S'` backup-and-apply-log Command will create directory /mysql/mysql-backup-dir... --> backup the database --> Restore database in datadir which is inside /mysql/mysql-backup-dir Note: Backups created with the --skip-unused-pages option cannot be restored using copy-back-and-apply-log. Ref. https://dev.mysql.com/do...

MEB - MySQL Enterprise Backup

MEB - MySQL Enterprise Backup perform as follows: 01. FLUSH ENGINE LOGS;     Flush logs of all engines to disk. 02. Copy binlog files start from beginning of backup. 03. Copy non-InnoDB files. 04. Write the meta files: server-all.cnf server-my.cnf 05. Rescan InnoDB tablespace files for schema changes. 06. Remove dropped InnoDB tablespace files. 07. For image backups, copy InnoDB symbolic link files - .isl to the image. 08. Stop copying InnoDB redo log. 09. Create meta/backup_variables.txt, meta/ibbackup_slave_info, meta/backup_gtid_executed.sql files.