用innobackupex恢复备份数据库

[quote]tar ixvf database_sns_201110290358.tar.gz -C database_sns_201110290358[/quote]
[quote]# PATH=$PATH:/byread/bin/mysql/bin[/quote]
[quote]
# /byread/bin/mysql/bin/innobackupex-1.5.1 --defaults-file=/byread/bin/mysql/etc/my.cnf --apply-log --user=root --password=password /byread/backup/database_sns_201110290358

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.

This software is published under
the 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-1.5.1
prints "completed OK!".


111129 13:02:23 innobackupex-1.5.1: Starting ibbackup with command: xtrabackup --defaults-file="/byread/bin/mysql/etc/my.cnf" --prepare --target-dir=/byread/backup/database_sns_201110290358

xtrabackup Ver 1.2 Rev undefined for 5.1.45 unknown-linux-gnu (x86_64)
xtrabackup: cd to /byread/backup/database_sns_201110290358
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=15679488, start_lsn=(439451291573)
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 15679488
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
111129 13:02:23 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 439451291573
111129 13:02:23 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Doing recovery: scanned up to log sequence number 439456534016 (37 %)
InnoDB: Doing recovery: scanned up to log sequence number 439461776896 (75 %)
InnoDB: Doing recovery: scanned up to log sequence number 439465227876 (100 %)
111129 13:02:30 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Last MySQL binlog file position 0 842538513, file name ./mysql-bin.000145
111129 13:02:50 InnoDB Plugin 1.0.6-unknown started; log sequence number 439465227876

[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 842538513, file name ./mysql-bin.000145

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
111129 13:03:05 InnoDB: Starting shutdown...
111129 13:03:06 InnoDB: Shutdown completed; log sequence number 439465237786

111129 13:03:06 innobackupex-1.5.1: Restarting xtrabackup with command: xtrabackup --defaults-file="/byread/bin/mysql/etc/my.cnf" --prepare --target-dir=/byread/backup/database_sns_201110290358
for creating ib_logfile*

xtrabackup Ver 1.2 Rev undefined for 5.1.45 unknown-linux-gnu (x86_64)
xtrabackup: cd to /byread/backup/database_sns_201110290358
xtrabackup: 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:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 3
xtrabackup: innodb_log_file_size = 268435456
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
111129 13:03:06 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 256 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200
111129 13:03:09 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 256 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200
111129 13:03:12 InnoDB: Log file ./ib_logfile2 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile2 size to 256 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200
111129 13:03:16 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
111129 13:03:16 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 842538513, file name ./mysql-bin.000145
111129 13:03:16 InnoDB Plugin 1.0.6-unknown started; log sequence number 439465238028

[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 842538513, file name ./mysql-bin.000145

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
111129 13:03:20 InnoDB: Starting shutdown...
111129 13:03:21 InnoDB: Shutdown completed; log sequence number 439465238038
111129 13:03:21 innobackupex-1.5.1: completed OK!
[/quote]

[quote]
# /byread/bin/mysql/bin/innobackupex-1.5.1 --defaults-file=/byread/bin/mysql/etc/my.cnf --copy-back --user=root --password=password /byread/backup/database_sns_201110290358

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the copy-back run completes successfully.
At the end of a successful copy-back run innobackupex-1.5.1
prints "completed OK!".

innobackupex-1.5.1: Starting to copy MyISAM tables, indexes,
innobackupex-1.5.1: .MRG, .TRG, .TRN, .ARM, .ARZ, .opt, and .frm files
innobackupex-1.5.1: in '/byread/backup/database_sns_201110290358'
innobackupex-1.5.1: back to original data directory '/byread/data'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/blog'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/sns'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/xtrabackup_slave_info'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/photo'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/xtrabackup_checkpoints'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/mysql'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/template'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/xtrabackup_binlog_info'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/forum'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/quan'
innobackupex-1.5.1: Copying directory '/byread/backup/database_sns_201110290358/message'

innobackupex-1.5.1: Starting to copy InnoDB tables and indexes
innobackupex-1.5.1: in '/byread/backup/database_sns_201110290358'
innobackupex-1.5.1: back to original InnoDB data directory '/byread/data'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/ibdata1'

innobackupex-1.5.1: Starting to copy InnoDB log files
innobackupex-1.5.1: in '/byread/backup/database_sns_201110290358'
innobackupex-1.5.1: back to original InnoDB log directory '/byread/data'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/ib_logfile0'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/ib_logfile1'
innobackupex-1.5.1: Copying file '/byread/backup/database_sns_201110290358/ib_logfile2'
innobackupex-1.5.1: Finished copying back files.

111129 13:34:54 innobackupex-1.5.1: completed OK!
[/quote]
[quote]
# chown -R mysql /byread/data
# /bin/sh /byread/bin/mysql/bin/mysqld_safe 2>&1 > /byread/logs/mysql/mysql.log &
[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值