<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Icebergist &#187; Uncategorized</title>
	<atom:link href="http://icebergist.com/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://icebergist.com</link>
	<description>Exploring hidden depths of web apps business</description>
	<lastBuildDate>Mon, 29 Mar 2010 13:14:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>InnoDB per-table tablespaces &#8211; split ibdata1 to smaller chunks</title>
		<link>http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks</link>
		<comments>http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks#comments</comments>
		<pubDate>Thu, 24 Jul 2008 21:01:16 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=12</guid>
		<description><![CDATA[Today I had to import 3GB of InnoDB tables in MySQL. Unfortunately, while importing the server run out of disk space &#8211; which caused whole server to grind to a halt. Naively I tried to delete imported data to free up space&#8230; I was in for an unpleasant surprise.
By default when MySQL uses InnoDB engine [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to import 3GB of InnoDB tables in MySQL. Unfortunately, while importing the server run out of disk space &#8211; which caused whole server to grind to a halt. Naively I tried to delete imported data to free up space&#8230; I was in for an unpleasant surprise.</p>
<p>By default when MySQL uses InnoDB engine it stores most of the information in single file called ibdata1. One downside is that once ibdata1 file grows it cannot shrink &#8211; even if you delete all InnoDB tables. For some reason MySQL is set to use single file instead of per-table tablespaces similar to MyISAM.</p>
<p>Enabling per-table tablespaces is easy just add <a title="InnoDB Per-table tablespaces" href="http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces.html">innodb_file_per_table</a> to my.cnf file. Problem is that <strong>all newly created tables</strong>, only new tables, will be in separate files. It seems that there&#8217;s no easy way to convert old tables and reclaim the space taken by ibdata1.</p>
<p>There are 3 ways and two are basically export-drop-delete-import type of solutions:</p>
<ol>
<li>Convert all InnoDB tables to MyISAM</li>
<li>Export only InnoDB tables, drop them, delete ibdata1 and import InnoDB tables.</li>
<li>Export all databases, delete ibdata1 and import everything back.</li>
</ol>
<p>I choose option 2 because I luckily had only 40 InnoDB tables and much more using MyISAM. For details on how to apply each solution and down/up sides of each read <a title="MySQL Reducing ibdata1" href="http://vdachev.net/blog/2007/02/22/mysql-reducing-ibdata1/en/">MySQL: Reducing ibdata1</a>.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=InnoDB%20per-table%20tablespaces%20%E2%80%93%20split%20ibdata1%20to%20smaller%20chunks&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Finnodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="InnoDB per-table tablespaces – split ibdata1 to smaller chunks";
		a2a_linkurl="http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
