What is a database snapshot?
A database snapshot is a read-only static view of the current database.
How does a database snapshot work?
Once a snapshot of the data is created, the database snapshot is allocated to a free file. When the original page of the database changes, the original page of the database is moved to the database snapshot.
Pictures from the web
To create a snapshot:
CREATE datadase database_snapshot_name----Server Storage Name
On
(
Name = logical_snapshot_name,-----local Storage Name
filename = ' d:\snapshot_name-----Local storage file
)
As Snapshot of Database_snapshot_name
eg. creating a database Snapshot
Use Factorygocreate Database FACTORY_DBSS on ( name = Factory, filename = ' D:\factory_poto ') as snapshot of factory
accessing database Snapshots
1 Use FACTORY_DBSS 2 Go 3 4 Select * from Factory_dbss.dbo.depart
Deleting a database snapshot
1 DROP DATABASE FACTORY_DBSS
Recovering a database using snapshots
1 Use Master 2 Go 3 4 Restore Database from = ' FACTORY_DBSS ' 5 Go
To create a database snapshot regularly
SQL SERVER Database Snapshot