List:General Discussion« Previous MessageNext Message »
From:Heikki Tuuri Date:January 3 2006 10:27am
Subject:Re: removing ibdata1 if some/all tables are not InnoDB?
View as plain text  
Carl,

InnoDB does purge deleted rows from the ibdata files. Certain PostgreSQL 
advocates have been spreading a claim that InnoDB would not do that, but the 
claim is false.

If your ibdata file keeps growing indefinitely, please check with SHOW 
INNODB STATUS that you do commit all your transactions. If a transaction 
stays open for months, then the purge cannot remove deleted rows.

If you convert ALL your tables from InnoDB to MyISAM, then you can remove 
the ibdata files and ib_logfiles. If you put skip-innodb to my.cnf, then 
those files will not be created again.

Best regards,

Heikki

Oracle Corp./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


----- Original Message ----- 
From: "Alex" <alexj@stripped>
Newsgroups: mailing.database.myodbc
Sent: Tuesday, January 03, 2006 6:55 AM
Subject: Re: removing ibdata1 if some/all tables are not InnoDB?


> HI Carl,
>
>        The ibdata file growth can be stopped by removing the autoextend
> keyword in the my.cnf file.
>
> In your my.cnf file the entry might be
>
> innodb_data_file_path = ibdata1:256M:autoextend
>
> If you want to stop the growth of that file and add another file then this
> is what you want to do.
>
> 1. Stop the mysql server
> 2. Get the size of the ibdata1 file in MB (Lets say its 5600MB in size)
> 3. edit the my.cnf file and replace
>
> innodb_data_file_path = ibdata1:256M:autoextend
>
> with
>
> innodb_data_file_path = ibdata1:5600M;ibdata2:256M:autoextend
>
> 4. Start the server.
>
> This will stop that file from growing and a new file will be added that
> can pushed on to a different disk and symlinked into the ibdata directory.
>
> Data growth is a problem in all table types. Even if you migrate to MyISAM
> you need space.
>
> See whether there is log_bin turned on the server. If so there might be
> lots of bin log files that you can do a cleanup on. Bin logs occupy a
> great deal of space.
>
> Thanx
> Alex,
> MySQL DBA
> Yahoo!
>
>
>
> On Tue, 03 Jan 2006 08:28:24 +0530, Carl Brewer <carl@stripped>
> wrote:
>
>>
>>
>> Hello,
>>
>> I'm stuck with a rapidly decreasing amount of available disk space and
>> a requirement to keep a lid on the size of our databases.  We're
>> using MySQL 4.1.12 as bundled with RHEL ES 4.  We do a lot of
>> transactions keeping short term track of webserver sessions, which
>> we don't need to keep logs of for very long.
>>
>> I have a number of databases, almost all of which are using MyISAM or
>> HEAP, and one database using InnoDB.  As such (or at least, as I
>> understand it) we have a ibdata1 file that will grow forever and
>> AFAIK there's no way to stop it growing forever for as long
>> as we have that InnoDB database.  Am I correct?  I'm no MySQL
>> guru, my parsing of TFM and googling around and finding bug and feature
>> requests for ibdata1 purging suggests that this is the case.
>>
>> If so, if I drop the InnoDB database, stop mysqld, delete (UNIX
>> filesystem) the imdata1 file, restart mysqld and import a
>> (modified to be MyISAM) dumped copy of the InnoDB database,
>> will that work without damaging anything and then not leave me
>> with another infinatly growing imdata1 file?
>>
>> Am I correct in assuming that InnoDB databases are meant
>> for sites where disk space is not ever likely to be an
>> issue, and MyISAM is a more suitable database engine for
>> our much tighter disk space situation?  I may have missed
>> a section of the doco that discusses why one would choose an
>> engine over another?
>>
>> Thanks for any advice,
>>
>> Carl
>>
>>
>
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: 
> http://lists.mysql.com/mysql?unsub=1
> 

Thread
removing ibdata1 if some/all tables are not InnoDB?Carl Brewer3 Jan
  • Re: removing ibdata1 if some/all tables are not InnoDB?Chander Ganesan3 Jan
  • Re: removing ibdata1 if some/all tables are not InnoDB?Alex3 Jan
Re: removing ibdata1 if some/all tables are not InnoDB?Heikki Tuuri3 Jan
  • Re: removing ibdata1 if some/all tables are not InnoDB?Remigiusz SokoĊ‚owski3 Jan
  • Re: removing ibdata1 if some/all tables are not InnoDB?Chander Ganesan3 Jan