Snapshot for Database SQL





use demostart
go

exec sp_helpfile
--creating snapshot database

create database demostart_Snapshot
on(name=demostart_Data,filename='C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\demostart_Snapshot.snap')
as snapshot of demostart

-- Reverting the soure database using snapshot database

use master

Go
Restore database demostart
from database_snapshot='demostart_Snapshot'


--to monitor waits caused by snapshot see REPLICA_WRITES in wait_type column

select * from sys.dm_os_wait_stats
where wait_type='REPLICA_WRITES'

--Droping snapshot database

Drop database demostart_Snapshot


Snapshot for Database SQL Reviewed by Rupesh on 04:27 Rating: 5

No comments:

All Rights Reserved by Technology from Developers Eye © 2014 - 2015
Powered By Blogger, Designed by Aadics
Disclaimers:: The information provided within this blogsite is for general informational purposes only. While we try to keep the information up-to-date and correct, there are no representations or warranties, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information, products, services, or related graphics contained in this blogsite for any purpose.The author does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause.

Contact Form

Name

Email *

Message *

Powered by Blogger.