<?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>Weez.com &#187; from</title>
	<atom:link href="http://www.weez.com/tag/from/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weez.com</link>
	<description>Solving everyday practical LAMP problems... one at a time</description>
	<lastBuildDate>Fri, 10 Feb 2012 23:07:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to recover a single InnoDB table from a Full Backup</title>
		<link>http://www.weez.com/2012/01/how-to-recover-a-single-innodb-table-from-a-full-backup/</link>
		<comments>http://www.weez.com/2012/01/how-to-recover-a-single-innodb-table-from-a-full-backup/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 03:04:00 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[Full]]></category>
		<category><![CDATA[Innodb]]></category>
		<category><![CDATA[Recover]]></category>
		<category><![CDATA[single]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.weez.com/2012/01/how-to-recover-a-single-innodb-table-from-a-full-backup/</guid>
		<description><![CDATA[Sometimes we need to restore only some tables from a full backup maybe because your data loss affect a small number of your tables. In this particular scenario is faster to recover single tables than a full backup. This is easy with MyISAM but if your tables are InnoDB the process is a little bit [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we need to restore only some tables from a full backup maybe because your data loss affect a small number of your tables. In this particular scenario is faster to recover single tables than a full backup. This is easy with MyISAM but if your tables are InnoDB the process is a little bit different story.</p>
<p>With Oracle&#8217;s stock MySQL you cannot move your ibd files freely from one server to another or from one database to another. The reason is that the table definition is stored in the InnoDB shared tablespace (ibdata) and the transaction IDs and log sequence numbers that are stored in the tablespace files also differ between servers. Therefore our example will be very straightforward: we&#8217;ll delete some rows from a table in order to recover the table later.</p>
<p><strong>Most of these limitations are solved on Percona Server </strong>. More info about this in the <strong>conclusion</strong> section of this post. This post will be focus on how to recover a single tablespace using stock MySQL server. </p>
<p>First, you must meet certain prerequisites to be able to restore a ibd tablespace:</p>
<ul>
<li>The ibd file must be from a consistent backup with all insert buffer entries merged  and have no uncommitted transactions in order to not be dependent of the shared tablespace ibdata. That is, shutting down with <a href="http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_fast_shutdown">innodb_fast_shutdown</a>=0. We&#8217;ll use <a href="http://www.percona.com/doc/percona-xtrabackup/">XtraBackup</a> to avoid the server shutdown.</li>
<li>You must not drop, truncate or alter the schema of the table after the backup has been taken.</li>
<li>The variable innodb_file_per_table must be enabled.</li>
</ul>
<p>Then, our first step is to get a consistent backup.</p>
<p><strong>First we need to copy all the data to an output directory:</strong></p>
<p>The &#8211;export option is the magic trick that will help us to get a consistent backup with complete independent ibd files without shutting down the service. In the second step the use of &#8211;export option runs a recovery process on the backup with innodb_fast_shutdown=0 and therefore merging all the insert buffers.</p>
<blockquote><p><code># innobackupex --defaults-file=/etc/my.cnf --export /tmp/</code></p>
</blockquote>
<p><strong>Then apply the logs to get a consistent backup:</strong></p>
<blockquote><p><code># innobackupex --defaults-file=/etc/my.cnf --apply-log --export /tmp/2012-01-22_14-13-20/</code></p>
</blockquote>
<p>Now we&#8217;re going to delete some data from one table. In this case we&#8217;re going to delete the salary information from the user 10008:</p>
<blockquote><p><code>mysql> SELECT * FROM salaries WHERE emp_no=10008;<br />
+--------+--------+------------+------------+<br />
| emp_no | salary | from_date  | to_date    |<br />
+--------+--------+------------+------------+<br />
|  10008 |  46671 | 1998-03-11 | 1999-03-11 |<br />
|  10008 |  48584 | 1999-03-11 | 2000-03-10 |<br />
|  10008 |  52668 | 2000-03-10 | 2000-07-31 |<br />
+--------+--------+------------+------------+</p>
<p>mysql> DELETE FROM salaries WHERE emp_no=10008;</code></p>
</blockquote>
<p>The next step is where we are going to save a lot of time and some headaches <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Instead of recovering all the InnoDB data we are going to recover only the &#8220;salaries&#8221; table:</p>
<ul>
<li>Discard the tablespace of the salaries table:</li>
</ul>
<blockquote><p><code>mysql> ALTER TABLE salaries DISCARD TABLESPACE;</code></p>
</blockquote>
<ul>
<li>Copy the salaries.ibd files from the backup to the database data directory:</li>
</ul>
<blockquote><p><code># cp /tmp/2012-01-22_14-13-20/employees/salaries.ibd /var/lib/mysql/data/employees/</code></p>
</blockquote>
<ul>
<li>Import the new tablespace:</li>
</ul>
<blockquote><p><code>mysql> ALTER TABLE salaries IMPORT TABLESPACE;</p>
<p>mysql> SELECT * FROM salaries WHERE emp_no=10008;<br />
+--------+--------+------------+------------+<br />
| emp_no | salary | from_date  | to_date    |<br />
+--------+--------+------------+------------+<br />
|  10008 |  46671 | 1998-03-11 | 1999-03-11 |<br />
|  10008 |  48584 | 1999-03-11 | 2000-03-10 |<br />
|  10008 |  52668 | 2000-03-10 | 2000-07-31 |<br />
+--------+--------+------------+------------+</code></p>
</blockquote>
<p>The salary history from the user is back again!</p>
<p><strong>Conclusion:</strong></p>
<p>As we learned , you can also recover single InnoDB table as with MyISAM but knowing in advance that there are some prerequisites to comply.</p>
<p>Percona Server relaxes a lot of limitations and is able to import tables from different Server instance, when table was altered or truncated in the meanwhile. Though this only works if table was<br />
&#8220;exported&#8221; with Xtrabackup as this exports essential information from main tablespace which is not stored in .ibd file.  <strong>innodb_import_table_from_xtrabackup=1</strong> should be enabled for such advanced import process to work. You can read more about this feature in <a href="http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html">Percona Server Documentation<br />
</a></p>
<p>In the next blog post I&#8217;ll explain how to do recovery using  Percona Data Recovery toolkit.</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2012/01/25/how-to-recover-a-single-innodb-table-from-a-full-backup/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2012/01/how-to-recover-a-single-innodb-table-from-a-full-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slides from Percona Live, Washington, DC are available</title>
		<link>http://www.weez.com/2012/01/slides-from-percona-live-washington-dc-are-available/</link>
		<comments>http://www.weez.com/2012/01/slides-from-percona-live-washington-dc-are-available/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 22:05:28 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Available]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[Live]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[Slides]]></category>
		<category><![CDATA[Washington]]></category>

		<guid isPermaLink="false">http://www.weez.com/2012/01/slides-from-percona-live-washington-dc-are-available/</guid>
		<description><![CDATA[If you&#8217;ve missed Percona Live in Washington,DC and even if you did not you should be happy to know we have now published slides from majority of talks at this conference. Enjoy! This conference had great talks, whenever you&#8217;re Beginner or Advanced when it comes to MySQL. Also remember not to miss MySQL Conference in [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve missed <a href="http://www.percona.com/live/dc-2012/">Percona Live in Washington,DC</a> and even if you did not you should be happy to know we have now <a href="http://www.percona.com/live/dc-2012/slides/">published slides</a> from majority of talks at this conference. Enjoy!  This conference had great talks, whenever you&#8217;re  Beginner or Advanced when it comes to MySQL. Also remember not to miss <a href="http://www.percona.com/live/mysql-conference-2012/">MySQL Conference </a>in Santa Clara,CA April 10-12 2012.</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2012/01/20/slides-from-percona-live-washington-dc-are-available/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2012/01/slides-from-percona-live-washington-dc-are-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online MySQL Configuration Wizard from Percona</title>
		<link>http://www.weez.com/2011/12/online-mysql-configuration-wizard-from-percona/</link>
		<comments>http://www.weez.com/2011/12/online-mysql-configuration-wizard-from-percona/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 17:40:51 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[Wizard]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/12/online-mysql-configuration-wizard-from-percona/</guid>
		<description><![CDATA[Merry Christmas! Just in time for the holidays, we have released a new tool to help you configure and manage your MySQL servers. Our online MySQL Configuration Wizard can help you generate a good basic configuration file for a server. This MySQL tuning wizard is our answer to the commonly asked question, “what is a [...]]]></description>
			<content:encoded><![CDATA[<p>Merry Christmas! Just in time for the holidays, we have released a new tool to help you configure and manage your MySQL servers. Our online <a href="http://tools.percona.com/">MySQL Configuration Wizard</a> can help you generate a good basic configuration file for a server. This MySQL tuning wizard is our answer to the commonly asked question, “what is a good default configuration file for my server with 16 GB of RAM?”</p>
<p>We have a raft of new features planned for future releases, including advanced configuration options, supersafe settings to prevent bad things from happening, and much more. In the future we plan to add more online tools to help you be more productive.</p>
<p>Please <a href="http://tools.percona.com/">give it a spin</a> and let us know what you think. Credit for this tool must go to  Miguel Trias,  our talented lead developer.  Thanks also to the many experts inside Percona who helped test, and made suggestions for improving the tool.</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/12/23/online-mysql-configuration-wizard-from-percona/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/12/online-mysql-configuration-wizard-from-percona/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Slides from Percona Live,London are now available</title>
		<link>http://www.weez.com/2011/11/slides-from-percona-livelondon-are-now-available/</link>
		<comments>http://www.weez.com/2011/11/slides-from-percona-livelondon-are-now-available/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 00:13:59 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Available]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[LiveLondon]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[Slides]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/11/slides-from-percona-livelondon-are-now-available/</guid>
		<description><![CDATA[We had a lot of great technical presentations at Percona Live, London If you did not have a chance to attend or if you did but could not be at 5 rooms at the same time you can check out slides which have been just made available for download for most of the talks. Enjoy [...]]]></description>
			<content:encoded><![CDATA[<p>We had a lot of great technical presentations at <a href="http://www.percona.com/live/london-2011/">Percona Live</a>, London  If you did not have a chance to attend or if you did but could not be at 5 rooms at the same time you can check out <a href="http://www.percona.com/live/london-2011/">slides</a> which have been just made available for download for most of the talks.  Enjoy and see you on our <a href="http://www.perconalive.com">future events</a> !</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/11/07/slides-from-percona-livelondon-are-now-available/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/11/slides-from-percona-livelondon-are-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From the Archives &#8211; Gapingvoid&#8217;s Nobody Cares</title>
		<link>http://www.weez.com/2011/10/from-the-archives-gapingvoids-nobody-cares/</link>
		<comments>http://www.weez.com/2011/10/from-the-archives-gapingvoids-nobody-cares/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 19:27:37 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Archives]]></category>
		<category><![CDATA[Cares]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[Gapingvoid's]]></category>
		<category><![CDATA[Nobody]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/10/from-the-archives-gapingvoids-nobody-cares/</guid>
		<description><![CDATA[While cleaning out the digital attic I ran into this drawing that Hugh MacLeod (aka &#8220;gapingvoid&#8221;) made for me in reponse to a storm-in-a-teacup about blogging Amazon. As usual Hugh came straight to the heart of the matter BTW Hugh&#8217;s new book &#8220;Evil Plans, having Fun on the Road to World Domination&#8221; was released last [...]]]></description>
			<content:encoded><![CDATA[<p>
<p>While cleaning out the digital attic I ran into this drawing that <a href="http://www.gapingvoid.com/">Hugh MacLeod</a> (aka &#8220;gapingvoid&#8221;) made for me in reponse to a storm-in-a-teacup about blogging Amazon. As usual Hugh came straight to the heart of the matter <img src='http://www.weez.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p><img alt="should amazon blog.jpg"<br />
src="http://www.allthingsdistributed.com/images/should%20amazon%20blog.jpg" width="300" height="318" class="mt-image-center" style="text-align: center; display: block; margin: 20px 20px 20px 20px;" /></p>
<p>BTW Hugh&#8217;s new book &#8220;<a href="http://www.amazon.com/gp/product/1591843847?ie=UTF8&#038;tag=allthingsdist-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1591843847">Evil Plans, having Fun on the Road to World Domination</a>&#8221; was released last week. You can order it <a href="http://www.amazon.com/gp/product/1591843847?ie=UTF8&#038;tag=allthingsdist-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1591843847">here</a></p>
<p>View full post on <a href="http://www.allthingsdistributed.com/2011/02/from_the_archives_-_gapingvoid.html">All Things Distributed</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/10/from-the-archives-gapingvoids-nobody-cares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A recovery trivia or how to recover from a lost ibdata1 file</title>
		<link>http://www.weez.com/2011/06/a-recovery-trivia-or-how-to-recover-from-a-lost-ibdata1-file/</link>
		<comments>http://www.weez.com/2011/06/a-recovery-trivia-or-how-to-recover-from-a-lost-ibdata1-file/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 20:06:14 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA['ibdata1']]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[lost]]></category>
		<category><![CDATA[Recover]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[Trivia]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/06/a-recovery-trivia-or-how-to-recover-from-a-lost-ibdata1-file/</guid>
		<description><![CDATA[A few day ago, a customer came to Percona needing to recover data. Basically, while doing a transfer from one SAN to another, something went wrong and they lost the ibdata1 file, where all the table meta-data is stored. Fortunately, they were running with innodb_file_per_table so the data itself was available. What they could provide [...]]]></description>
			<content:encoded><![CDATA[<p>A few day ago,  a customer came to Percona needing to recover data.  Basically, while doing a transfer from one SAN to another, something went wrong and they lost the ibdata1 file, where all the table meta-data is stored.  Fortunately, they were running with innodb_file_per_table so the data itself was available.  What they could provide us was:</p>
<ul>
<li>all the tables ibd files (Nearly 200 of them,  40 GB of data)</li>
<li>the schema in sql format</li>
<li>No remote access</li>
</ul>
<p>Their first question was &#8220;Is it possible to recover the data?&#8221;  </p>
<p><span id="more-7085"></span></p>
<p>The answer was <strong>yes</strong> since I was sure to at least be able to recover the data with the <a href="https://launchpad.net/percona-innodb-recovery-tool">Innodb recovery tool</a> of Aleksandr Kuzminsky a colleague on the Percona European team of consultants.  In the past, I used this tool a few times and, although it is awesome to dig for data, it is time consuming and the perspective of recovering by hand nearly 200 tables was not really exciting.  I needed something faster and more automatic so, after reading this <a href="http://www.chriscalender.com/?tag=discard-tablespace">post</a> from Chris Calendar,  I decided to use the following strategy.</p>
<ol>
<li>Start with a clean MySQL install so that Innodb tablespace id is set to 1</li>
<li>Import the schema in MyISAM format to avoid screwing up the tablespace id</li>
<li>Record the tablespace id of all the tables provided by the customer and but the info in a MyISAM table</li>
<li>Advance the Innodb tablespace id by creating fake Innodb tables</li>
<li>Once the Innodb tablespace id is minus one of a customer table</li>
<ol>
<li>alter the table definition from MyISAM to Innodb</li>
<li>Discard the tablespace</li>
<li>Replace the table ibd file with the one provided by the customer</li>
<li>Import the tablespace</li>
<li>At this point I should have access to the table but, although MySQL was not complaining, the data was not available.  An &#8220;alter table tablename engine=InnoDB;&#8221; would solve the problem but then, the tablespace id would increase by one,  annoying.  I decided, also for portability, to do &#8220;alter table tablename engine=MyISAM;&#8221;</li>
</ol>
<li>Script all that</li>
</ol>
<p>In order to get a decent disk space and good internet connectivity, I fired up an Ubuntu 10.04 EC2 instance, installed MySQL and provided the customer the credentials to upload their files.  Then, I proceed.</p>
<p><em>Loading the schema</em></p>
<pre>
root@domU:/mnt/tables# perl -p -i -e 's/ENGINE=InnoDB/ENGINE=MyISAM/g' schema.sql
root@domU:/mnt/tables# cat schema.sql | mysql -u root test
</pre>
<p><em>The MyISAM table recording the space ids of the tables</em></p>
<pre>
mysql> show create table test.tables\G
*************************** 1. row ***************************
       Table: tables
Create Table: CREATE TABLE `tables` (
  `name` varchar(100) DEFAULT NULL,
  `spaceid` int(11) NOT NULL,
  PRIMARY KEY (`spaceid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
</pre>
<p><em>Filling up the table with table names and space ids</em><br />
The challenge was now to fill up the table.   It is fairly easy to find the space id in a .ibd file.  </p>
<pre>
#root@domU:/mnt/tables# hexdump profile_data.ibd -C | head -4
#00000000  62 bd c3 19 00 00 00 00  ff ff ff ff ff ff ff ff  |b...............|
#00000010  00 00 00 54 86 9a 91 93  45 bf 00 00 00 00 00 00  |...T....E.......|
#00000020  00 00 00 00 00 11 00 00  00 11 80 39 00 00 00 02  |...........9....|
#00000030  4f 00 00 02 47 c0 00 00  00 00 00 00 00 13 00 00  |O...G...........|
</pre>
<p>In the above example, the table space id is &#8220;00 11&#8243; as stored in bytes 0&#215;24 and 0&#215;25 (actually, 0&#215;22 and 0&#215;23 are also for tablespace id but always 00 in this case).  To load the data was just some Bash scripting:</p>
<pre>
# for t in `ls *.ibd`; do tname=`echo $t | cut -d'.' -f1`; spaceid=`hexdump -C $t | head -3 | tail -1 | awk '{print $6$7}'`; mysql -u root -e "insert into tables (name,spaceid) values ('$tname',conv('$spaceid',16,10))" test; done
</pre>
<p><em>Recovering the tables</em><br />
With all this in place, recovery the data was just another Bash script:</p>
<pre>
#!/bin/bash

CURRENT_ID=1

mysql -u root "create database if not exists filler;"

while [ 1 ]
do
        CURRENT_SPACEID=`mysql -u root -B -N -e "select spaceid from test.tables where spaceid >= $CURRENT_ID order by spaceid limit 1;"`

        if [ "a$CURRENT_SPACEID" == "a" ]; then
                exit
        fi

        CURRENT_TABLENAME=`mysql -u root -B -N -e "select name from test.tables where spaceid =  $CURRENT_SPACEID;"`

        echo "doing $CURRENT_TABLENAME $CURRENT_SPACEID"

        # DO WE NEED TO SKIP SOME ID
        while [ "$CURRENT_ID" -lt "$CURRENT_SPACEID" ]
        do
                echo "skipping spaceID $CURRENT_ID"
                mysql -u root -e "create table space_$CURRENT_ID (id int) engine=Innodb;" filler
                let CURRENT_ID+=1
        done

        exit
        echo "creating the table"
        mysql -u root -e "create table recover.$CURRENT_TABLENAME like test.$CURRENT_TABLENAME;"
        sleep 1

        echo "switching to Innodb "
        mysql -u root -e "alter table recover.$CURRENT_TABLENAME engine=Innodb;"
        sleep 1

        echo "discarding tablespace "
        mysql -u root -e "alter table recover.$CURRENT_TABLENAME discard tablespace;"
        sleep 1

        echo "moving the datafile in place"
        cp /mnt/tables/$CURRENT_TABLENAME.ibd /var/lib/mysql/recover/
        chown mysql.mysql /var/lib/mysql/recover/$CURRENT_TABLENAME.ibd
        sleep 1

        echo "importing tablespace"
        mysql -u root -e "alter table recover.$CURRENT_TABLENAME import tablespace;"
        sleep 1

        echo "switching to MyISAM"
        mysql -u root -e "alter table recover.$CURRENT_TABLENAME engine=MyISAM;flush tables;"
        sleep 1

        let CURRENT_ID+=1
done
</pre>
<p>I did a backup of /var/lib/mysql before the first run to make sure I could restart if needed, which of course, I did a few times.   And that, recovered all except one table.  For that one, I had to use the Innodb recovery tools but even then, I had a hard time.  I pulled in Aleksandr and he basically reversed engineer the table structure and found that the schema the customer provided (likely from dev or staging) contained an extra column.   With a modified schema, the recovery completed.   The customer was able to download the tables in MyISAM format and then he just convert them back to InnoDB. </p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/06/03/a-recovery-trivia-or-how-to-recover-from-a-lost-ibdata1-file/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/06/a-recovery-trivia-or-how-to-recover-from-a-lost-ibdata1-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Must read talk from MySQL Conference and Expo</title>
		<link>http://www.weez.com/2011/05/must-read-talk-from-mysql-conference-and-expo/</link>
		<comments>http://www.weez.com/2011/05/must-read-talk-from-mysql-conference-and-expo/#comments</comments>
		<pubDate>Tue, 10 May 2011 00:14:59 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Expo]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[Must]]></category>
		<category><![CDATA[Read]]></category>
		<category><![CDATA[Talk]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/05/must-read-talk-from-mysql-conference-and-expo/</guid>
		<description><![CDATA[I started going over the slides from talks from MySQL Conference and Expo 2011 to pick set of must see presentations and publish the list, but this is not happening due to lack of time. Instead I&#8217;m only going to recommend 1 talk, from list of tutorials I had a chance to review. If you [...]]]></description>
			<content:encoded><![CDATA[<p>I started going over the slides from talks from <a href="http://en.oreilly.com/mysql2011/">MySQL Conference and Expo 2011</a> to pick set of must see presentations and publish the list, but this is not happening due to lack of time.  Instead I&#8217;m only going to recommend 1 talk, from list of tutorials I had a chance to review.   If you have not check it out yet, take a look at <a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17111">Linux and Hardware Optimizations</a> by Yoshinori Matsunobu.  Check out the <a href="http://assets.en.oreilly.com/1/event/56/Linux%20and%20H_W%20optimizations%20for%20MySQL%20Presentation.pdf">slides</a> which are very well done with many graphs and verbose enough explanations so you can easily follow slides alone.</p>
<p>Were you excited by some other talk on MySQL Conference and Expo ?  Feel free to leave it as a comment to this post.</p>
<p>View full post on <a href="http://www.mysqlperformanceblog.com/2011/05/09/must-read-talk-from-mysql-conference-and-expo/">MySQL Performance Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/05/must-read-talk-from-mysql-conference-and-expo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>David Shrewsbury: Installing Drizzle from Source on OS X</title>
		<link>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/</link>
		<comments>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 21:09:15 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[David]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[installing]]></category>
		<category><![CDATA[Shrewsbury]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/</guid>
		<description><![CDATA[Installing Drizzle on OS X 10.6 is pretty simple. We have a page on our wiki that has the basic steps, but I thought that I&#8217;d detail what I do on my Macs in the hope that it may make someone&#8217;s life easier.&#160;Note that we don&#8217;t build on any 10.5 machines, and I don&#8217;t use [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Drizzle on OS X 10.6 is pretty simple. <a href="http://wiki.drizzle.org/Compiling/MacOS_X">We have a page on our wiki</a> that has the basic steps, but I thought that I&#8217;d detail what I do on my Macs in the hope that it may make someone&#8217;s life easier.&nbsp;Note that we don&#8217;t build on any 10.5 machines, and I don&#8217;t use that version anymore, so YMMV with these instructions. Also, these instructions assume that you have the Xcode package already installed. I have Xcode 4 installed, but these instructions should work with Xcode 3, too. If they don&#8217;t, let me know.</p>
<p>I used to use MacPorts on my Macs to install the necessary libraries that are needed by Drizzle. I&#8217;ve recently dumped that because I didn&#8217;t like all of the extra stuff that was installed (do you <i>really</i>&nbsp;need to install a separate Perl installation?). And a recent b0rk of their Perl installations was the final straw.</p>
<p>It turns out that all you really need are just a few extra packages to build Drizzle on your Mac. Here are the packages that I currently have installed on my machines:</p>
<ul>
<li><a href="http://www.gnu.org/software/autoconf/">autoconf</a></li>
<li><a href="http://www.gnu.org/software/automake/">automake</a></li>
<li><a href="http://www.gnu.org/software/libtool/">libtool</a></li>
<li><a href="http://www.pcre.org/">pcre</a></li>
<li><a href="http://www.boost.org/users/download/">boost</a></li>
<li><a href="http://code.google.com/p/protobuf/downloads/list">protobuf</a></li>
</ul>
<div>The first three (autoconf, automake, and libtool) aren&#8217;t strictly necessary. I install those because I want newer versions of those tools than what OS X provides by default. It makes building a little bit nicer (the output is much cleaner). The last three are what you really need.</div>
<div></div>
<div>Each package has its own instructions for how to compile and install. I use the default installation path (/usr/local) for each. Basically, building and installing for each is simply:</div>
<div>
<ul>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
</ul>
<div>The Boost package is the lone exception:</div>
</div>
<div>
<ul>
<li>./bootstrap.sh</li>
<li>./bjam</li>
<li>sudo ./bjam install</li>
</ul>
<div>If you install the <i>libtool</i>&nbsp;package, there is one additional step you should do. That package installs the binaries <i>libtool</i>&nbsp;and <i>libtoolize</i>&nbsp;into /usr/local/bin. I rename these to <i>glibtool</i>&nbsp;and <i>glibtoolize</i>, respectively. The Drizzle build system looks for these program names.</div>
</div>
<div></div>
<div>The last thing I do is to make sure that /usr/local/bin is in my path. So in <i>$HOME/.bash_profile</i>, I have this line:</div>
<blockquote><p>export PATH=/usr/local/bin:$PATH</p></blockquote>
<p>With all that in place, to build Drizzle is just:</p>
<ul>
<li>./config/autorun.sh</li>
<li>./configure</li>
</ul>
<div>No need to add any extra options to <i>configure</i>&nbsp;to find libraries.</div>
<div class="blogger-post-footer"><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/3514705510593466065-7097639777431127330?l=dshrewsbury.blogspot.com" alt="" /></div>
<p>View full post on <a href="http://dshrewsbury.blogspot.com/2011/03/installing-drizzle-from-source-on-os-x.html">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>David Shrewsbury: Installing Drizzle from Source on OS X</title>
		<link>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/</link>
		<comments>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 21:09:15 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[David]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[installing]]></category>
		<category><![CDATA[Shrewsbury]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/</guid>
		<description><![CDATA[Installing Drizzle on OS X 10.6 is pretty simple. We have a page on our wiki that has the basic steps, but I thought that I&#8217;d detail what I do on my Macs in the hope that it may make someone&#8217;s life easier.&#160;Note that we don&#8217;t build on any 10.5 machines, and I don&#8217;t use [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Drizzle on OS X 10.6 is pretty simple. <a href="http://wiki.drizzle.org/Compiling/MacOS_X">We have a page on our wiki</a> that has the basic steps, but I thought that I&#8217;d detail what I do on my Macs in the hope that it may make someone&#8217;s life easier.&nbsp;Note that we don&#8217;t build on any 10.5 machines, and I don&#8217;t use that version anymore, so YMMV with these instructions. Also, these instructions assume that you have the Xcode package already installed. I have Xcode 4 installed, but these instructions should work with Xcode 3, too. If they don&#8217;t, let me know.</p>
<p>I used to use MacPorts on my Macs to install the necessary libraries that are needed by Drizzle. I&#8217;ve recently dumped that because I didn&#8217;t like all of the extra stuff that was installed (do you <i>really</i>&nbsp;need to install a separate Perl installation?). And a recent b0rk of their Perl installations was the final straw.</p>
<p>It turns out that all you really need are just a few extra packages to build Drizzle on your Mac. Here are the packages that I currently have installed on my machines:</p>
<ul>
<li><a href="http://www.gnu.org/software/autoconf/">autoconf</a></li>
<li><a href="http://www.gnu.org/software/automake/">automake</a></li>
<li><a href="http://www.gnu.org/software/libtool/">libtool</a></li>
<li><a href="http://www.pcre.org/">pcre</a></li>
<li><a href="http://www.boost.org/users/download/">boost</a></li>
<li><a href="http://code.google.com/p/protobuf/downloads/list">protobuf</a></li>
</ul>
<div>The first three (autoconf, automake, and libtool) aren&#8217;t strictly necessary. I install those because I want newer versions of those tools than what OS X provides by default. It makes building a little bit nicer (the output is much cleaner). The last three are what you really need.</div>
<div></div>
<div>Each package has its own instructions for how to compile and install. I use the default installation path (/usr/local) for each. Basically, building and installing for each is simply:</div>
<div>
<ul>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
</ul>
<div>The Boost package is the lone exception:</div>
</div>
<div>
<ul>
<li>./bootstrap.sh</li>
<li>./bjam</li>
<li>sudo ./bjam install</li>
</ul>
<div>If you install the <i>libtool</i>&nbsp;package, there is one additional step you should do. That package installs the binaries <i>libtool</i>&nbsp;and <i>libtoolize</i>&nbsp;into /usr/local/bin. I rename these to <i>glibtool</i>&nbsp;and <i>glibtoolize</i>, respectively. The Drizzle build system looks for these program names.</div>
</div>
<div></div>
<div>The last thing I do is to make sure that /usr/local/bin is in my path. So in <i>$HOME/.bash_profile</i>, I have this line:</div>
<blockquote><p>export PATH=/usr/local/bin:$PATH</p></blockquote>
<p>With all that in place, to build Drizzle is just:</p>
<ul>
<li>./config/autorun.sh</li>
<li>./configure</li>
</ul>
<div>No need to add any extra options to <i>configure</i>&nbsp;to find libraries.</div>
<div class="blogger-post-footer"><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/3514705510593466065-7097639777431127330?l=dshrewsbury.blogspot.com" alt="" /></div>
<p>View full post on <a href="http://dshrewsbury.blogspot.com/2011/03/installing-drizzle-from-source-on-os-x.html">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>David Shrewsbury: Installing Drizzle from Source on OS X</title>
		<link>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/</link>
		<comments>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 21:09:15 +0000</pubDate>
		<dc:creator>Abidoon</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[David]]></category>
		<category><![CDATA[from]]></category>
		<category><![CDATA[installing]]></category>
		<category><![CDATA[Shrewsbury]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/</guid>
		<description><![CDATA[Installing Drizzle on OS X 10.6 is pretty simple. We have a page on our wiki that has the basic steps, but I thought that I&#8217;d detail what I do on my Macs in the hope that it may make someone&#8217;s life easier.&#160;Note that we don&#8217;t build on any 10.5 machines, and I don&#8217;t use [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Drizzle on OS X 10.6 is pretty simple. <a href="http://wiki.drizzle.org/Compiling/MacOS_X">We have a page on our wiki</a> that has the basic steps, but I thought that I&#8217;d detail what I do on my Macs in the hope that it may make someone&#8217;s life easier.&nbsp;Note that we don&#8217;t build on any 10.5 machines, and I don&#8217;t use that version anymore, so YMMV with these instructions. Also, these instructions assume that you have the Xcode package already installed. I have Xcode 4 installed, but these instructions should work with Xcode 3, too. If they don&#8217;t, let me know.</p>
<p>I used to use MacPorts on my Macs to install the necessary libraries that are needed by Drizzle. I&#8217;ve recently dumped that because I didn&#8217;t like all of the extra stuff that was installed (do you <i>really</i>&nbsp;need to install a separate Perl installation?). And a recent b0rk of their Perl installations was the final straw.</p>
<p>It turns out that all you really need are just a few extra packages to build Drizzle on your Mac. Here are the packages that I currently have installed on my machines:</p>
<ul>
<li><a href="http://www.gnu.org/software/autoconf/">autoconf</a></li>
<li><a href="http://www.gnu.org/software/automake/">automake</a></li>
<li><a href="http://www.gnu.org/software/libtool/">libtool</a></li>
<li><a href="http://www.pcre.org/">pcre</a></li>
<li><a href="http://www.boost.org/users/download/">boost</a></li>
<li><a href="http://code.google.com/p/protobuf/downloads/list">protobuf</a></li>
</ul>
<div>The first three (autoconf, automake, and libtool) aren&#8217;t strictly necessary. I install those because I want newer versions of those tools than what OS X provides by default. It makes building a little bit nicer (the output is much cleaner). The last three are what you really need.</div>
<div></div>
<div>Each package has its own instructions for how to compile and install. I use the default installation path (/usr/local) for each. Basically, building and installing for each is simply:</div>
<div>
<ul>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
</ul>
<div>The Boost package is the lone exception:</div>
</div>
<div>
<ul>
<li>./bootstrap.sh</li>
<li>./bjam</li>
<li>sudo ./bjam install</li>
</ul>
<div>If you install the <i>libtool</i>&nbsp;package, there is one additional step you should do. That package installs the binaries <i>libtool</i>&nbsp;and <i>libtoolize</i>&nbsp;into /usr/local/bin. I rename these to <i>glibtool</i>&nbsp;and <i>glibtoolize</i>, respectively. The Drizzle build system looks for these program names.</div>
</div>
<div></div>
<div>The last thing I do is to make sure that /usr/local/bin is in my path. So in <i>$HOME/.bash_profile</i>, I have this line:</div>
<blockquote><p>export PATH=/usr/local/bin:$PATH</p></blockquote>
<p>With all that in place, to build Drizzle is just:</p>
<ul>
<li>./config/autorun.sh</li>
<li>./configure</li>
</ul>
<div>No need to add any extra options to <i>configure</i>&nbsp;to find libraries.</div>
<div class="blogger-post-footer"><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/3514705510593466065-7097639777431127330?l=dshrewsbury.blogspot.com" alt="" /></div>
<p>View full post on <a href="http://dshrewsbury.blogspot.com/2011/03/installing-drizzle-from-source-on-os-x.html">Planet Drizzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weez.com/2011/03/david-shrewsbury-installing-drizzle-from-source-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

