重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2929|回复: 0
打印 上一主题 下一主题

mysqlbackup使用单个备份文件恢复到目录

[复制链接]
跳转到指定楼层
楼主
发表于 2015-4-24 12:33:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

备份文件:

 

[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

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-24 21:07 , Processed in 0.133419 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表