Mike,
----- Alkuperäinen viesti ----- Lähettäjä: "Mike Debnam" <[EMAIL PROTECTED]>
Vastaanottaja: <mysql@lists.mysql.com>
Kopio: <[EMAIL PROTECTED]>
Lähetetty: Friday, March 04, 2005 2:49 PM
Aihe: Re: Correct way to use innodb_file_per_table?
Heikki,
the best way would be to symlink whole database directories under the datadir. Then also an ALTER TABLE keeps the new .ibd file on the drive you intended it to be on. If you symlink a single .ibd file, then an ALTER will create the new .ibd file as not symlinked.
As an example, let us say you have three databases: 'database1', 'database2', and 'test'. You may shut down mysqld, copy all the contents of /datadir/database2 to drive 2, and then symlink the directory /datadir/database2 to drive 2.
Hmm, ok. I have just one decent size database though. I want to split the tables in that database between disks. I haven't turned on innodb_file_per_table yet I'm trying to plan it out first, so I don't know the file layout yet. If my data directory is /var/db/mysql and my InnoDB data file is /var/db/mysql/ibdata1 then the table files will be created under /var/db/mysql/MyDatabase/MyTable1.ibd, /var/db/mysql/MyDatabase/MyTable2.ibd, etc it sounds like.
Is there a way to split those table files? So I could have something like /data/disk1/MyTable1.ibd, /data/disk2/MyTable2.ibd?
you can move the .ibd file where you want, and put a symlink in place.
But remember that an ALTER will recreate the table to its original database dir, because ALTER does not know about symlinks.
Thanks for your help.
Mike
Best regards,
Heikki
Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables
http://www.innodb.com/order.php
Order MySQL Network from http://www.mysql.com/network/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]