<?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>dp&#039;s blog &#187; data</title>
	<atom:link href="http://blog.dp.cx/tag/data/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.dp.cx</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 18 Jul 2010 23:03:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Databases and backups</title>
		<link>http://blog.dp.cx/155/databases-and-backups#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=databases-and-backups</link>
		<comments>http://blog.dp.cx/155/databases-and-backups#comments</comments>
		<pubDate>Thu, 06 May 2010 15:05:42 +0000</pubDate>
		<dc:creator>dp</dc:creator>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.dp.cx/?p=155</guid>
		<description><![CDATA[Yesterday, I managed to delete the primary database that we use at work.  I won&#8217;t go in to how this happened, other than to say: Fuck you MySQL Workbench.  I was trying to get a map of the table relations within the database.  Needless to say, it didn&#8217;t work.  After the immediate pants-wiping, I restored [...]


Related posts:<ol><li><a href='http://blog.dp.cx/126/how-to-fix-strange-characters-in-mysql-database-%e2%80%93-vinh-pham' rel='bookmark' title='Permanent Link: How to fix strange characters in MySQL database – Vinh Pham'>How to fix strange characters in MySQL database – Vinh Pham</a> <small>I admit, I borrowed this from How to fix strange characters...</small></li>
<li><a href='http://blog.dp.cx/140/udev-debugging-toolbox-%c2%ab-web-0-2' rel='bookmark' title='Permanent Link: udev debugging toolbox « Web 0.2'>udev debugging toolbox « Web 0.2</a> <small>This is a great read about working with udev, specifically,...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/25259640@N00/143809584" onclick="return TrackClick('http%3A%2F%2Fwww.flickr.com%2Fphotos%2F25259640%40N00%2F143809584','MySQL+Workbench')"><img title="MySQL Workbench" src="http://blog.dp.cx/wp-content/uploads/2010/06/143809584_bed5bee56c_m.jpg" alt="MySQL Workbench" width="240" height="161" /></a><p class="wp-caption-text">Image by jeromejtk via Flickr</p></div>
</div>
<p>Yesterday, I managed to delete the primary <a class="zem_slink" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database" onclick="return TrackClick('http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDatabase','Database')">database</a> that we use at work.  I won&#8217;t go in to how this happened, other than to say: Fuck you <a class="zem_slink" title="MySQL" rel="homepage" href="http://www.mysql.com" onclick="return TrackClick('http%3A%2F%2Fwww.mysql.com','MySQL')">MySQL</a> Workbench.  I was trying to get a map of the table relations within the database.  Needless to say, it didn&#8217;t work.  After the immediate pants-wiping, I restored the database from the backup. But the backup was from the previous morning, as the current backup hadn&#8217;t finished.  Unfortunately, I couldn&#8217;t find the files from the mornings backup.</p>
<p>In short, losing data sucks.  How often do database &#8220;pros&#8221; backup their data?</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=094d5798-7590-49d0-88a6-58ebb618aa69" alt="" /></div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.dp.cx/155/databases-and-backups/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.dp.cx/155/databases-and-backups&amp;title=Databases+and+backups" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.dp.cx/155/databases-and-backups&amp;title=Databases+and+backups" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.dp.cx/155/databases-and-backups&amp;title=Databases+and+backups&amp;desc=%0D%0A%0D%0A%0D%0A%0D%0A%0D%0AYesterday%2C%20I%20managed%20to%20delete%20the%20primary%20database%20that%20we%20use%20at%20work.%20%C2%A0I%20won%27t%20go%20in%20to%20how%20this%20happened%2C%20other%20than%20to%20say%3A%20Fuck%20you%20MySQL%20Workbench.%20%C2%A0I%20was%20trying%20to%20get%20a%20map%20of%20the%20table%20relations%20within%20the%20database.%20%C2%A0Needless%20to%20say%2C%20it%20didn%27t%20work.%20%C2%A0After%20the%20immediate%20pants" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.dp.cx/155/databases-and-backups&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://blog.dp.cx/155/databases-and-backups&amp;bm_description=Databases+and+backups&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blog.dp.cx/155/databases-and-backups&amp;title=Databases+and+backups" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.dp.cx/155/databases-and-backups&amp;title=Databases+and+backups" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.dp.cx/155/databases-and-backups&amp;title=Databases+and+backups" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.dp.cx/155/databases-and-backups" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Databases+and+backups+-+http://b2l.me/wbfd5&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.dp.cx/155/databases-and-backups&amp;t=Databases+and+backups" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Databases+and+backups&amp;link=http://blog.dp.cx/155/databases-and-backups" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://blog.dp.cx/?ak_action=api_record_view&id=155&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://blog.dp.cx/126/how-to-fix-strange-characters-in-mysql-database-%e2%80%93-vinh-pham' rel='bookmark' title='Permanent Link: How to fix strange characters in MySQL database – Vinh Pham'>How to fix strange characters in MySQL database – Vinh Pham</a> <small>I admit, I borrowed this from How to fix strange characters...</small></li>
<li><a href='http://blog.dp.cx/140/udev-debugging-toolbox-%c2%ab-web-0-2' rel='bookmark' title='Permanent Link: udev debugging toolbox « Web 0.2'>udev debugging toolbox « Web 0.2</a> <small>This is a great read about working with udev, specifically,...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dp.cx/155/databases-and-backups/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cleaning up bad data in an SQL database</title>
		<link>http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cleaning-up-bad-data-in-an-sql-database</link>
		<comments>http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:13:16 +0000</pubDate>
		<dc:creator>dp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.dp.cx/?p=27</guid>
		<description><![CDATA[Recently, I needed to find all of the data in a table that was being used for HTML output, that had non-printable characters. The following SQL statement should do that for you: select id, name from table_name where name not regexp '^[a-zA-Z0-9_ ,&#38;;\/&#60;&#62;(²):%*#?$&#124;!+.\"\'-]+$; This code is MySQL specific, but should be applicable anywhere, really. Subscribe [...]


Related posts:<ol><li><a href='http://blog.dp.cx/126/how-to-fix-strange-characters-in-mysql-database-%e2%80%93-vinh-pham' rel='bookmark' title='Permanent Link: How to fix strange characters in MySQL database – Vinh Pham'>How to fix strange characters in MySQL database – Vinh Pham</a> <small>I admit, I borrowed this from How to fix strange characters...</small></li>
<li><a href='http://blog.dp.cx/155/databases-and-backups' rel='bookmark' title='Permanent Link: Databases and backups'>Databases and backups</a> <small>Yesterday, I managed to delete the primary database that we...</small></li>
<li><a href='http://blog.dp.cx/120/gms8994s-benchmark-at-master-github' rel='bookmark' title='Permanent Link: gms8994′s benchmark at master – GitHub'>gms8994′s benchmark at master – GitHub</a> <small>I&#8217;ve recently been posting my benchmark scripts to github.  You...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed to find all of the data in a table that was being used for HTML output, that had non-printable characters.  The following SQL statement should do that for you:</p>
<pre class="prettyprint" style="overflow: scroll">select id, name
from table_name
where name not regexp '^[a-zA-Z0-9_ ,&amp;;\/&lt;&gt;(²):%*#?$|!+.\"\'-]+$;</pre>
<p>This code is MySQL specific, but should be applicable anywhere, really.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;title=Cleaning+up+bad+data+in+an+SQL+database" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;title=Cleaning+up+bad+data+in+an+SQL+database" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;title=Cleaning+up+bad+data+in+an+SQL+database&amp;desc=Recently%2C%20I%20needed%20to%20find%20all%20of%20the%20data%20in%20a%20table%20that%20was%20being%20used%20for%20HTML%20output%2C%20that%20had%20non-printable%20characters.%20%20The%20following%20SQL%20statement%20should%20do%20that%20for%20you%3A%0D%0Aselect%20id%2C%20name%0D%0Afrom%20table_name%0D%0Awhere%20name%20not%20regexp%20%27%5E%5Ba-zA-Z0-9_%20%2C%26amp%3B%3B%5C%2F%26lt%3B%26gt%3B%28%C2%B2%29%3A%25%2A%23%3F%24%7C%21%2B.%5C%22%5C%27-%5D%2B%24%3B%0D%0AThis%20cod" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;bm_description=Cleaning+up+bad+data+in+an+SQL+database&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;title=Cleaning+up+bad+data+in+an+SQL+database" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;title=Cleaning+up+bad+data+in+an+SQL+database" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;title=Cleaning+up+bad+data+in+an+SQL+database" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Cleaning+up+bad+data+in+an+SQL+database+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database&amp;t=Cleaning+up+bad+data+in+an+SQL+database" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Cleaning+up+bad+data+in+an+SQL+database&amp;link=http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<img src="http://blog.dp.cx/?ak_action=api_record_view&id=27&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://blog.dp.cx/126/how-to-fix-strange-characters-in-mysql-database-%e2%80%93-vinh-pham' rel='bookmark' title='Permanent Link: How to fix strange characters in MySQL database – Vinh Pham'>How to fix strange characters in MySQL database – Vinh Pham</a> <small>I admit, I borrowed this from How to fix strange characters...</small></li>
<li><a href='http://blog.dp.cx/155/databases-and-backups' rel='bookmark' title='Permanent Link: Databases and backups'>Databases and backups</a> <small>Yesterday, I managed to delete the primary database that we...</small></li>
<li><a href='http://blog.dp.cx/120/gms8994s-benchmark-at-master-github' rel='bookmark' title='Permanent Link: gms8994′s benchmark at master – GitHub'>gms8994′s benchmark at master – GitHub</a> <small>I&#8217;ve recently been posting my benchmark scripts to github.  You...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dp.cx/27/cleaning-up-bad-data-in-an-sql-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
