<?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>MemoSoup &#187; database</title>
	<atom:link href="http://www.memosoup.com/tag/database/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Thu, 09 Feb 2012 12:24:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>mySQL: size of the database</title>
		<link>http://www.memosoup.com/20091016/mysql-size-of-the-database.html</link>
		<comments>http://www.memosoup.com/20091016/mysql-size-of-the-database.html#comments</comments>
		<pubDate>Fri, 16 Oct 2009 15:23:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=204</guid>
		<description><![CDATA[SELECT table_schema &#34;Database&#34;, &#160;SUM&#40; data_length + index_length &#41; / 1024 / 1024 &#34;Size (MB)&#34;, &#160;SUM&#40; data_free &#41;/ 1024 / 1024 &#34;Free (MB)&#34; FROM information_schema.TABLES GROUP BY table_schema ; <p>This will work in mySQL 5.0.2 and newer. Use SHOW TABLE STATUS command for other versions.</p> Tweet news and informations&#160;automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> table_schema <span style="color: #ff0000;">&quot;Database&quot;</span><span style="color: #66cc66;">,</span> <br />
&nbsp;<span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span> data_length <span style="color: #66cc66;">+</span> index_length <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">1024</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">1024</span> <span style="color: #ff0000;">&quot;Size (MB)&quot;</span><span style="color: #66cc66;">,</span> <br />
&nbsp;<span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span> data_free <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">1024</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">1024</span> <span style="color: #ff0000;">&quot;Free (MB)&quot;</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLES</span><br />
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> table_schema ;</div></div>
<p>This will work in mySQL 5.0.2 and newer. Use <strong>SHOW TABLE STATUS</strong> command for other versions.</p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20091016%2Fmysql-size-of-the-database.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20091016/mysql-size-of-the-database.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="mySQL: size of the database" data-url="http://www.memosoup.com/20091016/mysql-size-of-the-database.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20091016/mysql-size-of-the-database.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS SQL &amp; Sybase: recreate master database</title>
		<link>http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html</link>
		<comments>http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:54:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[Sybase]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[recreate]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=180</guid>
		<description><![CDATA[<p>Sybase: before 12.5: buildmaster (bldmatr for NT)</p> buildmaster -d master_device -s size_in_2k_pages <p>12.5 and later: dataserver with some options (sqlsvr for NT)</p> dataserver -d master_device -b size -forcebuild -z page_size -Z size_of_master_db <p>MS SQL:</p> <p>before MS 2005: rebuildm utility (GUI)</p> <p>MS SQL 2005:</p> Start server in single-user mode (sqlserver.exe -m) setup.exe /qn INSTANCENAME=instance_name REINSTALL=SQL_Engine REBUILDDATABASE=1 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Sybase:</strong><br />
<strong>before 12.5</strong>: buildmaster (bldmatr for NT)</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">buildmaster -d master_device -s size_in_2k_pages</div></div>
<p><strong>12.5 and later</strong>: dataserver with some options (sqlsvr for NT)</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dataserver -d master_device -b size -forcebuild -z page_size -Z size_of_master_db</div></div>
<p><strong>MS SQL:</strong></p>
<p><strong>before MS 2005:</strong><br />
<em><strong>rebuildm</strong></em> utility (GUI)</p>
<p><strong>MS SQL 2005:</strong></p>
<ol>
<li>Start server in single-user mode (sqlserver.exe -m)</li>
<li>setup.exe /qn INSTANCENAME=instance_name REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=new_SA_Password</li>
<li>Restart server in normal mode</li>
</ol>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20090928%2Fms-sql-sybase-recreate-master-database.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="MS SQL &#038; Sybase: recreate master database" data-url="http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process all databases in Sybase</title>
		<link>http://www.memosoup.com/20090909/process-all-databases-in-sybase.html</link>
		<comments>http://www.memosoup.com/20090909/process-all-databases-in-sybase.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 16:45:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sybase]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[process]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=64</guid>
		<description><![CDATA[#!/usr/bin/ksh echo &#34;Started...&#34; print -u2 -n &#34;Enter password:&#34; stty -echo read PASS stty echo print rm -f databases.lst isql -U sa -S $DSQUERY -w 999&#60;&#60;EOF &#124; awk '/DBLABEL/ { print $2 }' &#62; databases.lst $PASS select 'DBLABEL' &#34;XXX&#34;, name from master..sysdatabases go exit EOF for DB in $&#40;cat databases.lst&#41; ; do print -u2 &#34;Processing $DB [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/ksh</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Started...&quot;</span><br />
<br />
print <span style="color: #660033;">-u2</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Enter password:&quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">stty</span> <span style="color: #660033;">-echo</span><br />
<span style="color: #c20cb9; font-weight: bold;">read</span> PASS<br />
<span style="color: #c20cb9; font-weight: bold;">stty</span> <span style="color: #7a0874; font-weight: bold;">echo</span><br />
print<br />
<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> databases.lst<br />
isql <span style="color: #660033;">-U</span> sa <span style="color: #660033;">-S</span> <span style="color: #007800;">$DSQUERY</span> <span style="color: #660033;">-w</span> <span style="color: #000000;">999</span><span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOF <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/DBLABEL/ { print $2 }'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> databases.lst<br />
<span style="color: #007800;">$PASS</span><br />
<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #ff0000;">'DBLABEL'</span> <span style="color: #ff0000;">&quot;XXX&quot;</span>, name from master..sysdatabases<br />
go<br />
<span style="color: #7a0874; font-weight: bold;">exit</span><br />
EOF<br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> DB <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> databases.lst<span style="color: #7a0874; font-weight: bold;">&#41;</span> ; <span style="color: #000000; font-weight: bold;">do</span><br />
<br />
print <span style="color: #660033;">-u2</span> <span style="color: #ff0000;">&quot;Processing <span style="color: #007800;">$DB</span> ...&quot;</span><br />
isql <span style="color: #660033;">-U</span> sa <span style="color: #660033;">-S</span> <span style="color: #007800;">$DSQUERY</span> <span style="color: #660033;">-w</span> <span style="color: #000000;">999</span> <span style="color: #660033;">-D</span> <span style="color: #007800;">$DB</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOF <br />
<span style="color: #007800;">$PASS</span><br />
<br />
<span style="color: #660033;">--</span> some commands here <br />
go<br />
<br />
<span style="color: #7a0874; font-weight: bold;">exit</span><br />
EOF<br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
print <span style="color: #660033;">-u2</span> <span style="color: #ff0000;">&quot;Done.&quot;</span></div></div>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20090909%2Fprocess-all-databases-in-sybase.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20090909/process-all-databases-in-sybase.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Process all databases in Sybase" data-url="http://www.memosoup.com/20090909/process-all-databases-in-sybase.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090909/process-all-databases-in-sybase.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

