<?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; device</title>
	<atom:link href="http://www.memosoup.com/tag/device/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:03:54 +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>Find actual device numbers in Sybase</title>
		<link>http://www.memosoup.com/20090915/find-actual-device-numbers-in-sybase.html</link>
		<comments>http://www.memosoup.com/20090915/find-actual-device-numbers-in-sybase.html#comments</comments>
		<pubDate>Tue, 15 Sep 2009 21:05:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sybase]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[number]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=97</guid>
		<description><![CDATA[select low/16777216 &#34;vdevno&#34;, name, phyname from master..sysdevices where status&#38;=2 order by 1 <p>Warning! For vdevno&#62;127 it could generate incorrect results.</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 tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">select</span> low<span style="color: #808080;">/</span><span style="color: #000;">16777216</span> <span style="color: #FF0000;">&quot;vdevno&quot;</span>, name, phyname<br />
<span style="color: #0000FF;">from</span> master..<span style="color: #202020;">sysdevices</span><br />
<span style="color: #0000FF;">where</span> status<span style="color: #808080;">&amp;=</span><span style="color: #000;">2</span><br />
<span style="color: #0000FF;">order</span> <span style="color: #0000FF;">by</span> <span style="color: #000;">1</span></div></div>
<p><em>Warning!</em> For <strong>vdevno&gt;127</strong> it could generate incorrect results.</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%2F20090915%2Ffind-actual-device-numbers-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/20090915/find-actual-device-numbers-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="Find actual device numbers in Sybase" data-url="http://www.memosoup.com/20090915/find-actual-device-numbers-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/20090915/find-actual-device-numbers-in-sybase.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sybase sp_freedevice procedure</title>
		<link>http://www.memosoup.com/20090912/sybase-sp_freedevice-procedure.html</link>
		<comments>http://www.memosoup.com/20090912/sybase-sp_freedevice-procedure.html#comments</comments>
		<pubDate>Fri, 11 Sep 2009 23:37:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sybase]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[output]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=36</guid>
		<description><![CDATA[<p>Only the short info about Sybase database devices. Parameters: min_space &#8211; minimum of required space (i.e. 40 will display the devices with >=40M free space) the_name &#8211; the template for the device name (i.e. %mast% will display only master device)</p> <p>Warning! It was not tested for all possible configurations, so the result could be incorrect [...]]]></description>
			<content:encoded><![CDATA[<p>Only the short info about <strong>Sybase database devices</strong>.<br />
Parameters:<br />
 <em>min_space </em> &#8211; minimum of required space (i.e. 40 will display the devices with >=40M free space)<br />
 <em>the_name</em>  &#8211; the template for the device name (i.e. %mast% will display only master device)</p>
<p><strong>Warning! </strong>It was not tested for all possible configurations, so the result could be incorrect on some OS.</p>
<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">create</span> <span style="color: #0000FF;">procedure</span> sp_freedevice<br />
@min_space <span style="color: #0000FF;">int</span> <span style="color: #808080;">=</span> null,<br />
@the_name <span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">40</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">=</span> null<br />
<span style="color: #0000FF;">as</span><br />
<span style="color: #0000FF;">begin</span><br />
<br />
<span style="color: #0000FF;">declare</span> @numpgsmb <span style="color: #0000FF;">integer</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080;">/* Number of 'virtual' Pages per Megabytes */</span><br />
<span style="color: #0000FF;">select</span> @numpgsmb <span style="color: #808080;">=</span> <span style="color: #808080;">&#40;</span><span style="color: #000;">1048576</span>. <span style="color: #808080;">/</span> @@pagesize<span style="color: #808080;">&#41;</span><br />
<br />
<span style="color: #0000FF;">select</span> <span style="color: #FF0000;">&quot;phyname&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">40</span><span style="color: #808080;">&#41;</span>, d.<span style="color: #202020;">phyname</span><span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;name&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">28</span><span style="color: #808080;">&#41;</span>,d.<span style="color: #202020;">name</span><span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;d_size&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>,<span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #808080;">+</span> d.<span style="color: #202020;">high</span> <span style="color: #808080;">-</span> d.<span style="color: #202020;">low</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;d_used&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>, <span style="color: #FF00FF;">sum</span><span style="color: #808080;">&#40;</span>u.<span style="color: #0000FF;">size</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> ,<br />
<span style="color: #FF0000;">&quot;d_free&quot;</span><span style="color: #808080;">=</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #808080;">+</span> d.<span style="color: #202020;">high</span> <span style="color: #808080;">-</span> d.<span style="color: #202020;">low</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span> <span style="color: #808080;">-</span> <span style="color: #FF00FF;">sum</span><span style="color: #808080;">&#40;</span>u.<span style="color: #0000FF;">size</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span>,<br />
vdevno<span style="color: #808080;">=</span>d.<span style="color: #202020;">low</span><span style="color: #808080;">/</span><span style="color: #FF00FF;">power</span><span style="color: #808080;">&#40;</span><span style="color: #000;">2</span>,<span style="color: #000;">24</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&amp;</span> <span style="color: #000;">255</span><br />
<span style="color: #0000FF;">into</span> #free_device_all_tbl<br />
<span style="color: #0000FF;">from</span> master..<span style="color: #202020;">sysusages</span> u, master..<span style="color: #202020;">sysdevices</span> d<br />
<span style="color: #0000FF;">where</span> u.<span style="color: #202020;">vstart</span> between d.<span style="color: #202020;">low</span> and d.<span style="color: #202020;">high</span><br />
and d.<span style="color: #202020;">status</span> <span style="color: #808080;">&amp;</span> <span style="color: #000;">2</span> <span style="color: #808080;">=</span> <span style="color: #000;">2</span> <br />
<span style="color: #0000FF;">group</span> <span style="color: #0000FF;">by</span> d.<span style="color: #202020;">name</span><br />
<br />
<span style="color: #0000FF;">select</span> <br />
vdevno<span style="color: #808080;">=</span>low<span style="color: #808080;">/</span><span style="color: #FF00FF;">power</span><span style="color: #808080;">&#40;</span><span style="color: #000;">2</span>,<span style="color: #000;">24</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&amp;</span> <span style="color: #000;">255</span>,<br />
<span style="color: #FF0000;">&quot;Physical Name&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">40</span><span style="color: #808080;">&#41;</span>, d.<span style="color: #202020;">phyname</span><span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;Device Name&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">28</span><span style="color: #808080;">&#41;</span>,d.<span style="color: #202020;">name</span><span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;Size&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>,<span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #808080;">+</span> d.<span style="color: #202020;">high</span> <span style="color: #808080;">-</span> d.<span style="color: #202020;">low</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;Used&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>,<span style="color: #000;">0</span><span style="color: #808080;">&#41;</span>,<br />
<span style="color: #FF0000;">&quot;Free&quot;</span><span style="color: #808080;">=</span><span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>,<span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #808080;">+</span> d.<span style="color: #202020;">high</span> <span style="color: #808080;">-</span> d.<span style="color: #202020;">low</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span><br />
<span style="color: #0000FF;">from</span> master..<span style="color: #202020;">sysdevices</span> d<br />
<span style="color: #0000FF;">where</span> d.<span style="color: #202020;">name</span> not in <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">select</span> tmp.<span style="color: #202020;">name</span> <span style="color: #0000FF;">from</span> #free_device_all_tbl tmp<span style="color: #808080;">&#41;</span><br />
and d.<span style="color: #202020;">status</span> <span style="color: #808080;">&amp;</span> <span style="color: #000;">2</span> <span style="color: #808080;">=</span> <span style="color: #000;">2</span><br />
and <span style="color: #808080;">&#40;</span> @min_space <span style="color: #0000FF;">is</span> null or <span style="color: #808080;">&#40;</span><span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #808080;">+</span> d.<span style="color: #202020;">high</span> <span style="color: #808080;">-</span> d.<span style="color: #202020;">low</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> @numpgsmb<span style="color: #808080;">&#41;</span> <span style="color: #808080;">&gt;=</span> @min_space <span style="color: #808080;">&#41;</span><br />
and <span style="color: #808080;">&#40;</span> @the_name <span style="color: #0000FF;">is</span> null or d.<span style="color: #202020;">phyname</span> like @the_name or d.<span style="color: #202020;">name</span> like @the_name<span style="color: #808080;">&#41;</span><br />
<span style="color: #0000FF;">union</span><br />
<span style="color: #0000FF;">select</span> vdevno , &nbsp;phyname , name , d_size , d_used , <span style="color: #0000FF;">convert</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">varchar</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>, d_free<span style="color: #808080;">&#41;</span> <br />
<span style="color: #0000FF;">from</span> #free_device_all_tbl<br />
<span style="color: #0000FF;">where</span> <span style="color: #808080;">&#40;</span> @min_space <span style="color: #0000FF;">is</span> null or d_free <span style="color: #808080;">&gt;=</span> @min_space <span style="color: #808080;">&#41;</span><br />
and <span style="color: #808080;">&#40;</span> @the_name <span style="color: #0000FF;">is</span> null or phyname like @the_name or name like @the_name<span style="color: #808080;">&#41;</span><br />
<span style="color: #0000FF;">order</span> <span style="color: #0000FF;">by</span> <span style="color: #000;">1</span><br />
<br />
<span style="color: #0000FF;">end</span><br />
go</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%2F20090912%2Fsybase-sp_freedevice-procedure.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/20090912/sybase-sp_freedevice-procedure.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="Sybase sp_freedevice procedure" data-url="http://www.memosoup.com/20090912/sybase-sp_freedevice-procedure.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/20090912/sybase-sp_freedevice-procedure.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

