>>>>> "Tim" == Tim Bunce <Tim.Bunce@stripped> writes:
Tim> On Thu, Jan 06, 2000 at 06:40:21AM -0600, Paul DuBois wrote:
>> At 12:26 PM +0000 2000-01-06, Tim Bunce wrote:
>> >Oracle has a way to take a table (actually a tablespace) 'offline'
>> >via SQL for making hot backups.
>> >It would be handy if MySQL offered something similar. Perhaps via
>> >a "LOCK tablename OFFLINE" statement that would flush and close the
>> >corresponding table and index files.
>> >Sounds simple to implement (as an extension to a WRITE lock).
>> >A backup script could then LOCK OFFLINE and UNLOCK each table in turn
>> >and, while each is locked, copy the corresponding table and index files
>> >to a separate directory.
>> >A simple and effective hot-backup.
>> >Monty, is this a good idea or is there a better way?
>> Would this be different in some way from LOCK READ plus FLUSH TABLES
>> before copying the files?
Tim> Mainly that FLUSH TABLES flushes _all_ tables. Adding a way to
Tim> flush an individual table would be handy.
This would be easy to do. I shall add it to my todo.
Tim> Also, something I'm not sure of... does MySQL mark table (and index)
Tim> files as being 'stable' when they are closed and check that flag when
Tim> they are reopened? (Like most modern filesystems do?)
The new MyISAM does the first part; As soon as we have myisamchk
integrated into mysqld we will handle the second part (automatic
checking + repair of tables at reboot)
Tim> If so, if that flag set by just flushing a table?
Yes, the flag is set by doing a flush on the table (as the flush
forces a close of all tables + a reopen on the locked tables).