<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3633270974235726205</id><updated>2011-12-19T10:46:45.201-08:00</updated><category term='SQL Performance'/><category term='MDW'/><category term='Reporting Services Security'/><category term='Reporting Services 2000'/><category term='DTS'/><category term='Reporting Services Anonymous'/><category term='SQL Virtualization'/><category term='SQL'/><category term='SQL 2008'/><category term='SQL 2000'/><category term='SQL Disaster Recovery'/><category term='Anonumous Access SQL Server 2008 R2'/><category term='SSRS'/><category term='Replication'/><category term='Data Collection'/><category term='SQL Engine'/><category term='Reporting Services 2008'/><category term='SSIS'/><category term='File Management'/><category term='SQL Error 15401'/><category term='Administration'/><title type='text'>Explore SQL Server</title><subtitle type='html'>with Swarndeep</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-3760733045688077326</id><published>2011-12-19T10:20:00.001-08:00</published><updated>2011-12-19T10:46:45.211-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services Anonymous'/><category scheme='http://www.blogger.com/atom/ns#' term='Anonumous Access SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services Security'/><title type='text'>Setting up Anonymous Access for Reporting Services in SQL Server 2008 R2.</title><content type='html'>&lt;strong&gt;&lt;u&gt;DISCLAIMER: ANONYMOUS ACCESS IS NOT RECOMMENDED as it may give direct access to your report server or report objects to any one who knows the URL of your reporting services. Additional security measurements are required while handling with anonymous access.&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Microsoft has made some fundamental modifications with SQL Server 2008 Reporting Services security architecture. Reporting Services and Web Component now do not need IIS or Web Server as Reporting Services now run on it's own http.sys and serves the reports request from within http.sys.&lt;br /&gt;The biggest challenge I faced while configuring Reporting Services was Anonymous Access as Anonymous Access is no more an option available to be configured easily. To enable Anonymous Access you need to configure config files and also compile dll to provide extension to Reporting Services to allow Anonymous access.&lt;br /&gt;Here are the steps which can be performed to enable Anonymous Access in Reporting Services.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Change the authentication mode in rsreportserver.config to Custom&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;div align="left"&gt;&lt;span style="background-color: white; color: #4f81bd;"&gt;&amp;lt;Authentication&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="background-color: white; color: #4f81bd;"&gt;&amp;lt;AuthenticationTypes&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="background-color: white; color: #4f81bd;"&gt;&amp;lt;Custom/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="background-color: white; color: #4f81bd;"&gt;&amp;lt;/AuthenticationTypes&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="background-color: white; color: #4f81bd;"&gt;&amp;lt;EnableAuthPersistence&amp;gt;true&amp;lt;/EnableAuthPersistence&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="background-color: white; color: #4f81bd;"&gt;&amp;lt;/Authentication&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Change the Authentication mode in web.config file in ReportServer to None. Also change the Impersonation to false.&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;authentication mode="None" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;identity impersonate="false"/&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Compile the code from this &lt;a href="https://sites.google.com/site/swarnpublic/home/anonymouseaccess/Microsoft.Samples.ReportingServices.AnonymousSecurity.cs?attredirects=0&amp;amp;d=1"&gt;location&lt;/a&gt; to bin folder as Microsoft.Samples.ReportingServices.AnonymousSecurity.dll Or copy it from this &lt;a href="https://sites.google.com/site/swarnpublic/home/anonymouseaccess/Microsoft.Samples.ReportingServices.AnonymousSecurity.dll?attredirects=0&amp;amp;d=1"&gt;location&lt;/a&gt; and paste it to bin folder in ReportServer.&lt;/li&gt;&lt;li&gt;Add Extensions in rsreportserver.config &lt;/li&gt;&lt;ul&gt;&lt;li&gt;Add the additional extension in Security Tag&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;Security&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.Authorization, Microsoft.Samples.ReportingServices.AnonymousSecurity" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;/Security&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;   &lt;ul&gt;&lt;li&gt;Add the additional extension in Authentication Tag&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;Authentication&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.AnonymousSecurity" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;/Authentication&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Add the following codegroup to configure the code access security in rssrvpolicy.config&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;CodeGroup&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;class="UnionCodeGroup"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;version="1"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;PermissionSetName="FullTrust"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;Name="Private_assembly"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;Description="This code group grants custom code full trust. "&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;IMembershipCondition&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;class="UrlMembershipCondition"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;version="1"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;Url="C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.AnonymousSecurity.dll"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #4f81bd;"&gt;&amp;lt;/CodeGroup&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;Restart the reporting services, Anonymous Access should work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-3760733045688077326?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/3760733045688077326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2011/12/setting-up-anonymous-access-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3760733045688077326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3760733045688077326'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2011/12/setting-up-anonymous-access-for.html' title='Setting up Anonymous Access for Reporting Services in SQL Server 2008 R2.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total><georss:featurename>Herndon, VA 20170, USA</georss:featurename><georss:point>38.9808589 -77.3841197</georss:point><georss:box>38.9314854 -77.4630837 39.0302324 -77.3051557</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-6917091218396411567</id><published>2011-10-21T13:04:00.000-07:00</published><updated>2011-10-21T13:04:55.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2000'/><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services 2000'/><title type='text'>Cannot print report from Microsoft Reporting Services 2000 report.</title><content type='html'>This is a&amp;nbsp;security issue with Reporting Services 2000 SP2. To fix this issue apply the patch from KB Article &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=16628"&gt;KB954609&lt;/a&gt;&amp;nbsp;on Reporting Server..&lt;br /&gt;&lt;br /&gt;Once this patch is installed, reboot is not required. Clients will get a request to install a component on their machines if they click on print (One time only). Once installed, it will allow to print reports.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-6917091218396411567?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/6917091218396411567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2011/10/cannot-print-report-from-microsoft.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/6917091218396411567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/6917091218396411567'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2011/10/cannot-print-report-from-microsoft.html' title='Cannot print report from Microsoft Reporting Services 2000 report.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-3484296237422340594</id><published>2011-03-24T14:11:00.000-07:00</published><updated>2011-03-24T14:13:56.857-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='File Management'/><title type='text'>Moving all pages from one data file to another data file.</title><content type='html'>When database files are filled completely and there is no space to grow, the common fix for this issue is to follow one of these two options, 1. Add new file to another disk (with more storage), or 2. Manually move the file from one disk to another disk(with more storage). Option 2 requires SQL Server services to be reset and&amp;nbsp;Option 1 does not free up space on main disk, but gives ability to grow the file on second disk.&lt;br /&gt;&lt;br /&gt;There is third option too, which lets you move all pages from one file to another file and also you don't need to restart the SQL Service . Also it does not matter even if files are on different disks and then remove the old files where no page left. The process has to be followed is:&lt;br /&gt;&lt;br /&gt;1. Add new file in same file group.&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/ms189253.aspx"&gt;More Information&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Move pages from one file to another file. DBCC('LOGICAL_NAME',EMPTYFILE). &lt;a href="http://msdn.microsoft.com/en-us/library/ms189493.aspx"&gt;More Information&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Run DBCC update usage after above script is completed successfully to refresh the pages and row count. &lt;a href="http://msdn.microsoft.com/en-us/library/ms188414.aspx"&gt;More Information&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. Run sp_helpfile to&amp;nbsp;make sure that the page from where you moved the pages does not have any rows left. &lt;a href="http://msdn.microsoft.com/en-us/library/ms174307.aspx"&gt;More Information&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. If data file from where you moved the pages shows 0 pages and rows left, then you can delete that file from database. &lt;a href="http://msdn.microsoft.com/en-us/library/ms175574.aspx"&gt;More Information&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-3484296237422340594?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/3484296237422340594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2011/03/moving-all-pages-from-one-data-file-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3484296237422340594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3484296237422340594'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2011/03/moving-all-pages-from-one-data-file-to.html' title='Moving all pages from one data file to another data file.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-3923292078183411131</id><published>2010-08-30T18:16:00.000-07:00</published><updated>2010-09-01T10:20:24.116-07:00</updated><title type='text'>Database Backup Growth Report Script</title><content type='html'>&lt;div style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Following Script will return the real-time database backup growth report for Week or Month or Year. Script was developed and tested in SQL 10.0, however, with small changes it can be used in SQL 2000 or SQL 2005.&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="color: #45818e; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;CREATE proc usp_RPT_Backup_Growth (@dbname varchar(100), @type varchar(100), @servername varchar(100), @year varchar(4), @freq varchar(10)) &lt;br /&gt;as &lt;br /&gt;if (@freq='Week') &lt;br /&gt;begin &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with bkupreport(database_name, Type, backup_size, server_name, unit_num, year_num) as ( &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.database_name, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case a.type when 'D' then 'Full' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'I' then 'Diff' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'L' then 'Log' end as Type &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,avg(a.compressed_backup_size) Total_Backup_Size &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,a.server_name &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,DATEPART(wk,a.backup_start_date) 'WeekNumber', DATEPART(year,a.backup_start_date) 'YearNumber' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from msdb.dbo.backupset a with (nOLOCK) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where /*a.backup_start_date between (GETDATE()-32) and GETDATE() &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and */a.database_name = @dbname and a.type =@type and a.server_name = @servername &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and DATEPART(year,a.backup_start_date) = @year &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by a.database_name, a.type, a.server_name, DATEPART(wk,a.backup_start_date) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , DATEPART(year,a.backup_start_date) &lt;br /&gt;) &lt;br /&gt;select a.database_name, a.Type, a.backup_size, a.server_name, a.unit_num, a.year_num &lt;br /&gt;,Cast((100. * (a.backup_size - b.backup_size)) / b.backup_size As numeric(18,2)) As 'Growth' from bkupreport a &lt;br /&gt;left outer join bkupreport b with (NOLOCK) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on b.unit_num+1 = a.unit_num &lt;br /&gt;order by a.unit_num &lt;br /&gt;end &lt;br /&gt;if (@freq='Month') &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with bkupreport(database_name, Type, backup_size, server_name, unit_num, year_num) as ( &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.database_name, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case a.type when 'D' then 'Full' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'I' then 'Diff' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'L' then 'Log' end as Type &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,avg(a.compressed_backup_size) Total_Backup_Size &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,a.server_name &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,DATEPART(MM,a.backup_start_date) 'MonthNumber', DATEPART(year,a.backup_start_date) 'YearNumber' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from msdb.dbo.backupset a with (nOLOCK) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where /*a.backup_start_date between (GETDATE()-32) and GETDATE() &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and */a.database_name = @dbname and a.type =@type and a.server_name = @servername &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and DATEPART(year,a.backup_start_date) = @year &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by a.database_name, a.type, a.server_name, DATEPART(MM,a.backup_start_date) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , DATEPART(year,a.backup_start_date) &lt;br /&gt;) &lt;br /&gt;select a.database_name, a.Type, a.backup_size, a.server_name, a.unit_num, a.year_num &lt;br /&gt;,Cast((100. * (a.backup_size - b.backup_size)) / b.backup_size As numeric(18,2)) As 'Growth' from bkupreport a &lt;br /&gt;left outer join bkupreport b with (NOLOCK) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on b.unit_num+1 = a.unit_num &lt;br /&gt;order by a.unit_num &lt;br /&gt;end &lt;br /&gt;if (@freq='Year') &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with bkupreport(database_name, Type, backup_size, server_name, unit_num, year_num) as ( &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.database_name, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case a.type when 'D' then 'Full' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'I' then 'Diff' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'L' then 'Log' end as Type &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,avg(a.compressed_backup_size) Total_Backup_Size &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,a.server_name &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,0 'MonthNumber', DATEPART(year,a.backup_start_date) 'YearNumber' &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from msdb.dbo.backupset a with (nOLOCK) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a.database_name = @dbname and a.type =@type and a.server_name = @servername &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by a.database_name, a.type, a.server_name, DATEPART(year,a.backup_start_date) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , DATEPART(year,a.backup_start_date) &lt;br /&gt;) &lt;br /&gt;select a.database_name, a.Type, a.backup_size, a.server_name, a.unit_num, a.year_num &lt;br /&gt;,Cast((100. * (a.backup_size - b.backup_size)) / b.backup_size As numeric(18,2)) As 'Growth' from bkupreport a &lt;br /&gt;left outer join bkupreport b with (NOLOCK) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on b.year_num+1 = a.year_num &lt;br /&gt;order by a.unit_num &lt;br /&gt;end &lt;br /&gt;GO&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-3923292078183411131?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/3923292078183411131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2010/08/database-backup-growth-report-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3923292078183411131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3923292078183411131'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2010/08/database-backup-growth-report-script.html' title='Database Backup Growth Report Script'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-8905372158739287922</id><published>2010-06-08T07:24:00.000-07:00</published><updated>2010-06-08T07:25:35.422-07:00</updated><title type='text'>SQL Server 2008 SP1 CU#8</title><content type='html'>Microsoft released CU#8 for SQL Server 2008 SP1. Use the following direct URL for more information.&lt;br /&gt;&lt;br /&gt;http://blogs.msdn.com/b/sqlreleaseservices/archive/2010/05/17/cumulative-update-8-for-sql-server-2008-service-pack-1.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-8905372158739287922?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blogs.msdn.com/b/sqlreleaseservices/archive/2010/05/17/cumulative-update-8-for-sql-server-2008-service-pack-1.aspx' title='SQL Server 2008 SP1 CU#8'/><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/8905372158739287922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2010/06/sql-server-2008-sp1-cu8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/8905372158739287922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/8905372158739287922'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2010/06/sql-server-2008-sp1-cu8.html' title='SQL Server 2008 SP1 CU#8'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-9075415315506473782</id><published>2010-05-02T19:07:00.000-07:00</published><updated>2010-05-02T19:07:16.077-07:00</updated><title type='text'>Changing ‘sa’ password in MS SQL Server, if 'sa' password is misplaced or forgotten.</title><content type='html'>Sometimes there might be a situation when DBA may forget ‘sa’ password and there is no other way to login to SQL Server, in that situation DBA may reset the ‘sa’ password or add another user with SA rights.&lt;br /&gt;To do this, first Stop SQL Server and then start SQL Server with –m option in startup parameter to start SQL in single user mode.&lt;br /&gt;&lt;br /&gt;Then login to Windows with Domain Administrator and use sqlcmd utility to connect to sql server. Once connected,&amp;nbsp; write t-sql commands to reset ‘sa’ password or add another domain user with SA rights. After completion, stop SQL Server, remove –m option from startup parameters and restart sql server.&lt;br /&gt;&lt;br /&gt;To reset sa password, use the following script.&lt;br /&gt;&lt;br /&gt;C:\Users\Administrator&amp;gt;sqlcmd -E -Ssql2k8 &lt;br /&gt;1&amp;gt; alter login sa with password = 'password' &lt;br /&gt;2&amp;gt; go &lt;br /&gt;1&amp;gt; &lt;br /&gt;&lt;br /&gt;This procedure has been tested with SQL Server 2008, where server was already added to domain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-9075415315506473782?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/9075415315506473782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2010/05/changing-sa-password-in-ms-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/9075415315506473782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/9075415315506473782'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2010/05/changing-sa-password-in-ms-sql-server.html' title='Changing ‘sa’ password in MS SQL Server, if &apos;sa&apos; password is misplaced or forgotten.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-8932417453771845413</id><published>2009-12-22T13:56:00.000-08:00</published><updated>2009-12-22T13:56:54.146-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Performance'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Collection'/><category scheme='http://www.blogger.com/atom/ns#' term='MDW'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Data Collection (MDW) in SQL Server for performance monitoring.</title><content type='html'>With Microsoft SQL Server 2008, Microsoft has incorporated new performance tool called Data Collector, also known as MDW – Management Data Warehouse and also Known as Performance Studio.&lt;br /&gt;With MDW, you can collect SQL Server performance information, IO usage, disk usage, memory usage, locks, blocking, queries taking longer time, couple of performance counters etc. The useful information it collects can be preserved for long time and can be analyzed for the purpose of troubleshooting.&lt;br /&gt;MDW creates it’s own database warehouse (MDW) to collect information. There are pre-configured collection sets including Server Activity, Query Statistics and Disk Usage. The data collected in MDW is published in SQL Server Management studio with very useful reports. This feature is not configured by default and can be found under Management in Object Explorer of SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_n_jrICI/AAAAAAAABfU/pMFhu6Tncqk/s1600-h/image%5B2%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_oAeOc7I/AAAAAAAABfY/KInDTW1286Y/image_thumb.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;As mentioned above this feature is&amp;nbsp; by default disabled, this can be enabled and configured by selecting ‘Configure Management Data Warehouse wizard’ option after right clicking on Data Collection.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_oetmcBI/AAAAAAAABfc/_pr9vWZJzzg/s1600-h/image%5B5%5D.png"&gt;&lt;img alt="image" border="0" height="157" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_o4NnnGI/AAAAAAAABfg/lX3-nm0jZQE/image_thumb%5B1%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Selecting ‘Configure Management Data Warehouse’ starts a wizard as shown below to configure data warehouse.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_hMJMOVWGz9k/SzE_pboIvsI/AAAAAAAABfk/kajgq17eX9U/s1600-h/image%5B8%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_ptGVxfI/AAAAAAAABfo/6SrkPUvPOjM/image_thumb%5B2%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;First part of configuration is to create Database Warehouse and second part is where you setup data collection.&lt;br /&gt;In the following part, we are setting the database for first time, and selected option “Create or upgrade a management data warehouse”.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_pyEcIhI/AAAAAAAABfs/OrbjTX4XXhQ/s1600-h/image%5B11%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh6.ggpht.com/_hMJMOVWGz9k/SzE_qEPEiYI/AAAAAAAABfw/alQcdSWw_AI/image_thumb%5B3%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Create New database to collect information by select New option from following screen.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SzE_qScLw6I/AAAAAAAABf0/JWqaVNWS8g8/s1600-h/image%5B14%5D.png"&gt;&lt;img alt="image" border="0" height="218" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_qsZN98I/AAAAAAAABf4/uqLdl924wng/image_thumb%5B4%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SzE_q1KFmiI/AAAAAAAABf8/rwxJrIxgd4A/s1600-h/image%5B17%5D.png"&gt;&lt;img alt="image" border="0" height="218" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_rbxOyUI/AAAAAAAABgA/zsmuME9eurM/image_thumb%5B5%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;From the following screen, select Login and map MDW users to that Login or Logins. There are three roles for MDW, admin, writer and reader. You may either create a single Login and give admin or you may give appropriate rights to Logins, as per your requirements.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_rh-5dkI/AAAAAAAABgE/R-1mqAqy508/s1600-h/image%5B20%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh3.ggpht.com/_hMJMOVWGz9k/SzE_sCrN-3I/AAAAAAAABgI/ReBHK0DJPqc/image_thumb%5B6%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Review the information before clicking on Finish.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_sZLOnxI/AAAAAAAABgM/BoBsfD1zj94/s1600-h/image%5B23%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_tfWSVWI/AAAAAAAABgQ/wtytc6pH9QI/image_thumb%5B7%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_hMJMOVWGz9k/SzE_tsd3SSI/AAAAAAAABgU/9kkPdWtqb2s/s1600-h/image%5B26%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh3.ggpht.com/_hMJMOVWGz9k/SzE_tyRmp6I/AAAAAAAABgY/tLTB5BoIkfI/image_thumb%5B8%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Since the database has been configured, the next part is to set the data collection. In case if MDW database has been setup on another server, this will be your first step for this server.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_uPYbnSI/AAAAAAAABgc/kam9rXn7nSA/s1600-h/image%5B29%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_vBz3BlI/AAAAAAAABgg/esxoWudlSsY/image_thumb%5B9%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Data collector collects some information from traces and other parts which it keeps locally in a folder before pushing it to database. In the following Window you may chose directory to keep this information.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SzE_ve93rBI/AAAAAAAABgk/yVjNVTZhV40/s1600-h/image%5B35%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_vi15ZKI/AAAAAAAABgo/rBOTZAfFtUI/image_thumb%5B11%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Review the information before clicking on Finish.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_vxaTt-I/AAAAAAAABgs/3Ot5oAtqABM/s1600-h/image%5B38%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh6.ggpht.com/_hMJMOVWGz9k/SzE_wIi0JeI/AAAAAAAABgw/w8OPFOv9tig/image_thumb%5B12%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_wevtflI/AAAAAAAABg0/ACCFusBBNs0/s1600-h/image%5B41%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_wvV0ZuI/AAAAAAAABg4/0gqVqUkMV5c/image_thumb%5B13%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Once this process is completed, Next step is to schedule the jobs, configure the maximum retain period of collection.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_xC4jpOI/AAAAAAAABg8/T7lKkCJU1As/s1600-h/image%5B44%5D.png"&gt;&lt;img alt="image" border="0" height="240" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_yv6sn7I/AAAAAAAABhA/6Ze2VG4Zod8/image_thumb%5B14%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Right click on Disk Usage, select Properties. In the property Window review and change the information like the frequency of collection, default service account to run jobs associated with current collector. You can also configure the ‘Retain data’ property and specify number of days you want to keep the information.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_zGnSbiI/AAAAAAAABhE/khEBO248k6A/s1600-h/image%5B47%5D.png"&gt;&lt;img alt="image" border="0" height="204" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_0A2SyaI/AAAAAAAABhI/2tT8APJltbM/image_thumb%5B15%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Follow the same practice for all three collector sets. Once it will configure correctly you will see reports and useful information by right clicking on Data Collection and selecting the appropriate report, as shown in following screen shot.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_1kNYnJI/AAAAAAAABhM/CUYwMEkUwlw/s1600-h/image%5B50%5D.png"&gt;&lt;img alt="image" border="0" height="106" src="http://lh6.ggpht.com/_hMJMOVWGz9k/SzE_13OtOyI/AAAAAAAABhQ/9yuzh_3tNAU/image_thumb%5B16%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Server Activity report will look like as shown below.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_2e0eYyI/AAAAAAAABhU/aJD5n8rR45U/s1600-h/image%5B53%5D.png"&gt;&lt;img alt="image" border="0" height="200" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_2sIVsJI/AAAAAAAABhY/DV4UGQMikI8/image_thumb%5B17%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;By default it will show you data for last four hours, however you can change the date and range you want to see the reports. As shown below, click on calendar icon and select date range and number minutes/hours you want to see the report.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_20ejh2I/AAAAAAAABhc/UDoMwkKYoMo/s1600-h/image%5B56%5D.png"&gt;&lt;img alt="image" border="0" height="35" src="http://lh3.ggpht.com/_hMJMOVWGz9k/SzE_3Ov56XI/AAAAAAAABhg/zjb5YxkGYWY/image_thumb%5B18%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;In this case, the report will be shown for data collected for 15 minutes starting 4 PM.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SzE_3tZBfjI/AAAAAAAABhk/gi8ab43V9as/s1600-h/image%5B62%5D.png"&gt;&lt;img alt="image" border="0" height="119" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_3xJHAcI/AAAAAAAABho/_-F237a0Bvo/image_thumb%5B20%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Following same way, you can view other reports as well. You may explore this feature to understand this and get used to this.&lt;br /&gt;This is a great and may save money for your organization, if you are planning to buy third party monitoring tool for SQL Server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-8932417453771845413?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/8932417453771845413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/12/data-collection-mdw-in-sql-server-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/8932417453771845413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/8932417453771845413'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/12/data-collection-mdw-in-sql-server-for.html' title='Data Collection (MDW) in SQL Server for performance monitoring.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_hMJMOVWGz9k/SzE_oAeOc7I/AAAAAAAABfY/KInDTW1286Y/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-7223871134317041524</id><published>2009-11-30T12:39:00.000-08:00</published><updated>2009-11-30T13:10:43.156-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Performance'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Real time performance analysis of Stored Procedures</title><content type='html'>By assuming that there are no Hardware issues with SQL Server, but still SQL Server performance is not up to the mark, following query can provide some useful information for troubleshooting.&lt;br /&gt;&lt;br /&gt;select a.*, p.query_plan , p.number    &lt;br /&gt;from sys.dm_exec_procedure_stats as a     &lt;br /&gt;cross apply sys.dm_exec_query_plan(a.plan_handle) as p     &lt;br /&gt;where a.object_id=object_id('[sch].[User_SP]')&lt;br /&gt;There are some very useful columns returned by this query, those are:&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;cached_time&lt;/b&gt;&lt;/u&gt; : Recent Recompile Time&lt;br /&gt;&lt;b&gt;&lt;u&gt;last_worker_time&lt;/u&gt;&lt;/b&gt; : Execution time in micro seconds&lt;br /&gt;&lt;b&gt;&lt;u&gt;last_physical_reads&lt;/u&gt;&lt;/b&gt;: Number of pages read from physical storage system.&lt;br /&gt;&lt;u&gt;&lt;b&gt;last_logical_reads&lt;/b&gt;&lt;/u&gt;: Number of pages read from buffer, instead of physical storage.&lt;br /&gt;&lt;b&gt;&lt;u&gt;query_plan&lt;/u&gt;&lt;/b&gt;: XML representation of query plan, which was used during recent sp run.&lt;br /&gt;&lt;br /&gt;The tables in query just keeps the last event i.e. only one record. Adding this query in job allows to store the information in temporary table and after couple of minutes you can get enough details for investigation. For single procedure, more than one query plan may exist. You may compare query plans to find out the differences.&lt;br /&gt;&lt;br /&gt;In one of the real time scenarios, I realized that number of logical reads were few millions, for just returning 100 rows. There was issue with one of the join that caused more number of logical reads.&lt;br /&gt;&lt;br /&gt;This is not the end, you may also compare physical reads with logical reads. Also consider frequency of procedure being recompiling. Too much recompiling may cause overhead to CPU.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note&lt;/b&gt;: Logical Reads over Physical reads are good. More logical reads shows that the query is getting it’s data from buffer, more physical reads are sign of potential IO bottleneck.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-7223871134317041524?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/7223871134317041524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/11/real-time-performance-analysis-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/7223871134317041524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/7223871134317041524'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/11/real-time-performance-analysis-of.html' title='Real time performance analysis of Stored Procedures'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-1090190904725102574</id><published>2009-11-09T10:54:00.000-08:00</published><updated>2009-11-09T11:00:05.029-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>How to enable Replication on Publisher (SQL 2008)</title><content type='html'>&lt;a href="http://talksql.blogspot.com/2009/10/replication-on-sql-server-2008.html"&gt;Introduction to Replication.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Before enabling Replication on Publisher you must decide where you want to run the distribution database. Distribution database keeps track of logs to be replicated among subscribers.&lt;br /&gt;Keeping distribution database on same server as publisher may cause IO bottlenecks, depending upon hardware configuration and existing load on server.&lt;br /&gt;Follow the steps to below to enable Distribution and Replication. These steps will add distribution server on selected server.&lt;br /&gt;1. Open SQL Server Management Studio, Connect to SQL Server and Expand SQL Server where you wish to enable publishing and distribution.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SvhjWgXV8oI/AAAAAAAABWQ/wuikgxy3ce4/s1600-h/image%5B2%5D.png"&gt;&lt;img alt="image" border="0" height="175" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SvhjXKF0rbI/AAAAAAAABWU/9uzv88436kU/image_thumb.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="188" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Right click on Replication in Object Explorer, then select Configure Distribution. This will start “Configure Distribution Wizard”.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SvhjXZL0OeI/AAAAAAAABWY/KgWcUrqDNGM/s1600-h/image%5B11%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh3.ggpht.com/_hMJMOVWGz9k/SvhjX53TQAI/AAAAAAAABWc/8wo1lc95y2M/image_thumb%5B3%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. In case distribution is already setup somewhere, then select appropriate option,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SvhjYCikI1I/AAAAAAAABWg/5WvSLzHZXxQ/s1600-h/image%5B14%5D.png"&gt;&lt;img alt="image" border="0" height="221" src="http://lh6.ggpht.com/_hMJMOVWGz9k/SvhjYU7ciII/AAAAAAAABWk/bhtMH2OQKrg/image_thumb%5B4%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. In the following screenshot, notice that Snapshot Folder location is a network location. It is a good idea to keep it as network location, so that sql server agent can running on another server can access this location in case of pull subscription.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_hMJMOVWGz9k/SvhjY0yFm0I/AAAAAAAABWo/enZr4oT1-Tk/s1600-h/image%5B17%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SvhjZLJ3ncI/AAAAAAAABWs/PznOVLLQ5rM/image_thumb%5B5%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. Enter the location to create data files,&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SvhjZXvQGmI/AAAAAAAABWw/tG_hZKIqNSw/s1600-h/image%5B20%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SvhjZ0dwCiI/AAAAAAAABW0/N0IEZZtWwsg/image_thumb%5B6%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;6. From the following screen, you can add publisher server to distribution list. Click on Add button and select “Add SQL Server Publisher” to add SQL Server publisher. There is one more option available to add Oracle Publisher too. You may add more than one publisher here.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SvhjaIuhkrI/AAAAAAAABW4/v4Fmd4pmj1k/s1600-h/image%5B26%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh4.ggpht.com/_hMJMOVWGz9k/SvhjaZiKCLI/AAAAAAAABW8/vyrjjG5y1Jw/image_thumb%5B8%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;7. From the below screen select password for remote connection to distribution database.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SvhjaxFil_I/AAAAAAAABXA/Aj1XRIM-dyI/s1600-h/image%5B23%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SvhjbD90AuI/AAAAAAAABXE/FLzcorPF9fs/image_thumb%5B7%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;8. From the following window, you can either select to Configure distribution, or generate the t-sql to configure distribution manually or both.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_hMJMOVWGz9k/Svhjbb5NBYI/AAAAAAAABXI/MZ_5S2zKY6E/s1600-h/image%5B29%5D.png"&gt;&lt;img alt="image" border="0" height="219" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SvhjbhRW7FI/AAAAAAAABXM/CTPMDXuqIPg/image_thumb%5B9%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;9. Read the summary of actions below before configuring the distribution.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/SvhjcCoJngI/AAAAAAAABXQ/trTQgc3fsPc/s1600-h/image%5B32%5D.png"&gt;&lt;img alt="image" border="0" height="218" src="http://lh3.ggpht.com/_hMJMOVWGz9k/SvhjcWwtaDI/AAAAAAAABXU/qWr2fyrnl14/image_thumb%5B10%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;10. Click Finish to complete the Configuration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-1090190904725102574?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/1090190904725102574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/11/how-to-enable-replication-on-publisher.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/1090190904725102574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/1090190904725102574'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/11/how-to-enable-replication-on-publisher.html' title='How to enable Replication on Publisher (SQL 2008)'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_hMJMOVWGz9k/SvhjXKF0rbI/AAAAAAAABWU/9uzv88436kU/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-513520822956436647</id><published>2009-10-30T21:48:00.001-07:00</published><updated>2009-11-09T10:56:48.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Replication on SQL Server 2008.</title><content type='html'>One of the High Availability feature of SQL Server is Replication. Replication shares the selected tables, views or procedures among other servers. In fact Replication is not fully High Availability solution, but it can helpful for reporting servers and Warehouse etc.&lt;br /&gt;There are three models of Replication supported by SQL Server 2008. Transaction Replication, Merge Replication and Snapshot Replication. &lt;br /&gt;&lt;strong&gt;Snapshot Replication &lt;/strong&gt;This is most simplest model of Replication. Snapshot Replication just restores the initial set of data and does not support any incremental restore of logs.&lt;br /&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Snapshot Agent, Distribution Agent&lt;br /&gt;&lt;strong&gt;Transactional Replication&lt;/strong&gt; This is most common replication model. Typically this Model starts with initial snapshot. Using this model, Log Reader service reads the transactions and send them over to Distribution Server. Distribution server then distributes the transactions to all subscribers. This entire process by default runs continuously, however this can be scheduled to run on specific intervals.&lt;br /&gt;&lt;strong&gt;Agents:&lt;/strong&gt; Snapshot Agent, Log Reader Agent, Distribution Agent.&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://lh4.ggpht.com/_hMJMOVWGz9k/SuynTnsVjOI/AAAAAAAABVo/_1VjvIK4hKE/s1600-h/image%5B3%5D.png"&gt;&lt;img alt="image" border="0" height="398" src="http://lh5.ggpht.com/_hMJMOVWGz9k/SuynTyMRDRI/AAAAAAAABVs/_FdJqz6sWhc/image_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="image" width="212" /&gt;&lt;/a&gt;Figure Courtesy SQL Server BOL: Transaction Replication&lt;br /&gt;&lt;/div&gt;&lt;strong&gt;Merge Replication&lt;/strong&gt; Merge Replication is Similar to Transaction Replication, Merge Replication also typically starts with Snapshot of initial data. Once initial snapshot is applied, it merges the changes occurred at publisher or subscriber. &lt;br /&gt;Merge Replication requires UniqueIdentifier type column in each published table. If this column type is not already added, it adds this column. To track changes, Merge Replication also adds Insert, Delete and Update Triggers for each of the articles (aka Published Objects). These triggers use the UniqueIdentifier type column in each table to identify the changes, which was added above.&lt;br /&gt;&lt;strong&gt;Agents&lt;/strong&gt;: Snapshot Agent, Merge Agent.&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://lh6.ggpht.com/_hMJMOVWGz9k/Suytz4kuUMI/AAAAAAAABVw/e98tRlWD9AI/s1600-h/image%5B7%5D.png"&gt;&lt;img alt="image" border="0" height="339" src="http://lh3.ggpht.com/_hMJMOVWGz9k/Suyt0eJtp1I/AAAAAAAABV0/7BmPPvHzCD8/image_thumb%5B3%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="image" width="232" /&gt;&lt;/a&gt;Figure Courtesy SQL Server BOL: Transaction Replication&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;There can either be Push Subscription or Pull Subscription. In case of Push Subscription, Distribution Agent and Merge Agent runs at the Distributor. However, in case of Pull Subscription, Distribution Agent and Merge Agent runs at Subscriber.&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;Each agent of Replication is well described on BOL too. Please click &lt;a href="http://msdn.microsoft.com/en-us/library/ms152501.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://talksql.blogspot.com/2009/11/how-to-enable-replication-on-publisher.html"&gt;Enabling Distribution on SQL Server 2008&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-513520822956436647?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/513520822956436647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/10/replication-on-sql-server-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/513520822956436647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/513520822956436647'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/10/replication-on-sql-server-2008.html' title='Replication on SQL Server 2008.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_hMJMOVWGz9k/SuynTyMRDRI/AAAAAAAABVs/_FdJqz6sWhc/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-3273248572338766889</id><published>2009-10-05T20:21:00.000-07:00</published><updated>2010-02-10T13:53:09.574-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Error 15401'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Windows NT user or group 'Domain\User' not found. Check the name again. (Microsoft SQL Server, Error: 15401)</title><content type='html'>When you add new Domain Login to SQL Server, you may see error&amp;nbsp; Windows NT user or group 'Domain\User' not found. Check the name again. (Microsoft SQL Server, Error: 15401).&lt;br /&gt;&lt;br /&gt;This error message is very general and it does not explain any specific problem or reason itself. Microsoft has a very good article to fix this issue at http://support.microsoft.com/kb/324321/en-us.&lt;br /&gt;&lt;br /&gt;However, there is another scenario which is not covered in above article (at the time when writing this article) or may be I am the first person who faced this issue.&lt;br /&gt;&lt;br /&gt;This scenario can be reproduced on Windows 2008 Server with SQL 2008 Server where the Domain Controller is Windows 2000 server. On Windows 2008 server, 2 new policies have been enabled by default that encrypts the secure channel data when new LOGIN request is sent to Domain Controller by Domain member(Also SQL Server). In this scenario, Domain Controller is Windows 2000, thus it does not understand the encrypted request thus refuses the LOGINrequest. All you need to do is to fix this behavior in Windows 2008 (SQL Server) to not to send encrypted secure channel data to Domain Controller. To do this follow the steps below and it should fix the issue.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;From the SQL Server running Windows 2008 R2, Click Start-&amp;gt; Run and type the command GPEDIT.MSC. This will open the Policy Editor.&lt;/li&gt;&lt;li&gt;From Policy Editor Expand “Computer configuration” - &amp;gt; Windows Settings -&amp;gt; Security Setttings -&amp;gt; Local Policies -&amp;gt; Security Options.&lt;/li&gt;&lt;li&gt;You will see all security policies on right hand side window. Make changes into the following two policies. &lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;Domain member: Digitally encrypt secure channel data (when possible) – Disable this policy&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Domain member: Digitally sign secure channel data (when possible) – Disable this policy &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;After making these changes, close the policy editor and reboot the box. (Not SQL Server, but restart entire system).&lt;br /&gt;&lt;br /&gt;In case your local policy does not allow you to make changes, you may have to make changes using Group Policy Management Console. Instructions to install GPMC are &lt;a href="http://blogs.technet.com/askds/archive/2008/07/07/installing-gpmc-on-windows-server-2008-and-windows-vista-service-pack-1.aspx"&gt;located at&lt;/a&gt; http://blogs.technet.com/askds/archive/2008/07/07/installing-gpmc-on-windows-server-2008-and-windows-vista-service-pack-1.aspx.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Run gpmc.msc (Group Policy Management)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Expand your Domain&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Go to &lt;group objects="" policy=""&gt; and select &lt;default domain="" policy=""&gt; and then follow steps 2 and 3 from above.&lt;/default&gt;&lt;/group&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-3273248572338766889?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/3273248572338766889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/10/windows-nt-user-or-group-domainuser-not.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3273248572338766889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3273248572338766889'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/10/windows-nt-user-or-group-domainuser-not.html' title='Windows NT user or group &apos;Domain\User&apos; not found. Check the name again. (Microsoft SQL Server, Error: 15401)'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-3516513818674068044</id><published>2009-09-25T13:52:00.000-07:00</published><updated>2009-09-25T14:13:06.861-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Virtualization'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Virtualization</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;When I first heard SQL Server Virtualization, I made an assumption that it is a new feature of SQL Server that provides Virtualization at SQL Server Level, that is not the case. SQL Server Virtualization is nothing but running SQL Server Instance on Virtual Machine. SQL Server Virtualization is one of the hottest topics these days, especially after Microsoft has launched Microsoft Hyper-V (AKA Microsoft Hyper-Visor) and VMware ESX Server. In more technical terms Virtual Machines are also known as Hyper-Visors. As far as SQL Server is concerned, there is nothing specific you need to configure on SQL Server for Virtualization. The only configurations are made using Virtualization Software and sometimes system BIOS. The Original HyperVisor was developed at IBM in the 1960s called CP/CMS.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Type of Virtual Machine Or HyperVisor or Virtual Machine Monitors or Virtualizations:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Type 1: Hosted.&lt;/b&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Type 2: Native or Bare-Metal.&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt; &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;Type 1&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt; hypervisors are the common virtual machine monitors mostly used. In this scenario, Virtual Machine Monitor or VM tool is installed or Hosted on Operating System. This is why it is called Hosted Virtualization too. Thus Virtual Machine Communicates with Operating System for all of its resources Requirements. VMware Server, Microsoft Virtual PC are some of the famous Virtual Machine Monitors. Following is the basic architecture of Hosted Virtualization.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: center;"&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/_hMJMOVWGz9k/Sr0r9vVKk8I/AAAAAAAAAvs/vFoHjFS_UTg/s1600-h/Hoted+VM.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_hMJMOVWGz9k/Sr0r9vVKk8I/AAAAAAAAAvs/vFoHjFS_UTg/s320/Hoted+VM.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;Type 2&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt; hypervisors run on host's hardware and communicates directly with the Hardware instead of communicating with hardware through Host OS. The hardware resources and I/O are shared among virtualized OSs. That is why it is also called Bare-Metal Virtualization. It is also possible to assign specific devices to specific Virtualized OS, this is called partitioning. VMware ESX Server, Microsoft Hyper-V, Citrix Xen, LynuxWorks&amp;nbsp; are some of the software available in market. Following is a basic architecture of Bare Metal Virtualization.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: Verdana,sans-serif; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_hMJMOVWGz9k/Sr0r7LEpSRI/AAAAAAAAAvc/uDkshfzslMY/s1600-h/BareMetal+VM.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_hMJMOVWGz9k/Sr0r7LEpSRI/AAAAAAAAAvc/uDkshfzslMY/s320/BareMetal+VM.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Why or Why not use SQL Virtualization.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;When Total Cost of Ownership is your concern then Virtualization is the answer. Since virtualization runs on single set of hardware, thus the cost of buying new hardware can be reduced. Also need to consider that the performance of Virtualization will not be as good as running individual machine, because SQL Virtualization does not only includes SQL Server, it also includes Operating System, and other required tools for OS and SQL Server. There can be three priorities of an organization, Performance, Integrity, Cost. If Performance is only concern then avoid using virtualization because at some point you may notice lack of enough resources to run environments in virtualization. If integrity or cost is the concern then one may consider virtualization.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Virtualization is a nice technology and can save hundred thousand of dollars for organization, though there is downside too. If planned wisely, the downsides can be avoided.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;The best ever plan for most of the organizations can be consider deploying SQL Virtualization on Development, UAT or any non-production environment and avoid deploying SQL Virtualization on production environment as much as possible unless you have one of the best hardware that can give good performance even if multiple OS are installed with SQL Server.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Installing multiple instances on same Operating System should also be considered while planning for SQL virtualization.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-3516513818674068044?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/3516513818674068044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/09/sql-server-virtualization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3516513818674068044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/3516513818674068044'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/09/sql-server-virtualization.html' title='SQL Server Virtualization'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_hMJMOVWGz9k/Sr0r9vVKk8I/AAAAAAAAAvs/vFoHjFS_UTg/s72-c/Hoted+VM.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-9102653694392088802</id><published>2009-09-25T13:28:00.000-07:00</published><updated>2009-09-25T13:29:43.683-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Send Email when No Rows are transferred in Data Flow Task of SSIS - SQL 2008</title><content type='html'>&lt;div class="MsoNormal"&gt;There might be some situations when user must be notified that NO RECORD was transferred to destination while executing SSIS Package. There is no one way of doing this, however, I find the following as the most simple and less complicated way. The steps are:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;1. Declare a variable at project Scope level in SSIS.&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0mkgko9JI/AAAAAAAAAus/bl0CyEQvCMo/s1600-h/Variable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0mkgko9JI/AAAAAAAAAus/bl0CyEQvCMo/s320/Variable.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;2. Open the Data Flow task where the 0 row count needs to be validated. Add Row Count task between Source and Destination, and assign row count result to a variable that was declared above. Look at the following two images:&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_hMJMOVWGz9k/Sr0mo1JqdgI/AAAAAAAAAu0/9b4n0gu6mRI/s1600-h/add+Row+Count.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_hMJMOVWGz9k/Sr0mo1JqdgI/AAAAAAAAAu0/9b4n0gu6mRI/s320/add+Row+Count.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/_hMJMOVWGz9k/Sr0mrvKOspI/AAAAAAAAAvE/KWcUSr97dhU/s1600-h/configure+row+count.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_hMJMOVWGz9k/Sr0mrvKOspI/AAAAAAAAAvE/KWcUSr97dhU/s320/configure+row+count.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;3. Go back to control Flow Tab, Just below the Data Flow task, that was modified above, add a Precedence Constraint and join it to Send Mail Task, add another Precedence Constraint and Join it to the task that should be executed next. At this point, under the same Data Flow Task, there will be two Precedence Constraints with Green Color (Success). Next, condition needs to be added to these Precedence Constraints, so that in case there is no record an email should be sent to the user.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;4. Remember that already a variable has been set above with Row Count, same variable will be used here to decide whether there was any row returned or not. Configure the Precedence Constraint just similar to what is shown in figure below. Doing this, it will make sure that email will be sent only if RowCount is 0.&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0msj7AjdI/AAAAAAAAAvM/7yuNlHWiYLI/s1600-h/email+constraint.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0msj7AjdI/AAAAAAAAAvM/7yuNlHWiYLI/s320/email+constraint.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;5. Configure second Precedent Constraint, that was added later so that step next to is executed if RowCount is greater than 0. Similar the screen below:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0mtdoFFTI/AAAAAAAAAvU/CK55UF3tApE/s1600-h/more+than+0+rows+constraint.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0mtdoFFTI/AAAAAAAAAvU/CK55UF3tApE/s320/more+than+0+rows+constraint.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;6. Once these steps are completed, you will notice 'fx' icon next to each of the Precedent Constraint. &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;7. Next, Set the Precedent Constraint between Email Task and the task that should be executed when more than 0 records are transformed. This step should be ignored, if SSIS has not to proceed further if 0 rows are returned.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;After completing all the steps, the Control Flow Task will appear like:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_hMJMOVWGz9k/Sr0mqRZO7SI/AAAAAAAAAu8/38Tx2y_L_pw/s1600-h/Complete+Picture.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_hMJMOVWGz9k/Sr0mqRZO7SI/AAAAAAAAAu8/38Tx2y_L_pw/s320/Complete+Picture.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;end article="" of=""&gt;&lt;br /&gt;&lt;/end&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;end article="" of=""&gt;&lt;/end&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-9102653694392088802?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/9102653694392088802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/09/send-email-when-no-rows-are-transferred.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/9102653694392088802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/9102653694392088802'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/09/send-email-when-no-rows-are-transferred.html' title='Send Email when No Rows are transferred in Data Flow Task of SSIS - SQL 2008'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_hMJMOVWGz9k/Sr0mkgko9JI/AAAAAAAAAus/bl0CyEQvCMo/s72-c/Variable.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-7310698400720297399</id><published>2009-09-21T08:57:00.000-07:00</published><updated>2009-09-24T13:48:48.172-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Red Gate SQL Backup 5.4 vs SQL Server 2008 Backup</title><content type='html'>&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;}@font-face {font-family:Cambria; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1073741899 0 0 159 0;}@font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}h1 {mso-style-priority:9; mso-style-unhide:no; mso-style-qformat:yes; mso-style-link:"Heading 1 Char"; mso-style-next:Normal; margin-top:24.0pt; margin-right:0in; margin-bottom:0in; margin-left:0in; margin-bottom:.0001pt; line-height:115%; mso-pagination:widow-orphan lines-together; page-break-after:avoid; mso-outline-level:1; font-size:14.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#365F91; mso-themecolor:accent1; mso-themeshade:191; mso-font-kerning:0pt;}h2 {mso-style-priority:9; mso-style-qformat:yes; mso-style-link:"Heading 2 Char"; mso-style-next:Normal; margin-top:10.0pt; margin-right:0in; margin-bottom:0in; margin-left:0in; margin-bottom:.0001pt; line-height:115%; mso-pagination:widow-orphan lines-together; page-break-after:avoid; mso-outline-level:2; font-size:13.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#4F81BD; mso-themecolor:accent1;}h3 {mso-style-priority:9; mso-style-qformat:yes; mso-style-link:"Heading 3 Char"; mso-style-next:Normal; margin-top:10.0pt; margin-right:0in; margin-bottom:0in; margin-left:0in; margin-bottom:.0001pt; line-height:115%; mso-pagination:widow-orphan lines-together; page-break-after:avoid; mso-outline-level:3; font-size:11.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#4F81BD; mso-themecolor:accent1;}p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing {mso-style-priority:1; mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}span.MsoSubtleEmphasis {mso-style-priority:19; mso-style-unhide:no; mso-style-qformat:yes; color:gray; mso-themecolor:text1; mso-themetint:127; font-style:italic;}span.Heading1Char {mso-style-name:"Heading 1 Char"; mso-style-priority:9; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 1"; mso-ansi-font-size:14.0pt; mso-bidi-font-size:14.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#365F91; mso-themecolor:accent1; mso-themeshade:191; font-weight:bold;}span.Heading2Char {mso-style-name:"Heading 2 Char"; mso-style-priority:9; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 2"; mso-ansi-font-size:13.0pt; mso-bidi-font-size:13.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#4F81BD; mso-themecolor:accent1; font-weight:bold;}span.Heading3Char {mso-style-name:"Heading 3 Char"; mso-style-priority:9; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 3"; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:major-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:major-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:major-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:major-bidi; color:#4F81BD; mso-themecolor:accent1; font-weight:bold;}.MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}.MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt; line-height:115%;}@page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;}div.Section1 {page:Section1;}--&gt;&lt;/style&gt;  &lt;br /&gt;&lt;h1&gt;RedGate 5.4 Backup Vs SQL 2008 Backup Vs SQL 2008 Backup with Encryption&lt;/h1&gt;&lt;h2&gt;RedGate 5.4 Encrypted Compressed Backup&lt;/h2&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;How it works?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;1. Backup the database,&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;2. Compress the Database,&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;3. Encrypt the Database with a Password,&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;4. Password needs to be supplied while restoring/backing up the database, or password needs to be place in script in job.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing" style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Database size for testing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;7 GB&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Backup Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;134 Secs&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Backup Size&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;715 MB&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Restore Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;247 Seconds.&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Encryption&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Yes, 256 Bit.&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Compression Level&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3 - Full (Available options, 1, 2, 3)&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Advantages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;1. Encrypts the Backup file, not the database.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;2. Flexible Compression levels can be used.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;3. Compression Ratio is large than SQL Compression.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;4. Backup can be split into multiple files.&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Limitations&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1. Requires to buy another License.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;2. Password is displayed on backup/restore script, anyone can see the password, who has access to view the jobs.&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Tested Script&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;DECLARE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; @exitcode &lt;span style="color: blue;"&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;DECLARE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; @sqlerrorcode &lt;span style="color: blue;"&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;exec&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;master&lt;/span&gt;&lt;span style="color: grey;"&gt;..&lt;/span&gt;sqlbackup&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;N'-SQL "BACKUP DATABASES [myDB]&lt;span&gt;&amp;nbsp; &lt;/span&gt;TO DISK = ''C:\SQL Data\backup\&lt;auto&gt;'' WITH NAME = ''&lt;auto&gt;'', DESCRIPTION = ''&lt;auto&gt;'', ERASEFILES = 5, COMPRESSION = 1, THREADS = 1,MAILTO = ''DBATeam@Domain.com''"'&lt;/auto&gt;&lt;/auto&gt;&lt;/auto&gt;&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt; @exitcode &lt;span style="color: blue;"&gt;OUTPUT&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt; @sqlerrorcode &lt;span style="color: blue;"&gt;OUTPUT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;IF &lt;/span&gt;&lt;span style="color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;@exitcode &lt;span style="color: grey;"&gt;&amp;lt;&amp;gt;&lt;/span&gt;0&lt;span style="color: grey;"&gt;)&lt;/span&gt; &lt;span style="color: grey;"&gt;OR&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;@sqlerrorcode &lt;span style="color: grey;"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color: grey;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;RAISERROR &lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;'SQL Backup job failed with exitcode: %d&lt;span&gt;&amp;nbsp; &lt;/span&gt;SQL error code: %d'&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt; 16&lt;span style="color: grey;"&gt;,&lt;/span&gt; 1&lt;span style="color: grey;"&gt;,&lt;/span&gt; @exitcode&lt;span style="color: grey;"&gt;,&lt;/span&gt; @sqlerrorcode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;"&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;SQL 2008 Ent Full Backup Compressed&lt;/h2&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;How it works?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;1. Backup the Database,&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;2. Compress the Database,&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;3. Password Protection is available, however without encryption. Open URL below for more information - http://www.mssqltips.com/tip.asp?tip=1108&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Database size for testing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;7 GB&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Backup Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;120 Seconds&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Backup Size&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;865 MB&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Restore Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;246 Seconds&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Encryption&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;No.&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Compression Level&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;Full, Only Option&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Advantages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;1. No Need to purchase extra License, this is part of SQL 2008 License.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;2. Password protection is available to backups.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;3. Supported by Microsoft as part of Microsoft Product.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;4. Compresses the Database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Limitations&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;1. Does not support Encryption.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Tested Script&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;BACKUP&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;DATABASE&lt;/span&gt; MyDB &lt;span style="color: blue;"&gt;TO&lt;/span&gt; &lt;span style="color: blue;"&gt;DISK&lt;/span&gt;&lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\backup\myDB.bak'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;WITH&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;COMPRESSION&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;RESTORE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;DATABASE&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;MyDB &lt;span style="color: blue;"&gt;FROM&lt;/span&gt; &lt;span style="color: blue;"&gt;DISK&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\backup\myDB.bak'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;WITH&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;RECOVERY&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;MOVe&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: red;"&gt;'DATA1'&lt;/span&gt; &lt;span style="color: blue;"&gt;TO&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\Test\DATA1.mdf'&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;Move&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: red;"&gt;'LOG1'&lt;/span&gt; &lt;span style="color: blue;"&gt;TO&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\Test\LOG1.ldf'&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;Move&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: red;"&gt;'INDEX1'&lt;/span&gt; &lt;span style="color: blue;"&gt;To&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\Test\INDEX1.mdf'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;SQL 2008 Ent Full Backup Encrypted Compressed&lt;/h2&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;How it works?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;1. SQL 2008 supports Encryption at database level and encryption has to be enabled first time using the following steps.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;a. A database certificate has &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;to be created followed by a Master Key.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;b. Using certificate, Database Encryption Key&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;can be created to make database encrypted.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;c. Encryption can be enabled on database at&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;this point (CPU Intensive task).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;2. Backup the Encrypted Database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;3. Compresses the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Database size for testing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;7 GB&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Backup Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;218 Seconds&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Backup Size&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4.73 GB&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Restore Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;337 Seconds&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Encryption&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Yes, 256 bit.&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Compression Level&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Full, Only Option&lt;br /&gt;&lt;/div&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Advantages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;1. No need to display the password on restore command or backup command. SQL Server uses the inbuilt database certificate for security.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;2. No Need to purchase extra License, this is part of SQL 2008 License.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Limitations&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;1. CPU Intensive Task.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;2. Backup Compression ratio least of other two option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 1in;"&gt;&lt;span style="color: windowtext; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-weight: normal;"&gt;3. In case certificate is lost, we can lose the Data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="margin-left: 0.5in;"&gt;&lt;span class="MsoSubtleEmphasis"&gt;Tested Script&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--1. CREATE MASTER ENCRYPTION KEY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;MASTER&lt;/span&gt; &lt;span style="color: blue;"&gt;KEY&lt;/span&gt; &lt;span style="color: blue;"&gt;ENCRYPTION&lt;/span&gt; &lt;span style="color: blue;"&gt;BY&lt;/span&gt; &lt;span style="color: blue;"&gt;PASSWORD&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'*****'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--2. CREATE DATABASE CERTIFICATE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;CERTIFICATE&lt;/span&gt; dbCERT &lt;span style="color: blue;"&gt;WITH&lt;/span&gt; &lt;span style="color: blue;"&gt;SUBJECT&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'Database Certificate TDE'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--3. BACKUP CERTIFICATE &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;BACKUP&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;CERTIFICATE&lt;/span&gt; dbCERT &lt;span style="color: blue;"&gt;TO&lt;/span&gt; &lt;span style="color: blue;"&gt;FILE&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\DB CERTIFICATE\db_bkupcert_1.cert'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;WITH&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;PRIVATE&lt;/span&gt; &lt;span style="color: blue;"&gt;KEY&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;FILE&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'C:\SQL Data\DB CERTIFICATE\db_bkupcert_1.cert'&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt; &lt;span style="color: blue;"&gt;ENCRYPTION&lt;/span&gt; &lt;span style="color: blue;"&gt;BY&lt;/span&gt; &lt;span style="color: blue;"&gt;PASSWORD&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: red;"&gt;'*****'&lt;/span&gt;&lt;span style="color: grey;"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--4. CREATE DEK -- DATABASE ENCRYPTION KEY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;DATABASE&lt;/span&gt; &lt;span style="color: blue;"&gt;ENCRYPTION&lt;/span&gt; &lt;span style="color: blue;"&gt;KEY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;WITH&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;ALGORITHM&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; &lt;span style="color: blue;"&gt;AES_256&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;ENCRYPTION&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;BY&lt;/span&gt; &lt;span style="color: blue;"&gt;SERVER&lt;/span&gt; &lt;span style="color: blue;"&gt;CERTIFICATE&lt;/span&gt; dbCERT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--5. ENABLE ENCRYPTION ON SELECTED DATABASE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;ALTER&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;DATABASE&lt;/span&gt; myDB &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;ENCRYPTION&lt;/span&gt; &lt;span style="color: blue;"&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--6. ABOVE COMMAND WILL START A BACKUP PROCESS OF ENCRYPTING DATABASE, MONITOR THE STATUS OF ENCRYPTION PROCESS USING &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--FOLLOWING COMMAND.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;SELECT&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: magenta;"&gt;db_name&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;database_id&lt;span style="color: grey;"&gt;),&lt;/span&gt; encryption_state&lt;span style="color: grey;"&gt;,&lt;/span&gt;percent_complete&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;"&gt;FROM&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;"&gt; &lt;span style="color: green;"&gt;sys&lt;/span&gt;&lt;span style="color: grey;"&gt;.&lt;/span&gt;&lt;span style="color: green;"&gt;dm_database_encryption_keys&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-7310698400720297399?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/7310698400720297399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/09/red-gate-sql-backup-54-vs-sql-server.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/7310698400720297399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/7310698400720297399'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/09/red-gate-sql-backup-54-vs-sql-server.html' title='Red Gate SQL Backup 5.4 vs SQL Server 2008 Backup'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-2881826958194909169</id><published>2009-09-08T17:59:00.000-07:00</published><updated>2009-09-21T13:54:27.476-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Improving database performance with Table Partitioning</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;Table Partitioning is new concept introduced in MS SQL 2005. Partitioning is concept of taking performance benefit from SQL server by splitting the tables in multiple parts, on the basis of values in pre-defined column. However in old days of sql (6.5-2000), good developers knew how to take benefit from sql by splitting tables. They used to create multiple tables instead of one table and writing check constraint to group data in tables. Let me try to explain you this concept using following example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create table Sales_1&lt;br /&gt;(&lt;br /&gt;SKU varchar(20),&lt;br /&gt;SaleDate datetime&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;alter table Sales_1&lt;br /&gt;ADD CONSTRAINT sales_date_1 check(SaleDate &amp;lt; '2009-01-01') &lt;br /&gt;&lt;br /&gt;create table sales_2 ( &lt;br /&gt;SKU varchar(20)&lt;br /&gt;SaleDate datetime &lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;alter table Sales_2 ADD CONSTRAINT sales_date_1 check (saledate &amp;gt;= '2009-01-01')&lt;br /&gt;&lt;br /&gt;We have two tables, sales_1 and sales_2, on each table we have setup the check constraint. On one of the tables we added constraint to keep the records prior to 2009 and in other table we are keeping records where sales belong to 2009.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create view sales&lt;br /&gt;as&lt;br /&gt;select * from sales_1&lt;br /&gt;union all&lt;br /&gt;select * from sales_2&lt;br /&gt;&lt;br /&gt;We created a view sales, in which we used union to get combine the rows from both of the tables. If you query data for date prior to 2009, it will hit only sales_1 table, and otherwise it will hit sales_2. This approach is when we think of archiving data, since in this case, we almost archived our prior to 2009 data and that table will not get hit, unless we write query to do that.&lt;br /&gt;&lt;br /&gt;The only limitation to this approach was to inserting rows using views.&lt;br /&gt;&lt;br /&gt;In sql 2005, it is quite easy and systematic approach to achieve the same thing, but using Table Partitioning. By default sql creates one partition for each table in database, however more than one partitions can be added to tables. Logically speaking partitioning is a horizontal split of rows. Each set of rows will be saved into certain partition that matches the value in specified column on the basis of certain rule.&lt;br /&gt;&lt;br /&gt;Let's say, In your database you have data for ten years with million of rows, and you can split the data (rows) into ten different partitions and each partition belongs to each year. Thus it logically makes it well organized and also boosts the performance. This is importance to know that to get performance benefit, partitioning should be applied to large tables, where performance is generally poor, while selecting and storing data.&lt;br /&gt;&lt;br /&gt;Well, once partitioning is in place, you don't need to worry about putting data into selective partitions, or while selecting data you don't need to worry about writing more than one queries. It would be SQL's duty to take care of partitioning rules.&lt;br /&gt;&lt;br /&gt;Prior to creating partition on tables, two things needs to be followed, First creating function and second creating a scheme on basis of function. Once partition function and scheme are in place, last step will be to create table on the basis of function and scheme.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Partition Function&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In simple terms, a partition function defines the logical boundary for the data. Let's take the same example as I took for partitioned view. I want to distribute the sales information of year 2008-2009 in first partition, 2009-2010 in second partition. To do this, first I need to decide which data type need to be considered to partition. Of-course in this case, it will be datetime datatype. One thing needs to be understand here that Partition Functions are independent of any tables. Partition functions can be referenced by any table.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now I know that I have to make the groups or boundaries, i.e. 2008-1-1 to 2008-12-31, then 2009-1-1 to 2009-12-31. There are two type of partition functions, Left Range Functions and Right Range Functions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Left Range&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Data equivalent to the boundary will move into the Left Partition. If left boundary is defined as the first boundary in the range then all data equivalent to the boundary or less than the boundary will move into the first partition. If we create a Left Range Function with boundaries of 2008-12-31, and 2009-12-31, then it creates three partitions. Partition 1 - values equal to 2008-12-31 or less than this. Partition 2 - values equal to 2009-12-31 and greater than 2008-12-31. Any value greater than 2009-12-31 will go into partition 3.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE PARTITION FUNCTION part_sales(DATETIME)&lt;br /&gt;AS RANGE LEFT FOR VALUES&lt;br /&gt;('2008-12-31','2009-12-31')&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_hMJMOVWGz9k/SqbbG9Sq3bI/AAAAAAAAAtw/oAaQ0snMUB4/s1600-h/Left+Part+Func.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_hMJMOVWGz9k/SqbbG9Sq3bI/AAAAAAAAAtw/oAaQ0snMUB4/s320/Left+Part+Func.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Right Range&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The only difference between Left Range and Right Range is that using Right Range data equal to the boundary will move into the next partition. To accomplish the same result as Left Range, the Right Range can be defined in following way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE PARTITION FUNCTION part_sales(DATETIME)&lt;br /&gt;AS RANGE RIGHT FOR VALUES&lt;br /&gt;('2008-1-1', '2009-1-1')&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Partition Schemes&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is not all. Once partition function is created, next step is to decide in to which file group partitioned data should go. In the function we created three different boundaries and to gain highest performance out of the partition function, we need to create three different file groups. Let's assume that I have created three different file groups, fg1, fg2 and fg3 on three different storage arrays. Partition scheme decides which file group the data should go for each partition.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE PARTITION SCHEME ps_Sales&lt;br /&gt;AS PARTITION part_sales&lt;br /&gt;TO(fg1,fg2,fg3)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_hMJMOVWGz9k/SqbcBZvE3_I/AAAAAAAAAuI/ovx_q_LhKYM/s1600-h/Part+Scheme.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_hMJMOVWGz9k/SqbcBZvE3_I/AAAAAAAAAuI/ovx_q_LhKYM/s320/Part+Scheme.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_hMJMOVWGz9k/Sqbb_NhSkKI/AAAAAAAAAt4/WsFWh_gHNi4/s1600-h/Browser.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_hMJMOVWGz9k/Sqbb_NhSkKI/AAAAAAAAAt4/WsFWh_gHNi4/s320/Browser.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Partition Table&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Once the partition function and partition schemes are created, next step is to create the partition table. A partition table must be created with non clustered primary key. The clustered index while adding to the table, will partition the table on the basis of partition scheme.&lt;br /&gt;&lt;br /&gt;CREATE TABLE sales(&lt;br /&gt;order_id INT NOT NULL PRIMARY KEY NONCLUSTERED,&lt;br /&gt;productID int NOT NULL,&lt;br /&gt;Qty INT NOT NULL,&lt;br /&gt;Sale_agent VARCHAR(50) NOT NULL,&lt;br /&gt;Sale_Final_Date datetime NOT NULL&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;CREATE CLUSTERED INDEX idx_Sales_Date&lt;br /&gt;ON sales(sale_final_date)&lt;br /&gt;ON ps_Sales(sale_final_date);&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_hMJMOVWGz9k/SqbcAicBReI/AAAAAAAAAuA/ugKrz9A9OzI/s1600-h/create+table.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_hMJMOVWGz9k/SqbcAicBReI/AAAAAAAAAuA/ugKrz9A9OzI/s320/create+table.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When you query the partition table, no special query is required. Query Optimizer it self choses the right partition to display the results. &lt;br /&gt;&lt;br /&gt;I will write more blogs on partitioning that will show how to edit the partition, removing partition etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-2881826958194909169?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/2881826958194909169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/09/improving-database-performance-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/2881826958194909169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/2881826958194909169'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/09/improving-database-performance-with.html' title='Improving database performance with Table Partitioning'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_hMJMOVWGz9k/SqbbG9Sq3bI/AAAAAAAAAtw/oAaQ0snMUB4/s72-c/Left+Part+Func.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-5527522178811693557</id><published>2009-08-31T08:06:00.001-07:00</published><updated>2009-08-31T20:17:17.125-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DTS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Decrypting the encrypted DTS command to readable text.</title><content type='html'>Copy and paste the DTSRUN script including DTSRUN to command line window (aka cmd), add switches /!X and /!C at the end of the DTSRUN command. Press enter.&lt;br /&gt;&lt;br /&gt;Result has been copied to clipboard, just paste it to notepad.&lt;br /&gt;&lt;br /&gt;/!X does not execute the command, and /!C copies the result on clipboard.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-5527522178811693557?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/5527522178811693557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/08/decrypting-encrypted-dts-command-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/5527522178811693557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/5527522178811693557'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/08/decrypting-encrypted-dts-command-to.html' title='Decrypting the encrypted DTS command to readable text.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-913953182432599915</id><published>2009-08-25T21:17:00.000-07:00</published><updated>2009-08-26T16:55:53.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Moving data or log files to another location without detaching database.</title><content type='html'>There are various ways you can move the datafiles or logfiles to new location, However, I am going to share the method I used because I don't need to detach the database and reattach the database using this method. This method saves lot of maintenance time, in case if your database is replicated or it is required to be present 24/7. However, there will be performance fallback while performing any of these methods.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The only limitation using this method of moving files is that the primary data file and primary log file can not be moved while online, however the primary files can be marked as Empty File and sql server will transfer all data to new file and sql server will not put data in files marked as empty files  anymore.&lt;br /&gt;&lt;br /&gt;It has to be done in the following sequence:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Add new files to database to new location.&lt;/li&gt;&lt;li&gt;Transfer data from old file to new files and marking file as not to be used for storing any data.&lt;/li&gt;&lt;li&gt;Remove old files (except primary data or primary log file). Though primary data or log file will not be used for storing data in future and all existing data will be moved to new file in same filegroup.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Here are the details you can follow against each step I mentioned above:-&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.  Add new files to database to new location.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Assuming that you have database named TESTING and you have a file group named SECONDARY. Just make sure that you add new file to one of the existing FILEGROUPS (In my case it is SECONDARY), It is required because the existing data will be moved to existing FILEGROUPS when you mark the database as EMPTYFILE. Run the following script, edit the parameters as per your requirements.&lt;br /&gt;&lt;br /&gt;ALTER DATABASE testing&lt;br /&gt;ADD FILE   ---- for adding log file just change this line to ADD LOG FILE&lt;br /&gt;(NAME =  'data_5'&lt;br /&gt;, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\data_5_Data.NDF'&lt;br /&gt;, SIZE =5MB, MAXSIZE = UNLIMITED, FILEGROWTH = 10MB)&lt;br /&gt;TO FILEGROUP secondary&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.   Move data from existing file to another file and mark file as EMPTYFILE so that you could remove the file later.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DBCC SHRINKFILE(data_3, EMPTYFILE)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;Once you mark the file as EMPTYFILE, you may delete the file from list, or you can keep the file if the file is Primary file, however, the file now is empty (no pages) and sql will not store any data in this file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.    This is the final step. Remove the file you just marked as EMPTYFILE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ALTER DATABASE TESTING&lt;br /&gt;REMOVE FILE data_3&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Thanks&lt;br /&gt;Swarndeep&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-913953182432599915?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/913953182432599915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/08/moving-data-or-log-files-to-another.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/913953182432599915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/913953182432599915'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/08/moving-data-or-log-files-to-another.html' title='Moving data or log files to another location without detaching database.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3633270974235726205.post-6399890327056785582</id><published>2009-08-25T14:37:00.000-07:00</published><updated>2009-08-26T14:51:43.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Disaster Recovery'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL 2000: Database in suspect mode.</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Database can go into suspect mode for a couple of reasons, including, corruption in data files, indexes, logs, bad storage, less space available on storage for the database files to grow. Following is one of the ways to fix the suspect databases. I followed this process on one of the production user databases.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Please read through before taking any action.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;First you need to put your database into Emergency mode so that database can be accessed (though read only).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;sp_configure 'allow updates', 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Reconfigure with override&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;GO -- This will make system table editable.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;update master..sysdatabases set status = status | 32768&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;where name = 'db'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;GO --puts database into emergency mode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Once database is in emergency mode, try running the DBCC CHECKDB to check the database. If DBCC shows any error message, fix the error.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;In case DBCC reports Log error, you may rebuild the log, however rebuilding the log will remove the t-log data:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;DBCC REBUILD_LOG('db','c:\mssql\data\db.ldf')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;In case of corrupted index, try creating the infected index again, you may try Create Index ... DROP_EXISTING&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;If nothing helps, you may run DBCC CHECKDB('DB',REPAIR_ALLOW_DATA_LOSS), however, this may certainly result in some data loss.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Once you have completed all the activities and database is fixed, you may run the following script to set database to normal mode.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;update master..sysdatabases set status = 0 (Or the original value)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;where name = 'db'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;GO --puts database back into normal mode. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Sp_configure 'allow updates', 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Reconfigure with override&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;GO    -- This will make system tables un-editable. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Swarndeep&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3633270974235726205-6399890327056785582?l=talksql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://talksql.blogspot.com/feeds/6399890327056785582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://talksql.blogspot.com/2009/08/sql-2000-database-in-suspect-mode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/6399890327056785582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3633270974235726205/posts/default/6399890327056785582'/><link rel='alternate' type='text/html' href='http://talksql.blogspot.com/2009/08/sql-2000-database-in-suspect-mode.html' title='SQL 2000: Database in suspect mode.'/><author><name>Swarndeep</name><uri>http://www.blogger.com/profile/11550593701026635986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_hMJMOVWGz9k/SpSqK7uCHnI/AAAAAAAAArs/kZ-b_qJ0FMk/S220/PIC_0019.JPG'/></author><thr:total>0</thr:total></entry></feed>
