读书人

innobackupex不同备份模式的记录明细

发布时间: 2013-04-05 10:24:33 作者: rapoo

innobackupex不同备份方式的记录明细

恢复过程;[root@Slave02 mysql]# lltotal 176004drwxr-xr-x 4 root root      4096 Mar 28 10:11 2013-03-28_10-10-45-rw-r--r-- 1 root root 180012554 Mar 28 11:03 mike.tar.gz-rw-r--r-- 1 root root        83 Mar 28 10:10 stderr-rw-r--r-- 1 root root         0 Mar 28 10:10 stdout-rw-r--r-- 1 root root        13 Mar 28 11:03 xtrabackup_binary[root@Slave02 mysql]# rm -rf /usr/local/mysql/data/inno/[root@Slave02 mysql]# rm -rf /usr/local/mysql/data/test/[root@Slave02 mysql]# ls -la /usr/local/mysql/data/total 481180drwxr-xr-x  6 mysql mysql      4096 Mar 28 11:24 .drwxr-xr-x 13 mysql mysql      4096 Dec 10 11:40 ..drwx------  2 mysql mysql      4096 Jan 24 17:04 book-rw-rw----  1 mysql mysql 480247808 Mar 27 14:50 ibdata1-rw-rw----  1 mysql mysql   5242880 Mar 28 09:35 ib_logfile0-rw-rw----  1 mysql mysql   5242880 Jan 24 17:04 ib_logfile1-rw-r--r--  1 mysql mysql     91820 Nov 27 10:33 log.1drwxr-xr-x  2 mysql mysql      4096 Dec 10 11:29 mysql-rw-rw----  1 mysql mysql      1879 Mar 27 14:02 mysql-bin.000001-rw-rw----  1 mysql mysql       126 Mar 27 14:04 mysql-bin.000002-rw-rw----  1 mysql mysql       126 Mar 27 14:07 mysql-bin.000003-rw-rw----  1 mysql mysql      1766 Mar 27 14:21 mysql-bin.000004-rw-rw----  1 mysql mysql       493 Mar 27 14:49 mysql-bin.000005-rw-rw----  1 mysql mysql       107 Mar 27 14:49 mysql-bin.000006-rw-rw----  1 mysql mysql       107 Mar 28 09:35 mysql-bin.000007-rw-rw----  1 mysql mysql       133 Mar 28 09:35 mysql-bin.index-rw-r--r--  1 mysql mysql     33243 Nov 27 10:24 mysqld_multi.log-rw-r--r--  1 mysql mysql         5 Nov 27 10:28 mysql.piddrwxr-xr-x  2 mysql mysql      4096 Dec 10 11:29 performance_schemadrwx------  2 mysql mysql      4096 Jan 23 14:07 prod-rw-rw----  1 mysql mysql    145643 Mar 28 09:35 Slave02.err-rw-rw----  1 mysql mysql         5 Mar 28 09:35 Slave02.pid-rw-r--r--  1 mysql mysql   1041603 Jan 25 09:25 slow.log[root@Slave02 mysql]# ls2013-03-28_10-10-45  mike.tar.gz  stderr  stdout  xtrabackup_binary[root@Slave02 mysql]# tar xvzfi mike.tar.gz backup-my.cnfibdata1inno/mm.ibdinno/t.ibdinno/mm.frminno/t.frmtest/t.MYItest/mm.MYDtest/a.MYDtest/mm.MYItest/t1.frmtest/t_coverindex.frmtest/mm.frmtest/big_string.frmtest/a.frmtest/big_string.MYDtest/a.MYItest/t1.MYDtest/t1.MYItest/t.frmtest/t2.MYDtest/t.MYDtest/t2.MYItest/t2.frmtest/big_string.MYIxtrabackup_logfilextrabackup_checkpoints[root@Slave02 mysql]# [root@Slave02 mysql]# innobackupex  --apply-log --user=root --password=root --defaults-file=/etc/my.cnf  --no-lock /data0/backup/mysql/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oyand Percona Inc 2009-2011.  All Rights Reserved.This software is published underthe GNU GENERAL PUBLIC LICENSE Version 2, June 1991.IMPORTANT: Please check that the apply-log run completes successfully.           At the end of a successful apply-log run innobackupex           prints "completed OK!".130328 11:33:57  innobackupex: Starting ibbackup with command: xtrabackup_55  --defaults-file="/etc/my.cnf" --prepare --target-dir=/data0/backup/mysqlxtrabackup_55 version 1.6.2 for MySQL server 5.5.10 Linux (i686) (revision id: undefined)xtrabackup: cd to /data0/backup/mysqlxtrabackup: This target seems to be not prepared yet.xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(893330831)xtrabackup: Temporary instance for recovery is set as followings.xtrabackup:   innodb_data_home_dir = ./xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextendxtrabackup:   innodb_log_group_home_dir = ./xtrabackup:   innodb_log_files_in_group = 1xtrabackup:   innodb_log_file_size = 2097152130328 11:33:57 InnoDB: Using Linux native AIOxtrabackup: Starting InnoDB instance for recovery.xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)130328 11:33:57 InnoDB: The InnoDB memory heap is disabled130328 11:33:57 InnoDB: Mutexes and rw_locks use InnoDB's own implementation130328 11:33:57 InnoDB: Compressed tables use zlib 1.2.3130328 11:33:57 InnoDB: Using Linux native AIO130328 11:33:57 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead130328 11:33:57 InnoDB: Initializing buffer pool, size = 100.0M130328 11:33:57 InnoDB: Completed initialization of buffer pool130328 11:33:57 InnoDB: highest supported file format is Barracuda.InnoDB: The log sequence number in ibdata files does not matchInnoDB: the log sequence number in the ib_logfiles!130328 11:33:57  InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.InnoDB: Reading tablespace information from the .ibd files...InnoDB: Last MySQL binlog file position 0 474, file name ./mysql-bin.000005130328 11:33:57  InnoDB: Waiting for the background threads to start130328 11:33:58 InnoDB: 1.1.5 started; log sequence number 893330831[notice (again)]  If you use binary log and don't use any hack of group commit,  the binary log position seems to be:InnoDB: Last MySQL binlog file position 0 474, file name ./mysql-bin.000005xtrabackup: starting shutdown with innodb_fast_shutdown = 1130328 11:33:58  InnoDB: Starting shutdown...130328 11:33:59  InnoDB: Shutdown completed; log sequence number 893331069130328 11:33:59  innobackupex: Restarting xtrabackup with command: xtrabackup_55  --defaults-file="/etc/my.cnf" --prepare --target-dir=/data0/backup/mysqlfor creating ib_logfile*xtrabackup_55 version 1.6.2 for MySQL server 5.5.10 Linux (i686) (revision id: undefined)xtrabackup: cd to /data0/backup/mysqlxtrabackup: This target seems to be already prepared.xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.xtrabackup: Temporary instance for recovery is set as followings.xtrabackup:   innodb_data_home_dir = ./xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextendxtrabackup:   innodb_log_group_home_dir = ./xtrabackup:   innodb_log_files_in_group = 2xtrabackup:   innodb_log_file_size = 5242880130328 11:33:59 InnoDB: Using Linux native AIOxtrabackup: Starting InnoDB instance for recovery.xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)130328 11:33:59 InnoDB: The InnoDB memory heap is disabled130328 11:33:59 InnoDB: Mutexes and rw_locks use InnoDB's own implementation130328 11:33:59 InnoDB: Compressed tables use zlib 1.2.3130328 11:33:59 InnoDB: Using Linux native AIO130328 11:33:59 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead130328 11:33:59 InnoDB: Initializing buffer pool, size = 100.0M130328 11:33:59 InnoDB: Completed initialization of buffer pool130328 11:33:59  InnoDB: Log file ./ib_logfile0 did not exist: new to be createdInnoDB: Setting log file ./ib_logfile0 size to 5 MBInnoDB: Database physically writes the file full: wait...130328 11:33:59  InnoDB: Log file ./ib_logfile1 did not exist: new to be createdInnoDB: Setting log file ./ib_logfile1 size to 5 MBInnoDB: Database physically writes the file full: wait...130328 11:33:59 InnoDB: highest supported file format is Barracuda.InnoDB: The log sequence number in ibdata files does not matchInnoDB: the log sequence number in the ib_logfiles!130328 11:33:59  InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.InnoDB: Reading tablespace information from the .ibd files...InnoDB: Last MySQL binlog file position 0 474, file name ./mysql-bin.000005130328 11:33:59  InnoDB: Waiting for the background threads to start130328 11:34:00 InnoDB: 1.1.5 started; log sequence number 893331468[notice (again)]  If you use binary log and don't use any hack of group commit,  the binary log position seems to be:InnoDB: Last MySQL binlog file position 0 474, file name ./mysql-bin.000005xtrabackup: starting shutdown with innodb_fast_shutdown = 1130328 11:34:00  InnoDB: Starting shutdown...130328 11:34:01  InnoDB: Shutdown completed; log sequence number 893331468130328 11:34:01  innobackupex: completed OK![root@Slave02 mysql]# [root@Slave02 mysql]# cp -r inno/ /usr/local/mysql/data/[root@Slave02 mysql]# cp -r test/ /usr/local/mysql/data/[root@Slave02 mysql]# ls2013-03-28_10-10-45  inno         xtrabackup_binlog_pos_innodbbackup-my.cnf        mike.tar.gz  xtrabackup_checkpointsibdata1              stderr       xtrabackup_logfileib_logfile0          stdoutib_logfile1          test[root@Slave02 mysql]# lltotal 657824drwxr-xr-x 4 root  root       4096 Mar 28 10:11 2013-03-28_10-10-45-rw-r--r-- 1 root  root        303 Mar 28 11:02 backup-my.cnf-rw-rw---- 1 mysql mysql 480247808 Mar 28 11:45 ibdata1-rw-r--r-- 1 root  root    5242880 Mar 28 11:45 ib_logfile0-rw-r--r-- 1 root  root    5242880 Mar 28 11:45 ib_logfile1drwxr-xr-x 2 root  root       4096 Mar 28 11:44 inno-rw-r--r-- 1 root  root  180012554 Mar 28 11:03 mike.tar.gz-rw-r--r-- 1 root  root         93 Mar 28 13:30 stderr-rw-r--r-- 1 root  root          0 Mar 28 13:30 stdoutdrwxr-xr-x 2 root  root       4096 Mar 28 11:44 test-rw-r--r-- 1 root  root         23 Mar 28 11:45 xtrabackup_binlog_pos_innodb-rw-r--r-- 1 root  root         81 Mar 28 11:45 xtrabackup_checkpoints-rw-r--r-- 1 root  root    2097152 Mar 28 11:45 xtrabackup_logfile[root@Slave02 mysql]# ls -la /usr/local/mysql/data/total 481188drwxr-xr-x  8 mysql mysql      4096 Mar 28 13:52 .drwxr-xr-x 13 mysql mysql      4096 Dec 10 11:40 ..drwx------  2 mysql mysql      4096 Jan 24 17:04 book-rw-rw----  1 mysql mysql 480247808 Mar 28 13:00 ibdata1-rw-rw----  1 mysql mysql   5242880 Mar 28 13:00 ib_logfile0-rw-rw----  1 mysql mysql   5242880 Jan 24 17:04 ib_logfile1drwxr-xr-x  2 root  root       4096 Mar 28 13:51 inno-rw-r--r--  1 mysql mysql     91820 Nov 27 10:33 log.1drwxr-xr-x  2 mysql mysql      4096 Dec 10 11:29 mysql-rw-rw----  1 mysql mysql      1879 Mar 27 14:02 mysql-bin.000001-rw-rw----  1 mysql mysql       126 Mar 27 14:04 mysql-bin.000002-rw-rw----  1 mysql mysql       126 Mar 27 14:07 mysql-bin.000003-rw-rw----  1 mysql mysql      1766 Mar 27 14:21 mysql-bin.000004-rw-rw----  1 mysql mysql       493 Mar 27 14:49 mysql-bin.000005-rw-rw----  1 mysql mysql       107 Mar 27 14:49 mysql-bin.000006-rw-rw----  1 mysql mysql       126 Mar 28 13:00 mysql-bin.000007-rw-rw----  1 mysql mysql       133 Mar 28 09:35 mysql-bin.index-rw-r--r--  1 mysql mysql     33243 Nov 27 10:24 mysqld_multi.log-rw-r--r--  1 mysql mysql         5 Nov 27 10:28 mysql.piddrwxr-xr-x  2 mysql mysql      4096 Dec 10 11:29 performance_schemadrwx------  2 mysql mysql      4096 Jan 23 14:07 prod-rw-rw----  1 mysql mysql    146109 Mar 28 13:00 Slave02.err-rw-r--r--  1 mysql mysql   1041603 Jan 25 09:25 slow.logdrwxr-xr-x  2 root  root       4096 Mar 28 13:52 test[root@Slave02 mysql]# [root@Slave02 mysql]# [root@Slave02 mysql]# chown -R mysql:mysql /usr/local/mysql/data[root@Slave02 mysql]# ls -la /usr/local/mysql/data/total 481188drwxr-xr-x  8 mysql mysql      4096 Mar 28 13:52 .drwxr-xr-x 13 mysql mysql      4096 Dec 10 11:40 ..drwx------  2 mysql mysql      4096 Jan 24 17:04 book-rw-rw----  1 mysql mysql 480247808 Mar 28 13:00 ibdata1-rw-rw----  1 mysql mysql   5242880 Mar 28 13:00 ib_logfile0-rw-rw----  1 mysql mysql   5242880 Jan 24 17:04 ib_logfile1drwxr-xr-x  2 mysql mysql      4096 Mar 28 13:51 inno-rw-r--r--  1 mysql mysql     91820 Nov 27 10:33 log.1drwxr-xr-x  2 mysql mysql      4096 Dec 10 11:29 mysql-rw-rw----  1 mysql mysql      1879 Mar 27 14:02 mysql-bin.000001-rw-rw----  1 mysql mysql       126 Mar 27 14:04 mysql-bin.000002-rw-rw----  1 mysql mysql       126 Mar 27 14:07 mysql-bin.000003-rw-rw----  1 mysql mysql      1766 Mar 27 14:21 mysql-bin.000004-rw-rw----  1 mysql mysql       493 Mar 27 14:49 mysql-bin.000005-rw-rw----  1 mysql mysql       107 Mar 27 14:49 mysql-bin.000006-rw-rw----  1 mysql mysql       126 Mar 28 13:00 mysql-bin.000007-rw-rw----  1 mysql mysql       133 Mar 28 09:35 mysql-bin.index-rw-r--r--  1 mysql mysql     33243 Nov 27 10:24 mysqld_multi.log-rw-r--r--  1 mysql mysql         5 Nov 27 10:28 mysql.piddrwxr-xr-x  2 mysql mysql      4096 Dec 10 11:29 performance_schemadrwx------  2 mysql mysql      4096 Jan 23 14:07 prod-rw-rw----  1 mysql mysql    146109 Mar 28 13:00 Slave02.err-rw-r--r--  1 mysql mysql   1041603 Jan 25 09:25 slow.logdrwxr-xr-x  2 mysql mysql      4096 Mar 28 13:52 test[root@Slave02 mysql]# service mysqld restartMySQL server PID file could not be found!                  [FAILED]Starting MySQL..                                           [  OK  ][root@Slave02 mysql]# service mysqld restartShutting down MySQL.                                       [  OK  ]Starting MySQL..                                           [  OK  ][root@Slave02 mysql]# mysql -uroot -prootWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.5.13-log Source distributionCopyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> use innoDatabase changedmysql> show tables;+----------------+| Tables_in_inno |+----------------+| mm             || t              |+----------------+2 rows in set (0.00 sec)mysql> select * from mm;+------+| a    |+------+|    1 ||    2 ||    3 ||    4 || 9999 |+------+5 rows in set (0.02 sec)mysql> 


读书人网 >其他数据库

热点推荐