innodb在线备份的新方法
来源:互联网 发布:jenkins 配置mac节点 编辑:程序博客网 时间:2024/05/21 15:28
在google code的google-mysql-tools公布了一个innodb在线备份的新方法:在不关闭mysql服务器的情况下,可以禁止掉所有的innodb文件的写,但不阻塞读,这个时候可以利用操作系统的文件拷贝命令进行在线备份。要实现这个功能,需要打一个google的mysql开发团队弄出的一个patch.
下面是这个patch的详细介绍:
InnodbFreeze
Freeze Innodb file system activity
Commands
set global innodb_disallow_writes=ON
set global innodb_disallow_writes=OFF
Purpose
Theseenable and disable all Innodb file system activity except for reads. Ifyou want to take a database backup without stopping the server and youdon't use LVM, ZFS or some other storage software that providessnapshots, then you can use this to halt all destructive file systemactivity from InnoDB and then backup the InnoDB data files. Note thatit is not sufficient to run FLUSH TABLES WITH READ LOCK as there arebackground IO threads used by InnoDB that may still do IO.
5.0.37 Patch
Freeze Innodb file system activity
Commands
set global innodb_disallow_writes=ON
set global innodb_disallow_writes=OFF
Purpose
Theseenable and disable all Innodb file system activity except for reads. Ifyou want to take a database backup without stopping the server and youdon't use LVM, ZFS or some other storage software that providessnapshots, then you can use this to halt all destructive file systemactivity from InnoDB and then backup the InnoDB data files. Note thatit is not sufficient to run FLUSH TABLES WITH READ LOCK as there arebackground IO threads used by InnoDB that may still do IO.
5.0.37 Patch
从一个网友的回复中,看到基本上可以达到相同效果的另外一种方法:
Any chance that you canaccomplish a similar mechanism by setting innodb_max_dirty_pages_pct tozero and then waiting for dirty buffers to equal zero... thenperforming the snapshot (of course with a READ LOCK) on all the tables.
I generally think this patch is a bit more elegant though.
Kevin Burton (spinn3r.com)
I generally think this patch is a bit more elegant though.
Kevin Burton (spinn3r.com)
总的来说,mysql的备份与ORACLE的备份相比,还有许多需要去改进的地方。google自己的mysql开发团队一直都在努力改变着mysql的代码,可以根据自己的需求去定制mysql,什么时候我们也可以这样做呢?
--EOF--
- innodb在线备份的新方法
- 备份注册表新方法
- SQL Server的在线备份
- DB2在线备份的恢复
- 在线分享《从案例说InnoDB的基本优化》
- DB2的冷备份、在线全备份和在线增量备份
- 关于MYSQL InnoDB 表的备份与恢复
- MySQL 的备份和恢复机制 MyISAM 和 Innodb
- Linux 下 mysql备份与还原,InnoDB引擎的使用
- DB2数据库的在线备份步骤
- 数据库的在线备份和还原
- php在线备份数据库的类
- 在线备份系统的简明操作
- mysql在线备份遇到的问题总结
- db2 在线备份和离线备份 的注意事项
- 磁盘碎片整理的新方法
- 调用js的新方法
- 关于UVa10048 的新方法
- 如何用java和access连接
- Java中Timer的使用
- java中Timer使用的简要说明
- 使用Java中的Timer和TimerTask
- java中Date的用法
- innodb在线备份的新方法
- 初探SQL Server 2008商业智能
- Servlet中如何捕获Session事件
- C语言:关于计算字符串中空格数的问题
- Derby 教程
- rebuild index online的锁机制浅析
- 初探SQL Server 2008性能和扩展
- 和top沾边的“牛人”
- 求职被拒怎么办