Posted by Barac in SQL Server, SQL Tips and Tricks
on Dec 11th, 2017 | 0 comments
Instant file initialization reclaims used disk space without filling that space with zeros. What those this means for our SQL Server data files? Data file grow needs to be completed immediately. Lets do a simple test. I will create additional tempdb files with fixed 10GB size without Instant file initialization enabled for the SQL Server service account. /* Adding additional tempdb files */ USE [master]; GO ALTER DATABASE [tempdb] ADD FILE (NAME = N'tempdev2', FILENAME = N'D:\MSSQL\TempDB\tempdev2.ndf' , SIZE = 10GB , FILEGROWTH = 0);...
Posted by Barac in SQL Server, SQL Tips and Tricks
on Dec 8th, 2017 | 12 comments
MS SQL Server Best Practices Article suggests as a SQL Server configuration best practice is to format your data, logs, and tempdb file drives with a 64KB allocation unit size. NTFS Allocation Unit Size When formatting the partition that will be used for SQL Server data files, it is recommended that you use a 64-KB allocation unit size for data, logs, and tempdb. Be aware however, that using allocation unit sizes greater than 4 KB results in the inability to use NTFS compression on the volume. SQL Server, although it is not recommended that...
Posted by Barac in SQL Monitoring, SQL Server, T-SQL
on Dec 6th, 2017 | 2 comments
Recently I had a situation on QA environment where Backup and Restore took a long time to finish. It was HA environment with two nodes in Always On High Availability Group, so backup and restored occurred over network shared location. Drives were slow, database was huge and network latency not the best so it took a long time to add database to the availability group. To follow up backup or restore progress with start time, total elapsed time and estimated completion time in similar situation you can use following script SELECT Session_id as...