SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Instant File Initialization and restores


Instant File Initialization and restores

Author
Message
ALZDBA
ALZDBA
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53559 Visits: 9117
Comments posted to this topic are about the item Instant File Initialization and restores

Johan


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


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


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Robert Davis
Robert Davis
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11941 Visits: 1666
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
SQL Server Best Practices: SQL Server Best Practices
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server, Data Platform MVP
Database Engineer at BlueMountain Capital Management
ALZDBA
ALZDBA
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53559 Visits: 9117
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


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


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


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
sqlfriends
sqlfriends
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20614 Visits: 4346
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,
ALZDBA
ALZDBA
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53559 Visits: 9117
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


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


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


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
TheSQLGuy
TheSQLGuy
SSC-Enthusiastic
SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)

Group: General Forum Members
Points: 136 Visits: 154
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.
ALZDBA
ALZDBA
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53559 Visits: 9117
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


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


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


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
gbargsley
gbargsley
SSC Eights!
SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)SSC Eights! (817 reputation)

Group: General Forum Members
Points: 817 Visits: 697
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.
SQLQuest29
SQLQuest29
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3712 Visits: 4427
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 :-)
ALZDBA
ALZDBA
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53559 Visits: 9117
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


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


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


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

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


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search