I got bored on the first leg of the journey from Seattle to London so thought I’d bang out a quick blog post. After my previous post on checking whether a SQL instance is able to use instant initialization (see here), I had a discussion with Scott R., who regularly comments on blog articles. He proposed an alternative method of checking whether the SQL service account has the Perform volume maintenance tasks privilege (AKA SeManageVolumePrivilege) (or other useful privileges like Lock pages in memory – SeLockMemoryPrivilege) and outlined the pros and cons of the various methods. With his permission, I’ve turned the information he provided into this blog post. To use whoami /priv to find the SQL service account privileges you need to enable xp_cmdshell to do it from within SQL, or be logged into the Windows box as the SQL service account. Scott suggested using an alternative tool called AccessChk, written by my friend Mark Russinovich (formerly of Sysinternals, now a Technical Fellow at Microsoft). Using it you can find the privileges assigned to other users, services, or processes. The example syntax to do this for a SQL instance would be: AccessChk –p sqlservr.exe –f –q -v This allows you to find the privileges of the SQL service account without having to enable xp_cmdshell or login as the service account itself. Let’s compare the whoami + xp_cmdshell combination with the AccessChk + command window combination. Whoami + xp_cmdshell Advantages: Disadvantages: AccessChk + command window Advantages: Disadvantages: Summary So is there a recommendation here? No, just a quick examination of the trade-offs with the two methods. Once again, I recommend you grant this privilege to the SQL service account for the massive performance boost it gives with data file creation or growth operations.
Black Friday Super Sale!
It’s the time of year again where companies do crazy sales on the day after Thanksgiving in the US, and we’re doing the same! Starting
7 thoughts on “Follow-on from instant initialization privilege checking”
Hi Abbie,
In this case, instant initialization is disabled. The privilege state equals the featue enabled state, if you see what I mean.
You need to manually enabled that privilege for the SQL Service Account using the Local Security Policy tool, and then restart the SQL instance.
Thanks
I read further and found the related article from Kimberly’s blog (also very interesting). I saw this statement on the Granting the permission "Perform Volume Maintenance Tasks" section which I hope you or Kim could clarify:
This permission can be granted by an administrator through the Local Security Policy tool (Start, All Programs, Administrative Tools) and once granted, SQL Server automatically uses instant initialization.
Does this mean that as long as the privilege is among the output returned whoami then you won’t need to care whether the state is disabled or not? Thanks in advance to you and Kimberly.
Hi Paul,
Please disregard the stuff above. Everything’s fine now. Thanks!
Best regards,
Abbie
Just came across your blog today and I find it very interesting.
I wanted to check whether we have this capability enabled in our systems so I ran whoami /priv as the SQL Server service account on a test machine. SeManageVolumePrivilege was one of the privileges returned by the command. However, I noticed that the State is Disabled. Is instant initialization enabled in this case? Do I need to do a seperate step to change the state to enabled or will SQL Server automatically enable and disable it as needed?
Thanks.
Here is another quick & dirty way to check if SQL Server is using the locked pages.
exec xp_readerrorlog 0, 1, ‘locked pages’
Paul,
Another way of verifying/granting privileges (even remotely!) is using good ol’ ntrights.exe from the ResKit. It’s freely available from MS downloads.
ntrights.exe +r SeManageVolumePrivilege -u DOMAINuser -m \MACHINE
ntrights.exe +r SeLockMemoryPrivilege -u DOMAINuser -m \MACHINE
Good for scripting and touch a bunch of servers, or doing unattended installs.
Rgds,
Argenis
I have created a Connect Item to make it easier to check whether Instant File Initialization is enabled on your instance: https://connect.microsoft.com/SQLServer/feedback/details/809901