Checking IFI enabled on SQL server below 2016 Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)MS SQL Server 2016 Oprimal Disk Configurationinstalling SQL SERVER 2016 side-by-side SQL Server 2012SSRS 2016 Connect to SQL Server with Force Encryption EnabledInstallation SQL Server 2016 errorSQL Server 2016 vs 2012 insert performanceSQL server 2016 - .mdmp fileSQL Server 2016 Enterprise poor performanceSQL Server 2016 expiration dateHow to remotely connect SQL Server 2016. Since we have 2012 and 2016 in same serverIntelliSense is enabled but not working in SQL Server 2016 with Azure SQL DB

What kind of equipment or other technology is necessary to photograph sprites (atmospheric phenomenon)

Is "ein Herz wie das meine" an antiquated or colloquial use of the possesive pronoun?

How to break 信じようとしていただけかも知れない into separate parts?

Recursive calls to a function - why is the address of the parameter passed to it lowering with each call?

Why aren't road bike wheels tiny?

What *exactly* is electrical current, voltage, and resistance?

What helicopter has the most rotor blades?

Im stuck and having trouble with ¬P ∨ Q Prove: P → Q

Does traveling In The United States require a passport or can I use my green card if not a US citizen?

What is the evidence that custom checks in Northern Ireland are going to result in violence?

Why do C and C++ allow the expression (int) + 4*5?

A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?

Can a Wizard take the Magic Initiate feat and select spells from the Wizard list?

What could prevent concentrated local exploration?

When speaking, how do you change your mind mid-sentence?

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

Suing a Police Officer Instead of the Police Department

Normal Operator || T^2|| = ||T||^2

Is it OK if I do not take the receipt in Germany?

Can gravitational waves pass through a black hole?

What were wait-states, and why was it only an issue for PCs?

What is the ongoing value of the Kanban board to the developers as opposed to management

Who can become a wight?

tabularx column has extra padding at right?



Checking IFI enabled on SQL server below 2016



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)MS SQL Server 2016 Oprimal Disk Configurationinstalling SQL SERVER 2016 side-by-side SQL Server 2012SSRS 2016 Connect to SQL Server with Force Encryption EnabledInstallation SQL Server 2016 errorSQL Server 2016 vs 2012 insert performanceSQL server 2016 - .mdmp fileSQL Server 2016 Enterprise poor performanceSQL Server 2016 expiration dateHow to remotely connect SQL Server 2016. Since we have 2012 and 2016 in same serverIntelliSense is enabled but not working in SQL Server 2016 with Azure SQL DB



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am using in one of my reports to check for status of IFI being enabled on SQL server.



It works well when using dmv sys.dm_server_services for SQL2016



However, in SQL2014 and SQL2012 i see difficulties in rendering this check via SQL query.



For example if i use below



EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization';


There is no guarantee it will show status on file '0' and sometimes i keep querying the error log manually to find that out. How can i achieve the IFI check using a better way so that it can show up on my SSRS report










share|improve this question






















  • I haven’t actually tested this but the post uses PowerShell to check if the specified user account has been granted the local policy “Perform Volume Maintenance Tasks”. mssqltips.com/sqlservertip/5240/…

    – Aaron
    3 hours ago

















1















I am using in one of my reports to check for status of IFI being enabled on SQL server.



It works well when using dmv sys.dm_server_services for SQL2016



However, in SQL2014 and SQL2012 i see difficulties in rendering this check via SQL query.



For example if i use below



EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization';


There is no guarantee it will show status on file '0' and sometimes i keep querying the error log manually to find that out. How can i achieve the IFI check using a better way so that it can show up on my SSRS report










share|improve this question






















  • I haven’t actually tested this but the post uses PowerShell to check if the specified user account has been granted the local policy “Perform Volume Maintenance Tasks”. mssqltips.com/sqlservertip/5240/…

    – Aaron
    3 hours ago













1












1








1








I am using in one of my reports to check for status of IFI being enabled on SQL server.



It works well when using dmv sys.dm_server_services for SQL2016



However, in SQL2014 and SQL2012 i see difficulties in rendering this check via SQL query.



For example if i use below



EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization';


There is no guarantee it will show status on file '0' and sometimes i keep querying the error log manually to find that out. How can i achieve the IFI check using a better way so that it can show up on my SSRS report










