|

SQL Server Datafile maxsize reported incorrectly

Recently we encountered and filed a benign reporting BUG which reports the maxsize of the data file incorrectly. If you create a database & then alter the initial size of the database to be greater than maxsize & then query sys.database_files, sys.master_files, sysaltfiles the maxsize appears to be incorrectly reporting the older value of maxsize….

| | |

SQL Consolidation Considerations !!!

In modern times, with current focus of most organizations on saving costs by means of virtualization and consolidations., It becomes increasingly important for DBAs to ensure that help organization achieve this objective without compromising on the performance, scalability, availability & application compatibility. In this blog post, I would like to give some pointers on the…

| |

SQL Server: Does Parallel Plan for rebuild index impact the fragmentation of index?

The title for this post might sound ironical since rebuild of the index is used to remove the fragmentation of the index so how does rebuild of index affect the fragmentation of index? Well, this is what I would like to explain in this blog post. Generally, for rebuilding of indexes (alter index … rebuild)…

Powershell script to script all the Jobs from the given instance of SQL Server

Following is the powershell script to script out all the Jobs in one go. param($sqlserver) [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.Smo”) | Out-Null $srv = New-Object “Microsoft.SqlServer.Management.Smo.Server” $sqlserver $srv.JobServer.Jobs | foreach {$_.Script()} You can copy the above code in a notepad and save it as .ps1 file in some location on server. Next from the Object Explorer in SQL Management…

Do we need a database property setting to control the threshold that triggers Auto Update Statistics?

In SQL Server, our Auto Update Statistics algorithm still relies on the default 20% modification on a given column to trigger update statistics. However different customers have different workloads and for some this threshold value triggers Update stats less frequently (e.g SAP databases) while for some workload the default 20% setting triggers Auto Update Stats…

|

I killed Reindexing Job and now it is in KILLED/ROLLBACK State for more than 9 hours

  One of our Customers ran into this issue where in he killed a Reindexing Job and following that it went into KILLED/ROLLBACK State and was in that State for more than 9 hours. First of all we would not recommend you to kill Job like Reindexing or DBCC CHECKDB which performs internal operations. However…

|

Will NoLock Hint allow you to query a table which undergoing offline reindexing?

  Recently I was delivering a workshop and this question came from one of the participants Will NoLock Hint allow me to query a table which is undergoing offline reindexing? My instant answer to that was NO, we cannot query a table with or without NOLOCK hint while we are performing Offline reindexing but I…

Did you know: A Full Database Backup for a database in Full Recovery model don’t truncate the T-Log and hence doesn’t break Log backup chain

  My Field Job gave me this observation that many Customers have this misconception that whenever a Full Database backup is taken for a database in Full Recovery mode, it truncates the Tlog and hence breaks the Tlog backup chain which is so untrue. In this post I am going to clarify the same One…

|

Fragmentation should not be the only factor which decides the Rebuild Index

Until now I was under the impression that fragmentation in the Index is the only factor which decides whether we should rebuild the index. As a rule of thumb we always recommend that when the avg_fragmentation_in_percent in the view  sys.dm_db_index_physical_stats  is between 5 and 30 We should reorganize the index and when the fragmentation is…