<?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>ChoirulAmri.org &#187; SQL tips</title>
	<atom:link href="http://choirulamri.org/archives/tag/sql-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://choirulamri.org</link>
	<description>born to train, forced to code::SQL Server, SharePoint, .Net, Business Intelligence</description>
	<lastBuildDate>Sat, 21 Aug 2010 02:02:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Practical SQL Performance Troubleshooting</title>
		<link>http://choirulamri.org/archives/513</link>
		<comments>http://choirulamri.org/archives/513#comments</comments>
		<pubDate>Sat, 21 Aug 2010 02:02:47 +0000</pubDate>
		<dc:creator>mca</dc:creator>
				<category><![CDATA[Download]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL tips]]></category>

		<guid isPermaLink="false">http://choirulamri.org/archives/513</guid>
		<description><![CDATA[DBA daily life is always hectic. They receive many issues ranging from network, performance, security, or application. I had collected many scripts and tools since couple of years ago. They are very useful for ad-hoc troubleshooting and diagnose the problem on the spot. When I mentioned ad-hoc means the ability to locate and diagnose the [...]]]></description>
		<wfw:commentRss>http://choirulamri.org/archives/513/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shrink and manage huge SQL log file</title>
		<link>http://choirulamri.org/archives/369</link>
		<comments>http://choirulamri.org/archives/369#comments</comments>
		<pubDate>Sat, 03 Jan 2009 09:46:00 +0000</pubDate>
		<dc:creator>mca</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL tips]]></category>

		<guid isPermaLink="false">http://choirulamri.org/archives/369</guid>
		<description><![CDATA[I had a bad experience with transaction log file, it was 8 years ago. But thanks to Mr.Bad, I learnt very important lesson as newbie DBA at that time. This is the story: my ERP application which sitting on top of SQL Server 2000 was fine at Friday afternoon. I went home for a weekend, only to find everybody was starred at me at Monday morning. What had happened? The ERP was crashed, actually it couldn’t start at all.

I went to my SQL Server box, and the guy was stopped. It’s not started. I checked everything from security permission to possibility of virus, nil. Then I found that the disk was out of space because of transaction log explosion. The accounting guy was doing quarterly stock journal in the system, and it caused transaction log growth exponentially. There was an audit table which recording all journal operation, and obviously the INSERT operation was the source of problem.

<em>Moral of the story: make sure you have automated way to manage transaction log growth.</em>

There are 2 way to shrink the log:
<ul>
	<li>Detach database, delete the big log, and re-attach without log file. SQL Server will create a new, fresh log file with minimum initial size. It is 2MB by default. Disadvantage: the database will not be available during the process. Offline duration depends on how fast is the detach – attach operation takes time.</li>
	<li>Better approach: use SHRINKFILE of DBCC command. This is better because I do not need to bring the system OFF.</li>
</ul>
Regardless of the approach, make sure to do full database backup. Shrinking the log deletes historical transaction that may be needed to restore database to specific point of time. Just in case, make sure to do full backup. You have been warned right :).

These are the steps to shrink a huge log file:]]></description>
		<wfw:commentRss>http://choirulamri.org/archives/369/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extract and Transfer RDL files from SSRS</title>
		<link>http://choirulamri.org/archives/165</link>
		<comments>http://choirulamri.org/archives/165#comments</comments>
		<pubDate>Wed, 22 Oct 2008 07:17:41 +0000</pubDate>
		<dc:creator>mca</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[ToolBox]]></category>
		<category><![CDATA[Reporting services]]></category>
		<category><![CDATA[SQL tips]]></category>

		<guid isPermaLink="false">http://choirulamri.org/archives/165</guid>
		<description><![CDATA[I was in the situation when I had to modify some reports, but I did not have the source code (RDL) files on hand. I tried to go to SSRS server, and looking for download or save-as menu. I was expecting there are some ways to download the report definition so I can modify it under Visual Studio.

Unfortunately not, there is no built-in features in SSRS that for download or extract report from the server. Once deployed, it is there forever. I just thought to create small application using SSRS web services or API to extract the definition. But I was lucky enough that Jasper Smith created an amazing tool for this purpose.]]></description>
		<wfw:commentRss>http://choirulamri.org/archives/165/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