share|improve this question














I am using in one of my reports to check for status of IFI being enabled on SQL server.



It works well when using dmv sys.dm_server_services for SQL2016



However, in SQL2014 and SQL2012 i see difficulties in rendering this check via SQL query.



For example if i use below



EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization';


There is no guarantee it will show status on file '0' and sometimes i keep querying the error log manually to find that out. How can i achieve the IFI check using a better way so that it can show up on my SSRS report







sql-server sql-server-2012 sql-server-2014 sql-server-2016






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









BeginnerDBABeginnerDBA

7041520




7041520












  • I haven’t actually tested this but the post uses PowerShell to check if the specified user account has been granted the local policy “Perform Volume Maintenance Tasks”. mssqltips.com/sqlservertip/5240/…

    – Aaron
    3 hours ago

















  • I haven’t actually tested this but the post uses PowerShell to check if the specified user account has been granted the local policy “Perform Volume Maintenance Tasks”. mssqltips.com/sqlservertip/5240/…

    – Aaron
    3 hours ago
















I haven’t actually tested this but the post uses PowerShell to check if the specified user account has been granted the local policy “Perform Volume Maintenance Tasks”. mssqltips.com/sqlservertip/5240/…

– Aaron
3 hours ago





I haven’t actually tested this but the post uses PowerShell to check if the specified user account has been granted the local policy “Perform Volume Maintenance Tasks”. mssqltips.com/sqlservertip/5240/…

– Aaron
3 hours ago










2 Answers
2






active

oldest

votes


















1














According to this MSSQLTips.com article, you can use sys.dm_server_services beginning with SQL 2012 SP4.




SELECT @@SERVERNAME AS [Server Name] ,
RIGHT(@@version, LEN(@@version) - 3 - CHARINDEX(' ON ', @@VERSION)) AS [OS Info] ,
LEFT(@@VERSION, CHARINDEX('-', @@VERSION) - 2) + ' '
+ CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(300)) AS [SQL Server Version] ,
service_account ,
instant_file_initialization_enabled
FROM sys.dm_server_services
WHERE servicename LIKE 'SQL Server (%'



For older versions, you'll need to scrape the log, looking for "Database Instant File Initialization: enabled."






