<?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>PicaTeclas &#187; espacio</title>
	<atom:link href="http://picateclas.net/posts/tag/espacio/feed/" rel="self" type="application/rss+xml" />
	<link>http://picateclas.net</link>
	<description></description>
	<lastBuildDate>Mon, 03 Jan 2011 12:10:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Obtener el espacio ocupado por las bases de datos de MySQL</title>
		<link>http://picateclas.net/posts/obtener-el-espacio-ocupado-por-las-bases-de-datos-de-mysql/</link>
		<comments>http://picateclas.net/posts/obtener-el-espacio-ocupado-por-las-bases-de-datos-de-mysql/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 12:08:23 +0000</pubDate>
		<dc:creator>zetxek</dc:creator>
				<category><![CDATA[fragmentos útiles]]></category>
		<category><![CDATA[disco]]></category>
		<category><![CDATA[espacio]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://picateclas.net/?p=102</guid>
		<description><![CDATA[En The Arctel Journal tienen un pequeño y útil fragmento de código MySQL para obtener el espacio ocupado por los datos de las distintas bases de datos MySQL de un servidor: SELECT table_schema, count(*) TABLES, concat(round(sum(table_rows)/1000000,2),'M') rows,concat(round(sum(data_length)/(1024*1024*1024),2),'G') DATA,concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx,concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size,round(sum(index_length)/sum(data_length),2) idxfrac FROM information_schema.TABLES group by table_schema; O la versión en Mb y miles de filas [...]]]></description>
			<content:encoded><![CDATA[<p>En <a href="http://arcterex.net/blog/archives/2008/08/20/finding_mysql_table_disk_usage.html">The Arctel Journal</a> tienen un pequeño y útil fragmento de código MySQL para obtener el espacio ocupado por los datos de las distintas bases de datos MySQL de un servidor:</p>
<blockquote>
<pre><code><tt><tt>SELECT
   table_schema, count(*) TABLES,
   concat(round(sum(table_rows)/1000000,2),'M')
   rows,concat(round(sum(data_length)/(1024*1024*1024),2),'G')
   DATA,concat(round(sum(index_length)/(1024*1024*1024),2),'G')
   idx,concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G')
   total_size,round(sum(index_length)/sum(data_length),2) idxfrac
FROM
   information_schema.TABLES group by table_schema; </tt></tt></code></pre>
</blockquote>
<p>O la versión en Mb y miles de filas (en vez de GB y millones de filas):</p>
<blockquote><p>SELECT table_schema, count(  *   )<br />
TABLES , concat( round( sum( table_rows )  /1000, 2  ) ,  'K'  )<br />
ROWS , concat( round( sum( data_length )  /  ( 1024 *1024  ) , 2  ) ,  'Mb'  )<br />
DATA , concat( round( sum( index_length )  /  ( 1024 *1024  ) , 2  ) ,  'Mb'  ) idx, concat( round( sum( data_length +  index_length )  / ( 1024 *1024  ) , 2  ) ,  'Mb'  ) total_size, round( sum( index_length )  / sum( data_length ) , 2  ) idxfrac<br />
FROM information_schema.TABLES<br />
GROUP  BY table_schema;</p></blockquote>
<p>Para ejecutarlo podemos recurrir a PhpMyAdmin, alguna herramienta similar, ejecutar el comando mediante la consola o crear un pequeño script que lo ejecute y muestre los resultados en pantalla...</p>
]]></content:encoded>
			<wfw:commentRss>http://picateclas.net/posts/obtener-el-espacio-ocupado-por-las-bases-de-datos-de-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

