Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Restoring in tight space conditions

Author  Topic 

DaRube
Starting Member

1 Post

Posted - 2005-09-02 : 23:09:43
A co-worker and I had different ideas about how SQL Server manages space during a full database restore.

We agreed that a full database backup records the size of the data and log files, including any unused space that has not been shrunk out. And we also agreed that the restore, when complete, would have data and log files of the same size as they were when the backup was taken.

Where we disagreed was on how SQL Server utilized space while the restore was going on.

He believed that SQL Server would "stage" the backup through the log files, and that at some points along the way, the log file might be larger than its "starting point" (and "ending point") size.

By contrast, I indicated that SQL Server begins by allocating the files to their ultimate size, and then writes the data directly into the data file, efficiently requiring no "staging" operation.

The answer is crucial to us, as we are operating under constrained space conditions, and with throughput requirements that force us to "finesse" when we shrink the database files.

Which of us was correct in our understanding of the restore process? And if neither of us, how does SQL Server really handle restores under the hood? Any good article or book references on this topic?

nr
SQLTeam MVY

12543 Posts

Posted - 2005-09-04 : 10:57:34
I think this is covered in bol.
The database and log are restored so they will be the same size as the source.
Then the transactions are rolled back or forward.
I supose this action could cause the tr log to grow or even the data files but maybe not.
Any server that didn't allow for a little growth is asking for trouble though.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -