首页 > 课堂 > 基础知识 > 正文

percona-xtrabackup运用

2024-09-12 20:30:11
字体:
来源:转载
供稿:网友
     上一篇简单介绍了percona-xtrabackup的安装,percona-xtrabackup安装(一),这篇主要介绍innobackupex的工作以及实现原理和具体的使用等。
  
  一、使用xtrabackup进行备份
 
  创建备份用户
 
  mysql> CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cret';
  Query OK, 0 rows affected (0.49 sec)
  mysql> GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT,PROCESS ON *.* TO 'bkpuser'@'localhost';
  Query OK, 0 rows affected (0.00 sec)
  
  mysql> FLUSH PRIVILEGES;
  Query OK, 0 rows affected (0.35 sec)
  1.1备份类型 (全备)
 
  Creating a Backup
 
  [root@ora12c backup]# xtrabackup --user=bkpuser --password=s3cret --socket=/tmp/mysql.sock --backup --target-dir=/oracle/app/backup/base
  ......
  xtrabackup: Transaction log of lsn (2536404) to (2536413) was copied.
  170726 17:11:44 completed OK!
  [root@ora12c backup]# ls -l base/
  total 12340
  -rw-r----- 1 root root      426 Jul 26 17:11 backup-my.cnf
  -rw-r----- 1 root root      313 Jul 26 17:11 ib_buffer_pool
  -rw-r----- 1 root root 12582912 Jul 26 17:11 ibdata1
  drwxr-x--- 2 root root     4096 Jul 26 17:11 mysql
  drwxr-x--- 2 root root     4096 Jul 26 17:11 performance_schema
  drwxr-x--- 2 root root    12288 Jul 26 17:11 sys
  drwxr-x--- 2 root root     4096 Jul 26 17:11 test
  drwxr-x--- 2 root root     4096 Jul 26 17:11 xtra
  -rw-r----- 1 root root       21 Jul 26 17:11 xtrabackup_binlog_info
  -rw-r----- 1 root root      113 Jul 26 17:11 xtrabackup_checkpoints
  -rw-r----- 1 root root      526 Jul 26 17:11 xtrabackup_info
  -rw-r----- 1 root root     2560 Jul 26 17:11 xtrabackup_logfile
  1.2准备备份
 
  这个过程就是使得备份达到一致性。

(编辑:武林网)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表