<?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>log files - Techyaz.com</title>
	<atom:link href="https://techyaz.com/tag/log-files/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Wed, 30 May 2018 14:58:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>log files - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SQL Server Error 5009: One or more files listed in the statement could not be found or could not be initialized</title>
		<link>https://techyaz.com/sql-server/troubleshooting/fix-sql-server-error-5009/</link>
					<comments>https://techyaz.com/sql-server/troubleshooting/fix-sql-server-error-5009/#comments</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Wed, 30 May 2018 14:47:37 +0000</pubDate>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[bulk import performance]]></category>
		<category><![CDATA[data file]]></category>
		<category><![CDATA[log files]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2355</guid>

					<description><![CDATA[<p>I had to add a log file to a database and then extend the size of this log file to a specific value. I got SQL Server error 5009 while creating the log file and got same error code again&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/troubleshooting/fix-sql-server-error-5009/">SQL Server Error 5009: One or more files listed in the statement could not be found or could not be initialized</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I had to add a log file to a database and then extend the size of this log file to a specific value. I got SQL Server error 5009 while creating the log file and got same error code again while extending the size of this file. Here i will describe how to fix Microsoft SQL Server Error 5009 while adding a database file or removing a database file or extending the database file size. You can see the screenshot of this error in below image while adding the log file.</p>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-2356 aligncenter" src="https://techyaz.com/wp-content/uploads/2018/05/1-error-5009-min.jpg" alt="Microsoft SQL Server Error 5009" width="598" height="232" srcset="https://techyaz.com/wp-content/uploads/2018/05/1-error-5009-min.jpg 598w, https://techyaz.com/wp-content/uploads/2018/05/1-error-5009-min-300x116.jpg 300w" sizes="(max-width: 598px) 100vw, 598px" /></p>
<h3><span style="color: #333399;">Microsoft SQL Server Error 5009 While Adding Database File</span></h3>
<p>I was working on a migration project where we had to load huge data in a SQL Server database on the target server. To optimize data load performance, we had decided to create database with the final size on the destination server. The final size of database post data import was around 800 GB. We made some configurational changes to reduce data import time. Extending database files size was one of the step to reduce data load time. If you want to learn<strong> <a href="https://techyaz.com/sql-server/improve-sql-server-bulk-data-import-performance/" target="_blank" rel="noopener">how to speed up data import</a></strong> then I would suggest reading attached article.</p>
<p>We decided to add one more log file on separate drive considering extensive log growth during data load. While adding the log file, we got error 5009. Full error details are given below.</p>
<p><em><span style="color: #ff0000;">One or more files listed in the statement could not be found or could not be initialized. CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file &#8216;T:\Techyaz_log3.ldf&#8217;.(Microsoft SQL Server, Error: 5009)</span></em></p>
<p>As error suggests, I don&#8217;t had enough permission to create this file on given location where i was trying to create the log file. There are two solutions to fix this issue. First solution is to set the Operating system permission on the mentioned .ldf file to full permission for your login account and SQL Server service account. While second solution is to change the location to the path where you have enough permission to create or add database files. Any of these two solutions will fix your problem. Let&#8217;s go to another version of Microsoft SQL Server Error 5009 while extending the log file.</p>
<h3><span style="color: #333399;">Microsoft SQL Server Error 5009 While Extending the Size of Log File</span></h3>
<p>When i changed the location to create this ldf file to a directory <em>T:\Data\Techyaz_log3.ldf </em>this time log file was created but we get same issue again while extending the size of this log file. Next, I was assigning bigger value to each data and log files. We had successfully increased data files size in few minutes because we had already <strong><a href="https://techyaz.com/sql-server/instant-file-initialization-enable-on-sql-server-instance/" target="_blank" rel="noopener">enabled Instant File Initialization to skip zeros process</a></strong> on storage but we faced Microsoft SQL Server error 5009 again while increasing the size of log files. i was extending  log file with bigger values. As we know Instant File Initialization does not work for transaction log files so extending the size of log files was taking lot of time. This time access denied issue was disappeared but error 5009 issue was there only. Error description for this error is given below.</p>
<p><em><span style="color: #ff0000;">Msg 5009, Level 16, State 9, Line 1</span></em><br />
<em><span style="color: #ff0000;">One or more files listed in the statement could not be found or could not be initialized.</span></em></p>
<p>To fix this error, we had passed small value to extend the file size. Earlier we were trying to increase the log file in a slot of 40 GB in single go. It was taking time to finish but most of time log file size got extended with 40GB but sometimes we had received above Microsoft SQL Server error 5009. When we got this error, we extend the size of log file to 10Gb in place of 40GB that we were doing previously. Reducing the value while extending the log file has fixed this issue and log files had been extended to its future size successfully.</p>
<h3><span style="color: #333399;">Microsoft SQL Server Error 5009 While Removing Database File</span></h3>
<p>Some of the blogs have suggested that they got SQL Server error 5009 while removing a logical file in SQL Server but surprisingly I got this error while creating or increasing the size of log file. So if you are getting this error while removing any database file then you can keep reading this article to solve this issue.</p>
<p>Whenever we add any database file then its entry got captured in system catalog files, if you are trying to delete any database file then there might be possibility that logical name of the file that you try to remove is not unique in the system catalog tables. For example, this issue occurs if the file existed in the database earlier, and then the file was removed. When you remove the file, it will try to drop earlier file that has been removed but its metadata is not cleaned and appear like ghost file.</p>
<p>You should follow below steps to fix this issue.</p>
<ul>
<li>Create a new logical file with different name and the same data type. For example, If your file;s logical name is Techyaz_Logical_Name then create this new file with “Techyaz_Logical_Name_New&#8221;. Run below command to create this file.</li>
</ul>
<pre style="padding-left: 60px;"><span style="color: #0000ff;"><strong>ALTER DATABASE [Techyaz] 
ADD FILE ( NAME = N'Techyaz_Logical_Name_New', FILENAME = N'T:\DATA\Techyaz_file4.ndf', SIZE = 10MB, MAXSIZE = 100MB)</strong></span></pre>
<ul>
<li>Now we will remove the logical file that we have created in step 1, as in the following example:</li>
</ul>
<pre style="padding-left: 60px;"><span style="color: #0000ff;"><strong>ALTER DATABASE [Techyaz] REMOVE FILE [Techyaz_Logical_Name_New]</strong></span></pre>
<ul>
<li>Run a transaction log backup of the database.</li>
<li>Now go ahead and remove the logical file that were trying to remove earlier and your received Microsoft SQL Server Error 5009.</li>
</ul>
<p>Here, I have described multiple possibilities and fixes for Microsoft SQL Server Error 5009. I hope you like this article. Please follow us on our <a href="https://www.facebook.com/Techyaz/">facebook page</a> and on <a href="https://twitter.com/Tech_yaz">Twitter </a>handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/manage-transaction-log-file-during-data-load/" target="_blank" rel="noopener">Manage Transaction Log File during Data Load</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/get-total-virtual-log-files/" target="_blank" rel="noopener">How to get total no of virtual log files in a transaction log file</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-3023-error-3013-error-3041/" target="_blank" rel="noopener">Fix Error 3023: Shrink failed for Log file</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/understanding-transaction-log-architecture/" target="_blank" rel="noopener">Understanding SQL Server Transaction Log Architecture</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-1105/" target="_blank" rel="noopener">Fix SQL Server Error 1105: Could Not Allocate Space for Object in Database because the Filegroup is Full</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-msg-5144-and-5145-for-long-or-failed-autogrow/" target="_blank" rel="noopener">Fix SQl Server Error 5144 and 5145 for long and failed Autogrow of data and log file</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/troubleshooting/fix-sql-server-error-5009/">SQL Server Error 5009: One or more files listed in the statement could not be found or could not be initialized</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/troubleshooting/fix-sql-server-error-5009/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to Change Database Default Locations in SQL Server?</title>
		<link>https://techyaz.com/sql-server/change-database-default-locations-sql-server/</link>
					<comments>https://techyaz.com/sql-server/change-database-default-locations-sql-server/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Thu, 03 May 2018 11:16:42 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[data file]]></category>
		<category><![CDATA[data_files]]></category>
		<category><![CDATA[database property]]></category>
		<category><![CDATA[log files]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=2215</guid>

					<description><![CDATA[<p>Sometimes, we need to change default database File locations to some other path in SQL Server. If you have configured SQL Server default database file location as drive C then all SQL Server databases will be created in the path&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/change-database-default-locations-sql-server/">How to Change Database Default Locations in SQL Server?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes, we need to change default database File locations to some other path in SQL Server. If you have configured SQL Server default database file location as drive C then all SQL Server databases will be created in the path set as database default locations if you have not mentioned their specific drives during database creation. You might need to change this path as per your environment standard. Here, I am going to show you how to view or change database default location in SQL Server.</p>
<p>One thing we should always keep in mind that if we change database default path in SQL Server then it will not change or move the database file locations for your existing databases. If you want to move all existing databases or you want to change database files path to the new location then you need to manually do it for each database.</p>
<p>Once you will change default database file locations then all databases you will create on that SQL Server Instance will be created on new location. Suppose your existing SQL Server default database location is set in C drive and now you have decided to change it to D drive for data files and F drive for Log files then all databases you will create post this change will be created in these both drives. If you will mention any other specific drive during database creation then SQL Server uses that drive and not these database default locations. The SQL Server data file will be created in D drive and log file will be created in F drive but all the existing databases that were created earlier in C drive will not move to new SQL server database file location. If you want to move these databases or want to change database files location then you need to manually do it either by detach-attach method or by ALTER statement.</p>
<h3><span style="color: #333399;">Change Database Default Locations in SQL Server</span></h3>
<p>It&#8217;s very simple method to change default log file location or default data file location in SQL Server. Let’s start to change default database path in SQL Server.</p>
<ul>
<li>Launch SQL Server Management Studio and connect to your SQL Server Instance for which you must change default log file location or default data file location in SQL Server.</li>
<li>Now right click at SQL Server Instance node and choose Properties option.</li>
<li>You will get server properties window on your screen. Click at “Database Settings” from left side pane. You will get all server level details for SQL Server databases in right side pane. Look at the database default locations option given bottom of the right-side pane. Here you can see separate default location for data files, Log file and backup files.</li>
</ul>
<p><img decoding="async" class="size-full wp-image-2216 aligncenter" src="http://techyaz.com/wp-content/uploads/2018/05/default-db-path-min.png" alt="Change Default database file location in SQL Server" width="693" height="631" srcset="https://techyaz.com/wp-content/uploads/2018/05/default-db-path-min.png 693w, https://techyaz.com/wp-content/uploads/2018/05/default-db-path-min-300x273.png 300w" sizes="(max-width: 693px) 100vw, 693px" /></p>
<ul>
<li>You can see database default locations for each file are showing in C drive. It means every database that will be created without mentioning their data or log file location will go to above given SQL Server database default locations.</li>
<li>To change database default path, you need to browse current database default locations for each file to new the new location. Click at three dots showing next to data file or log file locations and then select the new path.</li>
<li>Repeat same exercise for each file. To change default data file location, click at three dots next to data path and select new path here. Similarly, click at three dots next to log file location to change default log file location. If you want to change default backup file location then do the same for backup location as well.</li>
<li>Click ak Ok button once you made changes for desired database file locations.</li>
<li>Last step is to restart SQL Server services to apply this change and bring it into effect.</li>
</ul>
<p>Once you will restart SQL Server services, your SQL Server default database location will be changed to the new path. I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><a href="http://techyaz.com/sql-server/get-total-virtual-log-files/" target="_blank" rel="noopener">Get Total Number of Virtual Log Files in SQL Server Transaction Log File</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/troubleshooting/fix-error-1105/" target="_blank" rel="noopener">SQL Server Error 1105: Could Not Allocate Space for Object in Database because the filegroup is full</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/troubleshooting/change-sql-server-instance-name/" target="_blank" rel="noopener">How to Change SQL Server Instance Name?</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/always-turn-off-database-auto-shrink/" target="_blank" rel="noopener">Why Should You Always Turn Off Database Auto Shrink Property?</a></strong></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://techyaz.com/sql-server/change-database-default-locations-sql-server/">How to Change Database Default Locations in SQL Server?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/change-database-default-locations-sql-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
