- 论坛徽章:
- 5
|
原帖由 北京野狼 于 2005-11-3 11:53 发表
金山词霸可以查中文含义,你都不知道,怎么什么都不知道。
mysql在线备份机制非常健全,无论是不是myisam表,无论怎么修改。我每天上千万的数据库,都是Replication同步。
全世界掌握mysql的,大概只有您 ...
查中文含义,呵呵,不好意思,我的机器只有2002版本,从来没有见到什么中文含义。
OK,我们来看看mysql手册中关于备份的原话:
Because MySQL tables are stored as files, it is easy to do a backup. To get a consistent backup, do a LOCK TABLES on the relevant tables, followed by FLUSH TABLES for the tables. See Section 13.4.5, “LOCK TABLES and UNLOCK TABLES Syntax” and Section 13.5.5.2, “FLUSH Syntax”. You need only a read lock; this allows other clients to continue to query the tables while you are making a copy of the files in the database directory. The FLUSH TABLES statement is needed to ensure that the all active index pages are written to disk before you start the backup.
至于mysqlhotcopy呢,呵呵:
mysqlhotcopy is a Perl script that was originally written and contributed by Tim Bunce. It uses LOCK TABLES, FLUSH TABLES, and cp or scp to make a backup of a database quickly. It is the fastest way to make a backup of the database or single tables, but it can be run only on the same machine where the database directories are located. mysqlhotcopy works only for backing up MyISAM. It runs on Unix and NetWare.
请问你是否看到,如果为了得到一致的备份需要LOCK相关的TABLE,这叫做完善的在线备份机制?
见过DB2 ORACLE INFORMIX SYBASE FIREBIRD做在线备份需要LOCK相关TABLE的?复杂的OLTP系统,我看LOCK TABLE都不够,不如整个数据库LOCK算了。
倒是和DB2再使用循环日志的时候的离线备份类似,先把数据切换到静止模式,踢吊别人的连接,不许更新了来个离线备份。
本来innobase是提供了基于日志的重做机制,可以实现真正意义的在线备份(不需要对表锁定也能保证一致性)但是由于mysql必须保持部分表必须是myisam表。所以还是只解决了一半问题。 |
|