[name] 'SourceDB', s2.[name] 'Snapshot'
FROM sys.databases s1
INNER JOIN sys.databases s2
ON s1.database_id=s2.source_database_id
nCaution Be careful when executing the query that returns each database name and associated snapshots.
The SourceDB column exists in sys.databases but not in sys.sysdatabases. Be sure to specify
the correct source table in your FROM clause.
CHAPTER 9 n DATABASE SNAPSHOTS 237
Figure 9-6 shows some example results from the preceding query. You can see how
snapshot names are correlated with their respective database sources.
Figure 9-6. Query results correlating snapshots to their source databases
You could include the Creation_Date field from sys.databases when listing snapshots.
However, the purpose of a given snapshot can only be derived automatically when you
follow a solid naming convention.
Using Database Snapshots to Address
Process and User Error
Snapshots can be used for many purposes. For disaster recovery, though, the utility of
snapshots lies primarily in their ability to help you deal with process and user errors.
Dealing with Process Errors
With respect to disaster recovery, database snapshots are probably best used to deal
with process errors.
Pages:
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437