Instant File Initialization and restores

  • Comments posted to this topic are about the item Instant File Initialization and restores

    • This topic was modified 5 days, 13 hours ago by  Site Owners.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I really like the way you demonstrated the difference in times in the restore process. I'm sure smeone will point out that you can skip zeroing out the log file too (or even the data file) by using replace to replace an existing database with a log file at least that same size. That's a tangential point and out of scope for your article, so I think it's fine that you didn't include that point.

    One small correction: it's secpol.msc, not exe.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Robert Davis (5/20/2012)


    I really like the way you demonstrated the difference in times in the restore process. I'm sure smeone will point out that you can skip zeroing out the log file too (or even the data file) by using replace to replace an existing database with a log file at least that same size. That's a tangential point and out of scope for your article, so I think it's fine that you didn't include that point.

    Good point Robert, I'm glad you like it.:smooooth:

    Whether the option replace can be used (with perspective of reusing the files) of course depends on the cause of the corruption and might have gone beyond the target of this promotion of IFI. 😉

    One small correction: it's secpol.msc, not exe.

    Thank you for noticing this and passing it over.

    I'll have it corrected it ASAP.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I have a question about this, for example we have a big database about 100GB, and it has to move to another new server, when doing the restore, I may do in the following two ways,

    1. I create a new database with the same name and then do the restore to overwrite it in ssms.

    2. Directly do the restore database with the same name in ssms.

    If I grant the instant intialization file right to the service account, it will reduce the time for both cases, correct?

    Thanks,

  • Indeed.

    Instant File Initialization will kick in on database create as well as a direct db restore.

    As Robert stated, there may even be a cutt off of your restore time if you restore with replace on an existing database with exactly the same size properties for all files.

    I still have to test this, but my test server has been destroyed because of parts shortage ( stock ran out of processors and ram ).

    If you can and have the time and are willing to test, it would be nice to acutally have some timings results and - if you also activate the needed trace flags - trace information in both cases for your situation. :w00t:

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Note that Instant File Initialization does not work when you are using TDE. See msdn.microsoft.com/en-us/library/bb934049.aspx for more info.

  • TheSQLGuy (5/21/2012)


    Note that Instant File Initialization does not work when you are using TDE. See msdn.microsoft.com/en-us/library/bb934049.aspx for more info.

    Good remark.

    That restriction, of course, also goes when restoring a database.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Great article. It always amazes me how many people don't know about this feature. I still find servers in our infrastructure that do not have it enabled.

    I have one question for you. You mention that you have a checklist for server builds. I am currently working to build one of these for our SQL team. I was wondering if you might share yours as an example I can learn from.

    Also, in our environment we have server engineers that handle the OS part of server configurations. If you have a similar setup, where do you draw the line of SQL configs vs. OS configs. I have been told by my engineers that the Instant File Initialization would be an OS config, but they are not willing to add it to their checklist.

    Just curious.

  • Good article ..

    There is a slight potential security risk associated which is described here http://blogs.msdn.com/b/askjay/archive/2011/03/11/why-is-using-instant-file-initialization-on-my-sql-server-a-potential-security-issue.aspx

    Some misconceptions are well explained here: http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-instant-file-initialization.aspx

    ______________________________________________________________________________________________________________________________________________________________________________________
    HTH !
    Kin
    MCTS : 2005, 2008
    Active SQL Server Community Contributor 🙂

  • gbargsley (7/30/2012)


    Great article. It always amazes me how many people don't know about this feature. I still find servers in our infrastructure that do not have it enabled.

    I have one question for you. You mention that you have a checklist for server builds. I am currently working to build one of these for our SQL team. I was wondering if you might share yours as an example I can learn from.

    We collect statistics of all userdb + msdb and script out all databases at least once a week.

    We also collect all sys.configurations settings so we keep track per instance.

    Every instance also keeps track of individual configuration changes ( via a persisted table in our admin db that is being compared every hour ) using a sqlagent job.

    Also, in our environment we have server engineers that handle the OS part of server configurations. If you have a similar setup, where do you draw the line of SQL configs vs. OS configs. I have been told by my engineers that the Instant File Initialization would be an OS config, but they are not willing to add it to their checklist.

    Just curious.

    Please inform your OS engineers, they do your sqlserver instances wrong by not adding that to their checklist !

    On the other hand, it would be OK if they would grant you the auth. to grant that Windows membership to the service account of your instance. This would mean you would have total freedom using the correct domain account for your sqlserver service(s).

    It also depends how good a job you as a dba can do pre-sizing your data files at install time, the size your db files grow by as well as that frequency.

    As always, as long as your customers don't suffer, this doesn't surface, but you (and your OS engineers) could prevent file extend issues due to file initialization by granting your service account(s) this Windows authority.

    if you want to play it as managers like to hear it:

    What's the company cost of losing n Seconds of business due to timeouts of extending a file ? :ermm:

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • SQLQuest29 (7/30/2012)


    Good article ..

    There is a slight potential security risk associated which is described here http://blogs.msdn.com/b/askjay/archive/2011/03/11/why-is-using-instant-file-initialization-on-my-sql-server-a-potential-security-issue.aspx

    Some misconceptions are well explained here: http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-instant-file-initialization.aspx

    Thank you for adding these great references to mitigate the risks.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply