Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Instant File Initialization and restores Expand / Collapse
Author
Message
Posted Sunday, May 20, 2012 3:45 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 12:40 AM
Points: 7,001, Visits: 8,439
Comments posted to this topic are about the item Instant File Initialization and restores

Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

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


- 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
Post #1303085
Posted Sunday, May 20, 2012 11:11 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, July 25, 2014 10:16 AM
Points: 1,612, Visits: 1,537
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
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #1303176
Posted Monday, May 21, 2012 12:08 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 12:40 AM
Points: 7,001, Visits: 8,439
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.

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


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

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


- 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
Post #1303187
Posted Monday, May 21, 2012 10:00 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 9:42 AM
Points: 1,749, Visits: 3,155
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,
Post #1303485
Posted Monday, May 21, 2012 10:38 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 12:40 AM
Points: 7,001, Visits: 8,439
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.




Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

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


- 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
Post #1303524
Posted Monday, May 21, 2012 12:49 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, March 6, 2014 2:31 PM
Points: 10, Visits: 73
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.
Post #1303619
Posted Monday, May 21, 2012 2:29 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 12:40 AM
Points: 7,001, Visits: 8,439
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


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

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


- 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
Post #1303726
Posted Monday, July 30, 2012 7:54 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 18, 2014 1:07 PM
Points: 504, Visits: 530
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.
Post #1337245
Posted Monday, July 30, 2012 8:17 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 8:25 PM
Points: 736, Visits: 3,690
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
Post #1337255
Posted Tuesday, July 31, 2012 8:07 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 12:40 AM
Points: 7,001, Visits: 8,439
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 ?


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

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


- 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
Post #1337915
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse