 




<?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>The Multifunctioning DBA &#187; Data Files</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/dba/tag/data-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/dba</link>
	<description></description>
	<lastBuildDate>Wed, 06 Feb 2013 01:01:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Easy way to find bytes per cluster on your disk</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/easy-way-to-find-bytes-per-cluster-on-your-disk/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/easy-way-to-find-bytes-per-cluster-on-your-disk/#comments</comments>
		<pubDate>Thu, 16 Aug 2012 15:08:23 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Data Files]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Disk Performance]]></category>
		<category><![CDATA[block size]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[Sql server]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/?p=708</guid>
		<description><![CDATA[I recently learned a new windows command that is not the most intuitive, but it is nice.  I know that when I get a server and I am told that all my volumes are ready to go for SQL Server, I want to make sure that I have a 64K block. This command makes it [...]]]></description>
				<content:encoded><![CDATA[<p>I recently learned a new windows command that is not the most intuitive, but it is nice.  I know that when I get a server and I am told that all my volumes are ready to go for SQL Server, I want to make sure that I have a 64K block. This command makes it easy to verify.</p>
<p>&nbsp;</p>
<p>fsutil fsinfo ntfsinfo &lt;path&gt;</p>
<p>&nbsp;</p>
<p>That is it. Really simple but not the most intuitive. Here are the results.</p>
<p>&nbsp;</p>
<div id="attachment_709" class="wp-caption alignleft" style="width: 310px"><a href="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/83/files/2012/08/fsutil.jpg"><img class="size-medium wp-image-709" src="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/83/files/2012/08/fsutil-300x189.jpg" alt="FSUTIL" width="300" height="189" /></a><p class="wp-caption-text">fsutil example. Only 4k blocks on my c: drive</p></div>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/easy-way-to-find-bytes-per-cluster-on-your-disk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell Script to check if data and log files are growing by percent</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/powershell-script-to-check-if-data-and-log-files-are-growing-by-percent/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/powershell-script-to-check-if-data-and-log-files-are-growing-by-percent/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 13:56:01 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Data Files]]></category>
		<category><![CDATA[Growth]]></category>
		<category><![CDATA[Log Files]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/powershell-script-to-check-if-data-and-log-files-are-growing-by-percent/</guid>
		<description><![CDATA[In my new shop we try to grow our data and log files by a specific amount and not by a percentage. Our team lead ran into a database that had not been set up properly and wanted someone to check all our databases to verify that they have been set up correctly. Since I [...]]]></description>
				<content:encoded><![CDATA[<div>In my new shop we try to grow our data and log files by a specific  amount and not by a percentage. Our team lead ran into a database that  had not been set up properly and wanted someone to check all our  databases to verify that they have been set up correctly. Since I am the  new guy and still eager to impress I said I would take that task. So it  took me about 30 minutes to complete the task but now it will only take  me a few seconds to execute a powershell script.This script grabs a  list of all our SQL Servers from a table in a database that we have the  tracks this information. So the script will get the list and then loop  through them all and report on the databases that have data and or log  files set to grow by percent. here is the code.</div>
<div></div>
<p>#### Check Log and Data Growth for all User Databases. If they are not set up correctly then change them to the correct setting.<br />
$servers = invoke-sqlcmd -serverinstance server -database db -query &#8220;select InstanceName, Port from instance where IsActive = 1&#8243;<br />
$output = @()<br />
foreach($instance in $servers)<br />
{<br />
$name = $instance.instancename<br />
$port = $instance.port<br />
$server = &#8220;$name,$port&#8221;<br />
#echo &#8220;`n###########################</p>
<div>######&#8221;<br />
#$server</p>
<p>$s = New-Object (&#8216;Microsoft.SqlServer.Management.Smo.Server&#8217;) $server</p>
<p>$databases = $s.databases<br />
#$databases | get-member | where {$_.membertype -eq &#8220;Property&#8221;}<br />
foreach($database in $databases)<br />
{<br />
$name = $<a href="http://database.name/" target="_blank">database.name</a><br />
## Check the log File<br />
$logfiles = $database.logfiles<br />
foreach($logfile in $logfiles)<br />
{<br />
$filename = $logfile.filename<br />
$growth = $logfile.growth<br />
$growthtype = $logfile.growthtype<br />
if(($growthtype -eq &#8220;Percent&#8221;) -and ($name -ne &#8220;Master&#8221;) -and ($name -ne &#8220;Model&#8221;))<br />
{<br />
$Object = New-Object PSObject<br />
$Object | add-member Noteproperty Database $name<br />
$Object | add-member Noteproperty Growth $growth<br />
$Object | add-member Noteproperty GrowthType $growthtype<br />
$Object | add-member Noteproperty File $Filename<br />
$Object | add-member Noteproperty Instnace $server</p>
<p>$output = $output + $object<br />
#echo &#8220;$name $growth $growthtype $filename&#8221;<br />
}<br />
}<br />
## Datafiles<br />
$filegroups = $database.filegroups<br />
foreach($group in $filegroups)<br />
{<br />
$files = $group.files<br />
foreach($file in $files)<br />
{<br />
$filename = $file.filename<br />
$type = $file.growthtype<br />
$growth = $file.growth<br />
if(($type -eq &#8220;Percent&#8221;) -and ($name -ne &#8220;Master&#8221;) -and ($name -ne &#8220;Model&#8221;))<br />
{</p></div>
<div>$Object = New-Object PSObject</p>
<div>
$Object | add-member Noteproperty Database $name<br />
$Object | add-member Noteproperty Growth $growth<br />
$Object | add-member Noteproperty GrowthType $type<br />
$Object | add-member Noteproperty File $Filename<br />
$Object | add-member Noteproperty Instnace $server<br />
$output = $output + $object<br />
}<br />
}<br />
}<br />
}<br />
}<br />
$output | Out-GridView<br />
$output.count<br />
$output | Export-Csv <a>c:\out.csv</a></div>
<div>##############################################################################</div>
<div></div>
<div>So  you can see that n about 65 lines of code I was able to get a list of  all of the databases that are configured incorrectly and it also reports  on what file it is that is not set up correctly.</div>
<div></div>
<div>Hope this will help.</div>
</div>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/powershell-script-to-check-if-data-and-log-files-are-growing-by-percent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
