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


Modify Size for datafile clarification


Modify Size for datafile clarification

Author
Message
jjturner
jjturner
Old Hand
Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)

Group: General Forum Members
Points: 354 Visits: 532
From BOL, I see these remarks with respect to the MODIFY FILE subcommand (my underline added):

Initializing Files
By default, data and log files are initialized by filling the files with zeros when you perform one of the following operations:

Create a database

Add files to an existing database

Increase the size of an existing file

Restore a database or filegroup

Which leads me to believe that expanding the size of a datafile will also wipe out (my definition of 'initialize') any existing data within that file.

I may be misunderstanding 'initialize', because when I tested it out, I found this wasn't the case - my table data written to the file was still there after a resize.

So I'd be much obliged if anyone can clarify to what degree I'd be taking a risk by increasing the file size on a datafile which already has data in it.

Thanks,
John
free_mascot
free_mascot
SSCarpal Tunnel
SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)

Group: General Forum Members
Points: 4029 Visits: 2235
No it will not wipe out existing data. But fill the extended files with 0. i.e. if you do have file size 100 MB with data of 80 MB and expanding by 50 MB it will fill 50 MB with 0.

HTH

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
jjturner
jjturner
Old Hand
Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)Old Hand (354 reputation)

Group: General Forum Members
Points: 354 Visits: 532
Thanks for the verification, that puts my worries to rest -

Now I’m guessing that with Instant File Initialization turned on, it may simply be allocating the new space rather than going the extra step of 0-filling. Time to go back and test that one..
GilaMonster
GilaMonster
SSC Guru
SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)

Group: General Forum Members
Points: 88429 Visits: 45284
jjturner (3/26/2014)
Now I’m guessing that with Instant File Initialization turned on, it may simply be allocating the new space rather than going the extra step of 0-filling. Time to go back and test that one..


Correct, providing it's a data file. Log files are always zdero-initiaised.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


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