|
|||||||||||||||||
|
During a backup, SQL Server creates one reader thread for each volume that the database files reside on. The reader thread simply reads the contents of the files. Each time that it reads a portion of the file, it stores them in a buffer. There are multiple buffers in use, so the reader thread will keep on reading as long as there are free buffers to write to. SQL Server also creates one writer thread for each backup device to write the contents of the buffers out to disk or tape. The writer thread writes the data from the buffer to the disk or tape. Once the data has been written, the buffer can be reused by the reader thread. Thus, given the following command:
and assuming that AdventureWorks files are spread across three volumes, the backup process will proceed as follows:
If the BUFFERCOUNT and MAXTRANSFERSIZE parameters are not used, SQL Server will dynamically determine the number of buffers to use and the size of each buffer. The total memory used for the backup buffers will be BUFFERCOUNT x MAXTRANSFERSIZE (bytes) + some overheads. This memory is allocated from the non-buffer pool memory, also known as the MemToLeave memory. If you specify values that are larger than what is available, SQL Server will raise the following error:
If you want to find out the size and quantity of the buffers used by SQL Server for a backup, you can turn on trace flags 3605 and 3213. The values used are then recorded in the SQL Server log e.g.
Acknowledgement: Some icons on this page were generously provided by Fasticon.com. Document history
|
|||||||||||||||