备份文件:
[root@sztech1 dbback1]# pwd
/u01/dbback1
[root@sztech1 dbback1]# ls -ltr
总用量 343464
-rw-r--r-- 1 root root 351706334 4月 24 10:06 mybackup.bak
开始恢复:
[root@sztech1 dbback1]# mysqlbackup -uroot -proot --socket=/usr/local/mysql/mysql.sock --backup-dir=/u01/dbback1/ --backup-image=mybackup.bak image-to-backup-dir
MySQL Enterprise Backup version 3.11.0 Linux-3.8.13-16.2.1.el6uek.x86_64-x86_64 [2014/08/26]
Copyright (c) 2003, 2014, Oracle and/or its affiliates. All Rights Reserved.
mysqlbackup: INFO: Starting with following command line ...
mysqlbackup -uroot -pxxxx --socket=/usr/local/mysql/mysql.sock
--backup-dir=/u01/dbback1/ --backup-image=mybackup.bak
image-to-backup-dir
mysqlbackup: INFO:
IMPORTANT: Please check that mysqlbackup run completes successfully.
At the end of a successful 'image-to-backup-dir' run mysqlbackup
prints "mysqlbackup completed OK!".
mysqlbackup: INFO: Backup Image MEB version string: 3.11.0 [2014/08/26]
150424 11:07:04 mysqlbackup: INFO: MEB logfile created at /u01/dbback1/meta/MEB_2015-04-24.11-07-04_image_to_backup_dir.log
mysqlbackup: INFO: Creating 14 buffers each of size 16777216.
150424 11:07:04 mysqlbackup: INFO: Image to backup-dir operation starts with following threads
1 read-threads 6 process-threads 1 write-threads
150424 11:07:04 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/meta
150424 11:07:04 mysqlbackup: INFO: Copying datadir/ibdata1.
150424 11:07:05 mysqlbackup: INFO: Copying datadir/employees/departments.ibd.
150424 11:07:05 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/employees
150424 11:07:05 mysqlbackup: INFO: Copying datadir/employees/dept_emp.ibd.
150424 11:07:05 mysqlbackup: INFO: Copying datadir/employees/dept_manager.ibd.
150424 11:07:05 mysqlbackup: INFO: Copying datadir/employees/employees.ibd.
150424 11:07:06 mysqlbackup: INFO: Copying datadir/employees/salaries.ibd.
mysqlbackup: Progress in MB: 200
150424 11:07:10 mysqlbackup: INFO: Copying datadir/employees/titles.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/mysql/innodb_index_stats.ibd.
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/innodb_memcache
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/mysql
150424 11:07:11 mysqlbackup: INFO: Copying datadir/mysql/innodb_table_stats.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/mysql/slave_master_info.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/mysql/slave_relay_log_info.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/mysql/slave_worker_info.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/actor.ibd.
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/performance_schema
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/sakila
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/address.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/category.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/city.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/country.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/customer.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/film.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/film_actor.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/film_category.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/inventory.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/language.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/payment.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/rental.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/staff.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sakila/store.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sztech/dept.ibd.
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/sys
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/sztech
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sztech/emp.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sztech/emp_bak.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/sztech/emp_bak1.ibd.
150424 11:07:11 mysqlbackup: INFO: Copying datadir/world/city.ibd.
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/test
150424 11:07:11 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/world
150424 11:07:11 mysqlbackup: INFO: Copying datadir/world/country.ibd.
150424 11:07:12 mysqlbackup: INFO: Copying datadir/world/countrylanguage.ibd.
150424 11:07:12 mysqlbackup: INFO: Copying datadir/world/deletedcity.ibd.
150424 11:07:12 mysqlbackup: INFO: Copying datadir/world/mytable.ibd.
150424 11:07:12 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/employees
150424 11:07:12 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/innodb_memcache
150424 11:07:12 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/mysql
150424 11:07:16 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/performance_schema
150424 11:07:16 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/sakila
150424 11:07:16 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/sys
150424 11:07:17 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/sztech
150424 11:07:17 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/test
150424 11:07:17 mysqlbackup: INFO: Extract: [Dir]: /u01/dbback1/datadir/world
150424 11:07:18 mysqlbackup: INFO: Total files as specified in image: 349
150424 11:07:18 mysqlbackup: INFO: Image to backup-dir operation completed successfully.
150424 11:07:18 mysqlbackup: INFO: Backup Image contents extracted successfully into backup-dir.
Backup directory: /u01/dbback1/
mysqlbackup: INFO: Source Image Path = /u01/dbback1/mybackup.bak
mysqlbackup completed OK!
恢复后:
[root@sztech1 dbback1]# ls -ltr
总用量 343496
-rw-r--r-- 1 root root 351706334 4月 24 10:06 mybackup.bak
-rw-r--r-- 1 root root 246 4月 24 11:07 backup-my.cnf
drwx------ 11 root root 4096 4月 24 11:07 datadir
drwx------ 2 root root 4096 4月 24 11:07 meta
-rw-r--r-- 1 root root 12752 4月 24 11:07 server-all.cnf
-rw-r--r-- 1 root root 3810 4月 24 11:07 server-my.cnf
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) | Powered by Discuz! X3.2 |