share|improve this answer






























    1














    Glenn Spies posted at SQLSkills.com this script.
    https://www.sqlskills.com/blogs/paul/how-to-tell-if-you-have-instant-initialization-enabled/



    I've used it a few times, and it works correctly.



    USE master
    GO
    EXEC sp_configure 'show advanced options', 1
    GO
    RECONFIGURE WITH OVERRIDE;
    GO
    EXEC sp_configure 'xp_cmdshell', 1;
    GO
    RECONFIGURE WITH OVERRIDE;
    GO

    CREATE TABLE #xp_cmdshell_output (Output VARCHAR (8000));
    GO

    INSERT INTO #xp_cmdshell_output EXEC ('xp_cmdshell ''whoami /priv''');
    GO

    IF EXISTS (SELECT * FROM #xp_cmdshell_output WHERE Output LIKE '%SeManageVolumePrivilege%')
    PRINT 'Instant Initialization enabled'
    ELSE
    PRINT 'Instant Initialization disabled';
    GO

    DROP TABLE #xp_cmdshell_output;
    GO





    share|improve this answer























    • This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

      – Randolph West
      2 hours ago












    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "182"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f235412%2fchecking-ifi-enabled-on-sql-server-below-2016%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    According to this MSSQLTips.com article, you can use sys.dm_server_services beginning with SQL 2012 SP4.




    SELECT @@SERVERNAME AS [Server Name] ,
    RIGHT(@@version, LEN(@@version) - 3 - CHARINDEX(' ON ', @@VERSION)) AS [OS Info] ,
    LEFT(@@VERSION, CHARINDEX('-', @@VERSION) - 2) + ' '
    + CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(300)) AS [SQL Server Version] ,
    service_account ,
    instant_file_initialization_enabled
    FROM sys.dm_server_services
    WHERE servicename LIKE 'SQL Server (%'



    For older versions, you'll need to scrape the log, looking for "Database Instant File Initialization: enabled."






    share|improve this answer



























      1














      According to this MSSQLTips.com article, you can use sys.dm_server_services beginning with SQL 2012 SP4.




      SELECT @@SERVERNAME AS [Server Name] ,
      RIGHT(@@version, LEN(@@version) - 3 - CHARINDEX(' ON ', @@VERSION)) AS [OS Info] ,
      LEFT(@@VERSION, CHARINDEX('-', @@VERSION) - 2) + ' '
      + CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(300)) AS [SQL Server Version] ,
      service_account ,
      instant_file_initialization_enabled
      FROM sys.dm_server_services
      WHERE servicename LIKE 'SQL Server (%'



      For older versions, you'll need to scrape the log, looking for "Database Instant File Initialization: enabled."






      share|improve this answer

























        1












        1








        1







        According to this MSSQLTips.com article, you can use sys.dm_server_services beginning with SQL 2012 SP4.




        SELECT @@SERVERNAME AS [Server Name] ,
        RIGHT(@@version, LEN(@@version) - 3 - CHARINDEX(' ON ', @@VERSION)) AS [OS Info] ,
        LEFT(@@VERSION, CHARINDEX('-', @@VERSION) - 2) + ' '
        + CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(300)) AS [SQL Server Version] ,
        service_account ,
        instant_file_initialization_enabled
        FROM sys.dm_server_services
        WHERE servicename LIKE 'SQL Server (%'



        For older versions, you'll need to scrape the log, looking for "Database Instant File Initialization: enabled."






        share|improve this answer













        According to this MSSQLTips.com article, you can use sys.dm_server_services beginning with SQL 2012 SP4.




        SELECT @@SERVERNAME AS [Server Name] ,
        RIGHT(@@version, LEN(@@version) - 3 - CHARINDEX(' ON ', @@VERSION)) AS [OS Info] ,
        LEFT(@@VERSION, CHARINDEX('-', @@VERSION) - 2) + ' '
        + CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(300)) AS [SQL Server Version] ,
        service_account ,
        instant_file_initialization_enabled
        FROM sys.dm_server_services
        WHERE servicename LIKE 'SQL Server (%'



        For older versions, you'll need to scrape the log, looking for "Database Instant File Initialization: enabled."







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 7 hours ago









        Doug DedenDoug Deden

        4286




        4286























            1














            Glenn Spies posted at SQLSkills.com this script.
            https://www.sqlskills.com/blogs/paul/how-to-tell-if-you-have-instant-initialization-enabled/



            I've used it a few times, and it works correctly.



            USE master
            GO
            EXEC sp_configure 'show advanced options', 1
            GO
            RECONFIGURE WITH OVERRIDE;
            GO
            EXEC sp_configure 'xp_cmdshell', 1;
            GO
            RECONFIGURE WITH OVERRIDE;
            GO

            CREATE TABLE #xp_cmdshell_output (Output VARCHAR (8000));
            GO

            INSERT INTO #xp_cmdshell_output EXEC ('xp_cmdshell ''whoami /priv''');
            GO

            IF EXISTS (SELECT * FROM #xp_cmdshell_output WHERE Output LIKE '%SeManageVolumePrivilege%')
            PRINT 'Instant Initialization enabled'
            ELSE
            PRINT 'Instant Initialization disabled';
            GO

            DROP TABLE #xp_cmdshell_output;
            GO





            share|improve this answer























            • This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

              – Randolph West
              2 hours ago
















            1














            Glenn Spies posted at SQLSkills.com this script.
            https://www.sqlskills.com/blogs/paul/how-to-tell-if-you-have-instant-initialization-enabled/



            I've used it a few times, and it works correctly.



            USE master
            GO
            EXEC sp_configure 'show advanced options', 1
            GO
            RECONFIGURE WITH OVERRIDE;
            GO
            EXEC sp_configure 'xp_cmdshell', 1;
            GO
            RECONFIGURE WITH OVERRIDE;
            GO

            CREATE TABLE #xp_cmdshell_output (Output VARCHAR (8000));
            GO

            INSERT INTO #xp_cmdshell_output EXEC ('xp_cmdshell ''whoami /priv''');
            GO

            IF EXISTS (SELECT * FROM #xp_cmdshell_output WHERE Output LIKE '%SeManageVolumePrivilege%')
            PRINT 'Instant Initialization enabled'
            ELSE
            PRINT 'Instant Initialization disabled';
            GO

            DROP TABLE #xp_cmdshell_output;
            GO





            share|improve this answer























            • This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

              – Randolph West
              2 hours ago














            1












            1








            1







            Glenn Spies posted at SQLSkills.com this script.
            https://www.sqlskills.com/blogs/paul/how-to-tell-if-you-have-instant-initialization-enabled/



            I've used it a few times, and it works correctly.



            USE master
            GO
            EXEC sp_configure 'show advanced options', 1
            GO
            RECONFIGURE WITH OVERRIDE;
            GO
            EXEC sp_configure 'xp_cmdshell', 1;
            GO
            RECONFIGURE WITH OVERRIDE;
            GO

            CREATE TABLE #xp_cmdshell_output (Output VARCHAR (8000));
            GO

            INSERT INTO #xp_cmdshell_output EXEC ('xp_cmdshell ''whoami /priv''');
            GO

            IF EXISTS (SELECT * FROM #xp_cmdshell_output WHERE Output LIKE '%SeManageVolumePrivilege%')
            PRINT 'Instant Initialization enabled'
            ELSE
            PRINT 'Instant Initialization disabled';
            GO

            DROP TABLE #xp_cmdshell_output;
            GO





            share|improve this answer













            Glenn Spies posted at SQLSkills.com this script.
            https://www.sqlskills.com/blogs/paul/how-to-tell-if-you-have-instant-initialization-enabled/



            I've used it a few times, and it works correctly.



            USE master
            GO
            EXEC sp_configure 'show advanced options', 1
            GO
            RECONFIGURE WITH OVERRIDE;
            GO
            EXEC sp_configure 'xp_cmdshell', 1;
            GO
            RECONFIGURE WITH OVERRIDE;
            GO

            CREATE TABLE #xp_cmdshell_output (Output VARCHAR (8000));
            GO

            INSERT INTO #xp_cmdshell_output EXEC ('xp_cmdshell ''whoami /priv''');
            GO

            IF EXISTS (SELECT * FROM #xp_cmdshell_output WHERE Output LIKE '%SeManageVolumePrivilege%')
            PRINT 'Instant Initialization enabled'
            ELSE
            PRINT 'Instant Initialization disabled';
            GO

            DROP TABLE #xp_cmdshell_output;
            GO






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 7 hours ago









            Conrad S.Conrad S.

            584




            584












            • This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

              – Randolph West
              2 hours ago


















            • This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

              – Randolph West
              2 hours ago

















            This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

            – Randolph West
            2 hours ago






            This is pretty neat, and I'm leveraging it. It does require xp_cmdshell, though that seems a non-issue with the OP's current usage of xp_readerrorlog.

            – Randolph West
            2 hours ago


















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Database Administrators Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f235412%2fchecking-ifi-enabled-on-sql-server-below-2016%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Oświęcim Innehåll Historia | Källor | Externa länkar | Navigeringsmeny50°2′18″N 19°13′17″Ö / 50.03833°N 19.22139°Ö / 50.03833; 19.2213950°2′18″N 19°13′17″Ö / 50.03833°N 19.22139°Ö / 50.03833; 19.221393089658Nordisk familjebok, AuschwitzInsidan tro och existensJewish Community i OświęcimAuschwitz Jewish Center: MuseumAuschwitz Jewish Center

            Valle di Casies Indice Geografia fisica | Origini del nome | Storia | Società | Amministrazione | Sport | Note | Bibliografia | Voci correlate | Altri progetti | Collegamenti esterni | Menu di navigazione46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)Sito istituzionaleAstat Censimento della popolazione 2011 - Determinazione della consistenza dei tre gruppi linguistici della Provincia Autonoma di Bolzano-Alto Adige - giugno 2012Numeri e fattiValle di CasiesDato IstatTabella dei gradi/giorno dei Comuni italiani raggruppati per Regione e Provincia26 agosto 1993, n. 412Heraldry of the World: GsiesStatistiche I.StatValCasies.comWikimedia CommonsWikimedia CommonsValle di CasiesSito ufficialeValle di CasiesMM14870458910042978-6

            Typsetting diagram chases (with TikZ?) Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to define the default vertical distance between nodes?Draw edge on arcNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to place nodes in an absolute coordinate system in tikzCommutative diagram with curve connecting between nodesTikz with standalone: pinning tikz coordinates to page cmDrawing a Decision Diagram with Tikz and layout manager