<?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>Andrew Jackson &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/author/andrewjackson/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Thu, 07 Jun 2018 16:07:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Andrew Jackson &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Foolproof Tips for Reading and Shrinking Transaction logs in SQL Server</title>
		<link>https://mail.sibeeshpassion.com/transaction-log-in-sql-server/</link>
					<comments>https://mail.sibeeshpassion.com/transaction-log-in-sql-server/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Thu, 07 Jun 2018 13:35:37 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Transaction]]></category>
		<category><![CDATA[Transaction logs in SQL]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=12943</guid>

					<description><![CDATA[[toc] Query-1: SQL Server log file growing unexpectedly? “We are wondering why transaction logs keep on increasing?? It become so gigantic, the transaction log size get increase from 135GB to 350GB and that&#8217;s so annoying. My drive containing data store is losing space. I am using Full Recovery Model and the logs are backed up hourly. Please help me out why this is happening and what should be done to stop growing it too big?” SOLVED: SQL Server Log File Getting Too Big SQL Server Transaction logs records all activities of transaction logs. Each database in SQL Server instance consists [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Query-1: SQL Server log file growing unexpectedly?</h2>
<p><i>“We are wondering why transaction logs keep on increasing?? It become so gigantic, the transaction log size get increase from 135GB to 350GB and that&#8217;s so annoying. My drive containing data store is losing space. I am using Full Recovery Model and the logs are backed up hourly. Please help me out why this is happening and what should be done to stop growing it too big?”</i></p>
<h3>SOLVED: SQL Server Log File Getting Too Big</h3>
<p>SQL Server Transaction logs records all activities of transaction logs. Each database in SQL Server instance consists of logs that records all the modification done in the databases. It is crucial component of the databases. Any modification, deletion can be tracked down in transaction logs.</p>
<p>There are various reasons of transaction log file getting expanded. The possible reasons are listed below:</p>
<ul>
<li>Large transaction log file</li>
<li>Transaction taking too long to complete</li>
<li>Transaction operation fail &amp; may start to rollback</li>
<li>Issue in performance</li>
<li>Blocking issue</li>
<li>Database participating in AlwaysOn availability group</li>
</ul>
<h4>What to do for stopping growing log file too big</h4>
<ol>
<li>Change the type of Recovery Model to Simple Recovery Model only if you are fine with not able to restore logs hence, failed point in time recovery. It is because if you are truncating your logs, you are breaking Transaction log LSN &amp; if any disaster occur, you will not able to restore T-logs. Hence if you are fine with this situation, then change your Recovery model to Simple. This will not allow any extra growth of log file.</li>
<li>Take T-log backup every hour in Full recovery Model, your transaction log will keep on growing until you take backup and truncate of it. While taking hourly T-log backup, the logs will grow until one hour, but after this it would truncate all commited transaction.</li>
</ol>
<p>Sometimes it might happen that you are in Simple Recovery Model, but your logs are still growing!!! Reason being is long running transaction. If your transaction taking long time when deleting thousand records in one delete statement, then logs will not be able to truncate until delete operation is done.</p>
<p>You can save yourself by maintaining proper size of log file or monitoring the usage of transaction.</p>
<p>By doing this, you can cut down the size of Transaction log.</p>
<h2>Query-2 How To Shrink Transaction logs File in SQL Server?</h2>
<p><i>“My log file size is growing continuously. Why is this happening?? I am lacking my disk space. I want to shrink my Transaction log file. Can anyone tell me how to shrink transaction logs in SQL Server. What will be the after effects if I shrink the log file. </i></p>
<h3>SOLVED: Reduce SQL Server Database Transaction Log File</h3>
<p>Relax!! There are several reasons for transaction log file growth. Long Running transaction, lack of taking log backup are some of the reasons which result in transaction log growth. Databases running for business purposes or production requires appropriate recovery model to be chosen for log management.</p>
<p>Log truncation frees up the log file space so that logs can reuse it. Truncation occur automatically if the database is backed up in Simple Recovery Model or after log backup when database is in Full Recovery Model.</p>
<p>Here I will resolve your shrink issue by two methods: By using SQL Server Management Studio and by using T-SQL.</p>
<h4><strong>Shrink By SQL Server Management Studio:</strong></h4>
<ul>
<li>Right Click on your Database&#8211;&gt;Tasks&#8211;&gt;Shrink&#8212;&gt;Files.</li>
<li>You will get the <strong>Shrink File</strong> Window, Change the File Type to <strong>Log</strong>.</li>
<li>There are three different actions under Shrink Action option. Either release the unused space, or shrink file to reorganize pages before releasing unused space, or empty file by migrating the data to other files in the same filegroup. Choose it according to your need.</li>
</ul>
<h4><strong>Shrink By T-SQL:</strong></h4>
<p>You can simply shrink transaction log file by running DBCC SHRINKFILE after taking log back. If you are using Simple Recovery Model, run below code:</p>
<p><code> DBCC SHRINKFILE (TestDB_log, 1)</code></p>
<p>If your database is in Full Recovery Model, first of all, set it to Simple Recovery Model, Then run DBCC SHRINKFILE and then set it to full.</p>
<p><strong>Caution:</strong> Setting database again in Full Recovery Model leads to loss of data in the Log. So, if you dont care about losing your log data, then definitely go for it!</p>
<h4><strong>Tips when you plan to shrink database or file: </strong></h4>
<ul>
<li>Shrink operation found to be most effective after delete or drop table operation as it create lot of unused space.</li>
<li>If you are repeatedly shrinking your database and you notice that the size of database grows again. Alert!! Shrinking database is a wasted operation, as most database require free space for regular day-to-day operation. This indicates that the space that was shrunk was a part of regular operation.</li>
<li>You should not shrink your database or data file after rebuilding indexes. As shrinking increases fragmentation to extreme level.</li>
<li>Do not ON Auto_Shrink option. (Unless you have very urgent requirement)</li>
</ul>
<h4>Is Shrinking database Bad?</h4>
<p>Well, Yes.</p>
<p>After shrinking operation,you will definitely be able to reduce the size of the database. But Wait!! Check your Fragmentation level first. It is found to be way too much!!!</p>
<p>Shrink operation increases the value of the fragmentation way too much. And higher fragmentation costs you poor performance of the database.</p>
<p>While if you are thinking that you can reduce fragmentation by using rebuild index, let me alert you, this will definitely reduce your fragmentation level. But Let me check the size of the database The database size increases way higher than the original.</p>
<h2>Query-3 How to check Deleted Records in SQL Server?</h2>
<p><i>“I am working in an organization and my manager assigned me work to check deleted database records of my database. How can I check my deleted records in SQL Server? Please Help me out from this situation.”</i></p>
<h3>SOLVED: Ways to Check Deleted Records in SQL Server</h3>
<p>You can track down your deleted database records by reading Transaction logs. And you can read it by using <strong>fn_dblog</strong> function. You can track down any DML as well as DDL activity like insert, delete , update, create operation by checking your transaction logs.</p>
<p>Fn_dblog function enables users to read all the database activity happening in SQL database. The function require begin and end LSN number for a transaction. You can easily trackdown the information of a person who did changes to your database. As LSN number are not in human readable form, SQL Server provide fn_dblog function for easy reading of transaction logs.</p>
<p>You can simply check your database activity by implementing below code:</p>
<p><code>USE ReadingDBLog;<br />
GO<br />
select [Current LSN],<br />
[Operation],<br />
[Transaction Name],<br />
[Transaction ID],<br />
[Transaction SID],<br />
[SPID],<br />
[Begin Time]<br />
FROM   fn_dblog(null,null)</code></p>
<h4><strong>How to Read Transaction Log Quickly</strong></h4>
<p>One quick way to read SQL Server database activity is to use SysTools <a href="https://www.systoolsgroup.com/sql-log-analyzer.html"><strong>SQL Log Viewer</strong></a>. It read &amp; analyse operation like insert, update, delete. The software previews all .ldf activities like transaction name, table name, query etc. You have option to choose the database from different mode ie Online &amp; Offline mode. You will able to fetch it from live databases. If your database is in Simple Recovery Mode, the tool is capable to recover deleted database records. You will get three different option for exporting. You can export it as in SQL Server Database , as CSV or as Compatible Script.</p>
<h2>Conclusion</h2>
<p>The blog covers various users queries about transaction logs along with its possible solution. I have discussed why transaction logs keep on increasing, how to track down your transaction details of your database and how to shrink transaction logs. I have also discussed some quick tips when you shrink your database.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/transaction-log-in-sql-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Copy Table Schema and Data from One Database to another Database in SQL Server</title>
		<link>https://mail.sibeeshpassion.com/copy-table-schema-and-data-from-one-to-another-database/</link>
					<comments>https://mail.sibeeshpassion.com/copy-table-schema-and-data-from-one-to-another-database/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Thu, 26 Apr 2018 12:41:04 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database to Database]]></category>
		<category><![CDATA[MSSQL]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=12814</guid>

					<description><![CDATA[[toc] Problem: A few days ago, while migrating data from one database to another, I encountered an interesting problem which user faced a lot. “I have two databases, I have to copy tables data from one database to another. My query is how can I copy table schema from one database to another with its schema and data” In this blog, we will learn the easiest solution on how you can solve that query. Solution There are plenty of methods on how you can copy table schema and data from one database to another like Generate script wizard, Import/Export Wizard [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Problem:</h2>
<p>A few days ago, while migrating data from one database to another, I encountered an interesting problem which user faced a lot.</p>
<p><em>“I have two databases, I have to copy tables data from one database to another. My query is how can I copy table schema from one database to another with its schema and data”</em></p>
<p>In this blog, we will learn the easiest solution on how you can solve that query.</p>
<h2>Solution</h2>
<p>There are plenty of methods on how you can copy table schema and data from one database to another like Generate script wizard, Import/Export Wizard etc. But these methods are quite lengthy and requires users time.</p>
<p>The easiest solution to copy schema’s table from one database to another is to use SysTools SQL Server Database Migration Tool. You will able to migrate your tables schema by performing few steps.</p>
<h3>How to Copy Table Schema and Data from One Database to Another?</h3>
<ul>
<li>Launch <strong><a href="https://www.systoolsgroup.com/sql-server/migration/">SysTools SQL Server Database Migration Tool</a></strong>.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/1.png"><img fetchpriority="high" decoding="async" class="size-medium wp-image-12815" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/1-300x185.png" alt="Launch SysTools SQL Server Database Migration Tool" width="300" height="185" srcset="/wp-content/uploads/2018/04/1-300x185.png 300w, /wp-content/uploads/2018/04/1-768x473.png 768w, /wp-content/uploads/2018/04/1-400x247.png 400w, /wp-content/uploads/2018/04/1-973x600.png 973w, /wp-content/uploads/2018/04/1.png 579w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>Click <strong>Open</strong> and load your database MDF file.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/3.png"><img decoding="async" class="size-medium wp-image-12816" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/3-300x185.png" alt="open MDF File" width="300" height="185" srcset="/wp-content/uploads/2018/04/3-300x185.png 300w, /wp-content/uploads/2018/04/3-768x474.png 768w, /wp-content/uploads/2018/04/3-1024x631.png 1024w, /wp-content/uploads/2018/04/3-400x247.png 400w, /wp-content/uploads/2018/04/3-973x600.png 973w, /wp-content/uploads/2018/04/3.png 1025w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>Choose the <strong>Scan Modes</strong> accordingly and select the SQL Server version of your .mdf file.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/4.png"><img decoding="async" class="size-medium wp-image-12817" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/4-300x185.png" alt="select version" width="300" height="185" srcset="/wp-content/uploads/2018/04/4-300x185.png 300w, /wp-content/uploads/2018/04/4-768x474.png 768w, /wp-content/uploads/2018/04/4-400x247.png 400w, /wp-content/uploads/2018/04/4-973x600.png 973w, /wp-content/uploads/2018/04/4.png 579w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>Select the database table from the left side, which you want to migrate to another database.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/5.png"><img decoding="async" class="size-medium wp-image-12818" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/5-300x185.png" alt="Select the database name" width="300" height="185" srcset="/wp-content/uploads/2018/04/5-300x185.png 300w, /wp-content/uploads/2018/04/5-768x473.png 768w, /wp-content/uploads/2018/04/5-400x247.png 400w, /wp-content/uploads/2018/04/5-973x600.png 973w, /wp-content/uploads/2018/04/5.png 1022w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>Click on <strong>Export</strong> for migration process.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/6.png"><img decoding="async" class="size-medium wp-image-12819" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/6-300x185.png" alt="Click export to migrate the data" width="300" height="185" srcset="/wp-content/uploads/2018/04/6-300x185.png 300w, /wp-content/uploads/2018/04/6-768x473.png 768w, /wp-content/uploads/2018/04/6-400x246.png 400w, /wp-content/uploads/2018/04/6-974x600.png 974w, /wp-content/uploads/2018/04/6.png 1023w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>You will get two options for exporting. One is SQL Server Database and other is SQL Server Compatible Script. Choose it according to your need.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/7.png"><img decoding="async" class="size-medium wp-image-12820" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/7-300x247.png" alt="Two option for exporting" width="300" height="247" srcset="/wp-content/uploads/2018/04/7-300x247.png 300w, /wp-content/uploads/2018/04/7-400x329.png 400w, /wp-content/uploads/2018/04/7.png 624w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>After filling the Server credentials, Select the destination database as ‘<strong>Export to Existing database</strong>’</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/8.png"><img decoding="async" class="size-medium wp-image-12821" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/8-300x247.png" alt="Choose your desired destination location" width="300" height="247" srcset="/wp-content/uploads/2018/04/8-300x247.png 300w, /wp-content/uploads/2018/04/8-400x329.png 400w, /wp-content/uploads/2018/04/8.png 624w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>Software will fetch the databases and let you select the database on which you want to move the selected table.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/9.png"><img decoding="async" class="size-medium wp-image-12822" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/9-300x247.png" alt="fetch details od database" width="300" height="247" srcset="/wp-content/uploads/2018/04/9-300x247.png 300w, /wp-content/uploads/2018/04/9-400x329.png 400w, /wp-content/uploads/2018/04/9.png 623w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>You will get two options to export. Select ‘<strong>With Schema &amp; Data</strong>’. This option will copy schema &amp; data of your selected table from one database and export it to another and click <strong>Export</strong>.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/11.png"><img decoding="async" class="size-medium wp-image-12823" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/11-300x246.png" alt="Select Schema &amp; Data option" width="300" height="246" srcset="/wp-content/uploads/2018/04/11-300x246.png 300w, /wp-content/uploads/2018/04/11-400x328.png 400w, /wp-content/uploads/2018/04/11.png 625w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<li>You will get popup of Export complete.</li>
<p><a href="https://sibeeshpassion.com/wp-content/uploads/2018/04/12.png"><img decoding="async" class="size-medium wp-image-12824" src="https://sibeeshpassion.com/wp-content/uploads/2018/04/12-300x186.png" alt="Export complete" width="300" height="186" srcset="/wp-content/uploads/2018/04/12-300x186.png 300w, /wp-content/uploads/2018/04/12-768x476.png 768w, /wp-content/uploads/2018/04/12-400x248.png 400w, /wp-content/uploads/2018/04/12-969x600.png 969w, /wp-content/uploads/2018/04/12.png 577w" sizes="(max-width: 300px) 100vw, 300px" /></a>
</ul>
<h2>Conclusion</h2>
<p>The blog covers the easiest workaround of mostly faced users query on how to copy schema &amp; data from one database to another. You can also use Import/Export Wizard, Generate script wizard etc for object migration using SQL Server. But these methods has some limitations. In Import/Export wizard, the indexes and the key will not get transferred, you need to generate scripts for that. The export wizard fails if foreign keys connecting the tables together is not in a correct order. ‘Generate script’ method is used to generate a single script for tables schema, data, indexes and keys. But again, the limitation is this method doesn’t generate tables creation script in correct order.</p>
<p>So one can opt for SysTools SQL Database Migration Tool for fast migration of tables schema from one database to another.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/copy-table-schema-and-data-from-one-to-another-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Log File Corruption and Possible Recovery Methods</title>
		<link>https://mail.sibeeshpassion.com/sql-log-file-corruption-and-possible-recovery-methods/</link>
					<comments>https://mail.sibeeshpassion.com/sql-log-file-corruption-and-possible-recovery-methods/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Mon, 12 Feb 2018 06:05:23 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[sql log file corruption]]></category>
		<category><![CDATA[sql server 2016]]></category>
		<category><![CDATA[sql transaction log]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=12618</guid>

					<description><![CDATA[[toc] Introduction Structured Query Language (commonly known as SQL) is a programming language used for managing data held in relational database management system (RDMS) consisting of data definition language, data manipulation language and a data control language. The SQL database comprises of following three files: Primary Database Files: Primary database file is the main database file (MDF) which points to another file in database and hence every database has one primary data file. The file is in the extension of .mdf Secondary Database Files: When the data of a database exceeds than a secondary database file is created which stores [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>Structured Query Language (commonly known as SQL) is a programming language used for managing data held in relational database management system (RDMS) consisting of data definition language, data manipulation language and a data control language. The SQL database comprises of following three files:</p>
<ol>
<li><strong>Primary Database Files</strong>: Primary database file is the <a href="http://sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/" target="_blank">main database file</a> (MDF) which points to another file in database and hence every database has one primary data file. The file is in the extension of .mdf</li>
<li><strong>Secondary Database Files</strong>: When the data of a database exceeds than a secondary database file is created which stores the data that exceeds MDF limit. Hence, multiple secondary data files can be created for a single database. The file is in the extension of .ndf</li>
<li>Log Files: These files maintain a log of all the transactions done in SQL Server Database so that that information can be later used to recover the database. There must exist one log file for each database and it is possible that more than one log file can be created for a single database. The file is in .ldf file extension.</li>
</ol>
<p>Log files (also known as transaction log) consist of actions executed on the database for database management to guarantee ACID properties over crashes or hardware failure. It is a file listing changes to the database, stored in a stable storage format</p>
<h2>Problem</h2>
<p>The log files of the SQL Server gets corrupted i.e. while the time we are performing some action upon SQL database, there exist some errors in between the process and due to which there is an interrupt in process.</p>
<h2>Causes of Log File Corruption in SQL Server</h2>
<ul>
<li>Viruses or other Malicious Software- In computer system, many viruses can infect and damage the log files and makes them inaccessible.</li>
<li>Terminating System Abnormally- If system/application is quit abnormally, then files are prone to be corrupted or damaged.</li>
<li>Input Output Configuration- The I/O subsystem is a vital component of the database used to store system and user databases. Hence if the configuration is disturbed on enhanced that it may lead to corruption in log files.</li>
<li>Storage Size Issue- The biggest reason behind the corruption of log files is the storage size. In case the data exceeds the limit of LDF, corruption is likely to occur.</li>
</ul>
<h3>Errors which Occurs Due to Log File Corruption</h3>
<p><strong>Error Message 1</strong>: StartLogFiles: The error exists when the log files are unable to start because the system could not find the file specified. So try to diagnose and correct the operating system error, and retry the operation.</p>
<p><strong>Error Message 2</strong>: File activation failure. The error occurs due to error in file on location ‘<strong>C:\ProgramFiles\MSSQLServer\MSSQL10_50.SQLEXPRESS\MSSQL\Log\ERRORLOG</strong>’.</p>
<p><strong>Error Message 3</strong>: The error message displays that the transaction log has been deleted or lost due to a hardware failure of a system or any other reason. The log files cannot be redeveloped because users perform open transactions on file.</p>
<p><strong>Error Message 4</strong>: Corrupted server of SQL database leads to corruption in backup of log files.</p>
<p><strong>Error Message 5</strong>: When database log is corrupted and a user is attempting to attach the log file to the new server then an error message displays with a message that ‘Could not open new database (Name of Database). CREATE DATABASE is aborted.</p>
<p><strong>Error Message 6</strong>: When the log database is attempted to attach but it gives an error while performing the attachment. The error displays one of the two number i.e. 9004 or 9001 notifying that you have to create a backup or it is necessary to rebuild the log.</p>
<h3>How to Recover Corrupted Log File in SQL Server?</h3>
<p>In order to repair a corrupt LDF file, use the WITH TABLOCK option for DBCC CHECKDB. It will recover the data from a corrupted LDF file that has been corrupted or damaged due to some reason such as logical corruption.</p>
<div id="attachment_12624" style="width: 613px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2018/02/dbcc-checkdb.png"><img decoding="async" aria-describedby="caption-attachment-12624" src="http://sibeeshpassion.com/wp-content/uploads/2018/02/dbcc-checkdb.png" alt="dbcc-checkdb" width="603" height="210" class="size-full wp-image-12624" srcset="/wp-content/uploads/2018/02/dbcc-checkdb.png 603w, /wp-content/uploads/2018/02/dbcc-checkdb-300x104.png 300w, /wp-content/uploads/2018/02/dbcc-checkdb-600x210.png 600w, /wp-content/uploads/2018/02/dbcc-checkdb-400x139.png 400w" sizes="(max-width: 603px) 100vw, 603px" /></a><p id="caption-attachment-12624" class="wp-caption-text">dbcc-checkdb</p></div>
<h2>Conclusion</h2>
<p>Through the above solution, we can recover SQL log file but not sure that the above procedure will recover complete log file data. However, there exists <a href="http://www.sqlserverlogexplorer.com/restore/" target="_blank">SQL Server transaction log recovery tool</a> through which you can restore database transaction log.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/sql-log-file-corruption-and-possible-recovery-methods/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learn to Repair Corrupt MDF File with Perfection</title>
		<link>https://mail.sibeeshpassion.com/learn-to-repair-corrupt-mdf-file-with-perfection/</link>
					<comments>https://mail.sibeeshpassion.com/learn-to-repair-corrupt-mdf-file-with-perfection/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Fri, 22 Sep 2017 17:07:34 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[repair corrupt mdf file]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12494</guid>

					<description><![CDATA[[toc] To get a damaged MDF file is not rare. However, the main cause behind it is that the file is prone to corruption. When this occurs, all data saved in the server database becomes inaccessible and therefore, it leads to data loss. In such circumstances, it is important to repair corrupt MDF file of server database storage. This segment will discuss how to execute the repair process. In addition, it will also give you in-depth information about MDF file, reasons, and way to repair damaged MDF file to store it in healthy form. Read further to know more. Quick [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<p>To get a damaged MDF file is not rare. However, the main cause behind it is that the file is prone to corruption. When this occurs, all data saved in the server database becomes inaccessible and therefore, it leads to data loss. In such circumstances, it is important to repair corrupt MDF file of server database storage.</p>
<p>This segment will discuss how to execute the repair process. In addition, it will also give you in-depth information about MDF file, reasons, and way to repair damaged MDF file to store it in healthy form. Read further to know more.</p>
<h2>Quick Glance on MDF File</h2>
<p>SQL Server MDF file is a relational management system of the database. Moreover, it is a primary data file of the database, which saves all the server data. Thus, you can even state it as the master database file of MS SQL Server. Every database of SQL Server would enclose at least one .mdf file.</p>
<p>It saves components like XML Indexes, Views, Indexes, Stored Procedures, Tables, Triggers, Rules, Keys, User Defined Functions, sparse columns, data types, file stream, the column set property data types. The .mdf file can be said as a primary element for managing SQL Server database.</p>
<h2>Reasons of MDF File Corruption</h2>
<p>There are various causes, which are answerable for damaging the primary file type of server.</p>
<ul>
<li>Unexpected power failure.</li>
<li>Various bugs in server.</li>
<li>Defective Operating System.</li>
<li>Sudden shutdown of the machine.</li>
<li>Issues with hard drive</li>
<li>Virus outbreaks.</li>
</ul>
<p>Thus, issues for your .mdf file revolving corrupt can be everything from malfunctioning of hardware to software and so it is necessary to fix corrupted MDF file.</p>
<h3>Technique to Repair Corrupt MDF File</h3>
<p><strong>Method 1: Inbuilt Tool</strong></p>
<p>There are some tools that make easy for users to fix corrupted MDF file of the server. Thus, make the saved data available. In fact, all these tools are series of commands in T-SQL programming language, which is called DBCC (Database Console Commands). The purpose of these statements in DBCC is to test physical and logical uniformity of MS SQL Server database files and fix troubling problems that continue.</p>
<p>DBCC CHECKDB is a command via which you can simply check the logical and physical integrity of all objects in precise MS SQL Server database. You can do it by implementing the mentioned operations successively:</p>
<ul>
<li>Run DBCC CHECKALLOC command in the database.</li>
<li>Run DBCC CHECKCATALOG command in the database.</li>
<li>Run DBCC CHECKTABLE on every view &amp; table in the database.</li>
<li>Verifying content of every indexed view present in the database.</li>
<li>Validating link-level constancy among table Metadata, file system directories files while saving varbinary (max) data utilizing FILESTREAM in the file system.</li>
<li>Confirming Service Broker data in database.</li>
<p>Once the above steps to repair damaged MDF file is completed then, if the application finds any issues of corruption or any errors, it recommends users have the usage of various recover options for fixing troublesome problems. The recover or repair options are:</p>
<li><strong>REPAIR_FAST</strong></li>
<p>It preserves syntax for compatibility of backward only; no repair actions are executed in definite. The syntax for this, Repair option is: DBCC CHECKDB (‘DB Name’, REPAIR_FAST).</p>
<li><strong>REPAIR_REBUILD</strong></li>
<p>This option of repair implements repair process, which scarcely has potentials of data loss. This can do quick repairs like repair of missing rows in non-clustered indexes, even time-consuming repairs like the rebuilding of indexes. The syntax is DBCC CHECKDB (‘DB Name’, REPAIR_REBUILD).</p>
<li><strong>REPAIR_ALLOW_DATA_LOSS</strong></li>
<p>This command creates an effort to fix all the issues, which are reported. However, it can root cause the loss of data as specified in repair command itself. The syntax is: DBCC CHECKDB (‘DB Name’, REPAIR_ALLOW_DATA_LOSS).</p>
</ul>
<h3>Limitations:</h3>
<ol>
<li>The specific database should be in single-user mode to be able to execute either of three commands of repair.</li>
<li>DBCC repair commands are not authenticated for memory-optimized tables.</li>
</ol>
<h3>Method 2: Trouble-Free Solution</h3>
<p>There can be a possibility that when your SQL Server database MDF file is corrupt and when you try to connect to SQL Server you will find that it is marked as SUSPECT. During such scenarios or the above discussed, you will not be able to connect to the database. To repair corrupt SQL Server MDF database file best option is to restore from a recent full database backup available.</p>
<p>If no recent backup available in such cases best possible approach is to repair corrupted MDF file of Microsoft SQL Server 2000, 2005, 2008, 2012 and 2016 with <strong><a href="https://www.systoolsgroup.com/sql-recovery.html" target="_blank">SQL Database Repair Tool</a></strong>. One of the most highly used and recommended software to repair corrupt SQL MDF file with the assurance of 99% guaranteed recovery.
</p>
<h3>Observational Verdict</h3>
<p>We have gone through the possible solution which you need to follow to recover a database in case MDF file get corrupted or database marked as SUSPECT. We serve you with the best of the best ways to repair corrupt MDF file. So, Hurry! What are you waiting for? You are raising the bar and we are taking it forward with the all in one and probably the best of solution repair damaged MDF database file.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/learn-to-repair-corrupt-mdf-file-with-perfection/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understand the Internal Structure of SQL Database File</title>
		<link>https://mail.sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/</link>
					<comments>https://mail.sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Thu, 23 Mar 2017 15:55:59 +0000</pubDate>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Database File]]></category>
		<category><![CDATA[SQL Internal Structure]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12149</guid>

					<description><![CDATA[You must have thought how to store data in SQL Server? SQL Server is the platform, which provides a proper management of database. There is no doubt that it follows a strategy for the storage of all the files. All the users of SQL are aware with the fact that database objects are stored in MDF file. MDF files are responsible for the management of data in SQL Server. Therefore, in this article, we will learn the storage system of data in SQL Server data files. Database Files and its Storage Structure in SQL Server Database in SQL Server has [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>You must have thought how to store data in SQL Server? SQL Server is the platform, which provides a proper management of database. There is no doubt that it follows a strategy for the storage of all the files. All the users of SQL are aware with the fact that database objects are stored in MDF file. MDF files are responsible for the management of data in SQL Server. Therefore, in this article, we will learn the storage system of data in SQL Server data files.</p>
<h2>Database Files and its Storage Structure in SQL Server</h2>
<p>Database in SQL Server has two operating system files:</p>
<ul>
<li>Data Files</li>
<li>Log File</li>
</ul>
<p><strong>Data Files</strong></p>
<p>A data file consists of objects and data. Depending upon the needs, data files can be divided into two types: </p>
<p><strong>Primary Database File</strong></p>
<p>Each database has one primary data file. All the tables, database objects, indexes and views are stored in that file. The file extension of primary database file is .mdf. </p>
<p><strong>Secondary Database File</strong></p>
<p>This type is used at the time of exceeding the maximum allocated size for an individual file on Windows. It helps the database to increase in size. File extension for this file is .ndf.</p>
<p><strong>Log File</strong></p>
<p>Whenever users want to recover whole of the database in SQL Server, they require certain information, which are inside a log file. For one database there will be one log file and transactions of database are written on it even before to the data file. The file extension used by it is .ldf. LDF stands for Transactional Log file.</p>
<p><strong>Inner Structure of Data File</strong></p>
<p>Each database has its space to store the data, which is divided into different pages that are numbered from 0 to N. During the expansion of database files from its default size, those pages which are created newly are numbered from the last highest page number plus 1. In the similar way, at the time of shrinking of files it eliminates pages in decreasing order, which in the same manner starts from the highest page number. The basic unit of I/O for SQL Server operations is a page and each page is of 8 KB. A data file is a large array of pages. SQL Server stores different data with the help of multiple pages, Some of them are GAM, Index, IAM, Data, SGAM, and TextMix.</p>
<p><strong>Page Addressing:</strong></p>
<p>Now, if we analyze the pages addressing then we can see that every page in SQL Server is of equal size that is 8192 bytes. Each page has its own address, which is unique. It is a part of single database file. The ID of the file makes the first part of the unique address. Pages are numbered starting from 0. This is the mentioned format in which page address is written:</p>
<p> <strong>file number</strong>  :  <strong>page number</strong> </p>
<p>Data page is very essential among the page types. This is used for the storage of records to a database. </p>
<p>Structure of Data Page:</p>
<p>A data page contains three sections.</p>
<ul>
<li>Page Header</li>
<li>Page Body</li>
<li>Slot Array or Row offset</li>
</ul>
<p><strong>Page Header (0-95 bytes)</strong></p>
<p>The first 96 bytes of a particular page is known as page header, which consists of the information of the page.</p>
<p>That is, Page ID, No of records in that page and IDs of previous/next pages.</p>
<p><strong>Page Body</strong></p>
<p>It is that part where actual data is stored. It is followed by the free space and slot array. </p>
<p><strong>Slot Array</strong></p>
<p>Slot array, also known as off-set array, is an array of two-byte values, which is read by the SQL Server in reverse i.e. from the very end of the page. Slot array keep slot points to a byte in the page wherever a record begins. First slot of the record slot array is saved in the last two bytes of the page that points to the page of the first record saved at the page. </p>
<p><strong>Conclusion</strong></p>
<p>One of the essential things that should be kept in mind is that, In SQL Server, the database file (.mdf) store its data as per 8 kb pages and it is important for SQL Server to sustain the sequence of data pages as per their header information. In case of mismatching of information or the data is not stored in sequential order into data pages, there is possibility in the corruption of database or you may face <a href="http://www.sqlrecoverytool.com/fix-ms-sql-server-error-5172.html" target="_blank">SQL database error like 5172</a>, which is a header corruption error.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/understand-the-internal-structure-of-sql-database-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
