MYSQL

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • innodb madness

    0 answers - 1820 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    There is a more robust way if you running MySQL 5
    Export this query using mysql client to an SQL script like this
    mysql -h<-u<-p<-A -e"SELECT CNCAT('PTIMIZE TABLE ',table_schema,'.',table_name,';') FRM information_schema.tables WHERE ENGINE='InnoDB'"
    Then run the script using mysql client.
    Please remember, PTMIZE TABLE does absolutely nothing if all InnoDB data resides in the shared space.
    Your must create all InnoDB tables as separate entities.
    To do this, mysqldump all tables to a dump file.
    Shutdown MySQL
    add 'innodb_file_per_table' to my.cnf
    Delete the ibdata files and the logs
    Startup MySQL
    Reload dump file.
    Each InnoDB will reside in .frm and .ibd files
    PTIMIZE will defragment each tablespace (.ibd) file
    Message
    From: "Chris White" <cwhite (AT) interfuel (DOT) com>
    To: "Marten Lehmann" <lehmann (AT) cnm (DOT) de>
    Cc: mysql (AT) lists (DOT) mysql.com
    Sent: Tuesday, February 6, 2007 1:24:46 PM (GMT-0500) US/Eastern
    Subject: Re: innodb madness
    Marten Lehmann wrote:
    How can I check which tables are using innodb with sql? How can walk through
    the tables with "show databases" and "show tables". Thanks.
    This somewhat depends on how the tables were declared. If you used
    "ENGINE=InnoDb;" in the CREATE TABLE sequence, you'd be able to loop
    through the results of "SHW TABLES" and run a "SHW CREATE TABLE" on
    each of the resulting tables to get that answer.
    While there is no REPAIR TABLE, a strange table locking issue we were
    having yesterday was apparently solved by a run of PTIMIZE TABLE on the
    table at hand. Why we're not sure yet, but things are working so can't
    complain too much

Re: innodb madness


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "MYSQL"

EMSDN.COM