A database snapshot is simply a file or collection
of files associated with a specific database. When a data page in the source
database changes, the original data page is first copied to snapshot file before updating
the source database. This process is called copy-on-write. Figure 9-1 illustrates the copyon-
write process, which happens only once per data page; after a data page in the source
database has been modified and copied to the snapshot file, it will never be copied again.
The snapshot is intended to represent the database at a particular point in time, so it only
needs the original copy of the data page, not subsequent changes.
229
C H A P T E R 9
Figure 9-1. SQL Server??™s copy-on-write process for generating snapshots
The snapshot doesn??™t care what type of data is on the page; it could be table data,
index data, or information catalog data??”even GAM, SGAM, or Index Allocation Map
(IAM) pages. There??™s no evaluation of the information being copied, so the process is
extremely fast.
Theoretically, the snapshot file(s) could grow to be as large as the source database
(if every data page were modified).
Pages:
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425