<?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>per table data innodb &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/per-table-data-innodb/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Tue, 23 Nov 2010 08:48:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>Converting to Per Table Data for InnoDB</title>
		<link>https://lifelinux.com/converting-to-per-table-data-for-innodb/</link>
					<comments>https://lifelinux.com/converting-to-per-table-data-for-innodb/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 08:48:18 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[changing to per-table]]></category>
		<category><![CDATA[innodb_file_per_table]]></category>
		<category><![CDATA[myisam to innodb]]></category>
		<category><![CDATA[per table data innodb]]></category>
		<category><![CDATA[shared innodb]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=56</guid>

					<description><![CDATA[<p>Issue with shared InnoDB /var/lib/mysql/ibdata1 storage InnoDB tables currently store data and indexes into a shared tablespace (/var/lib/mysql/ibdata1). Due to the shared tablespace, data corruption for one InnoDB table can result in MySQL failing to start up on the entire machine. Repairing InnoDB corruption can be extremely difficult to perform and can result in data [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/converting-to-per-table-data-for-innodb/">Converting to Per Table Data for InnoDB</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>Issue with shared InnoDB /var/lib/mysql/ibdata1 storage</strong><br />
InnoDB tables currently store data and indexes into a shared tablespace  (/var/lib/mysql/ibdata1). Due to the shared tablespace, data corruption  for one InnoDB table can result in MySQL failing to start up on the  entire machine. Repairing InnoDB corruption can be extremely difficult  to perform and can result in data loss for tables that were not  corrupted originally during that repair process.<span id="more-56"></span></p>
<p>Since MySQL 5.5 will be using InnoDB as the default storage engine, it  is important to consider the consequences of continuing to utilize the  shared tablespace in /var/lib/mysql/ibdata1</p>
<p><strong>Changing to per-table tablespace with innodb_file_per_table</strong></p>
<p>As an option to resolve the issue, MySQL has a configuration variable  called innodb_file per_table. To use this variable, the following could  be placed into /etc/my.cnf to convert InnoDB to a per table file for  each InnoDB engine table:</p>
<pre>innodb_file_per_table=1</pre>
<p>After adding the line, MySQL would need to be restarted on the machine.</p>
<p>The result for using that line in /etc/my.cnf would cause any databases  after the line is added to create .idb files in /var/lib/mysql/database/  location. Please note that the shared tablespace will still hold  internal data dictionary and undo logs.</p>
<p><strong>Converting old InnoDB tables</strong></p>
<p>Any old databases with InnoDB tables set to previously share the  tablespace in ibdata1 will still be using that file, so those old  databases would need to be switched to the new system. The following  command in MySQL CLI would create a list of InnoDB engine tables and a  command to run for each to convert them to the new innodb_file_per_table  system:</p>
<pre>select concat('alter table ',TABLE_SCHEMA ,'.',table_name,'  ENGINE=InnoDB;') FROM INFORMATION_SCHEMA.tables where table_type='BASE  TABLE' and engine = 'InnoDB';</pre>
<p>An example for Roundcube on my test machine shows the following return upon running the prior command:</p>
<pre>alter table roundcube.cache ENGINE=InnoDB; alter table roundcube.contacts ENGINE=InnoDB; alter table roundcube.identities ENGINE=InnoDB; alter table roundcube.messages ENGINE=InnoDB; alter table roundcube.session ENGINE=InnoDB; alter table roundcube.users ENGINE=InnoDB;</pre>
<p>You would then simply need to issue the commands noted by MySQL CLI to  then covert each table to the new innodb_file_per_table format.</p>
<p>Please note that these commands would only need to be run in MySQL  command line for the conversion, which can be reached in root SSH by  typing <strong>mysql</strong> at the bash prompt.</p>
<p><strong>Possible Issues for Converting Old InnoDB Tables</strong></p>
<p>1. Possible system load might occur during the conversion<br />
2. Possible issues with drive space filling up for the conversion</p>
<g:plusone href="https://lifelinux.com/converting-to-per-table-data-for-innodb/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/converting-to-per-table-data-for-innodb/">Converting to Per Table Data for InnoDB</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/converting-to-per-table-data-for-innodb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
