220 likes | 527 Views
Said Salomon timelord@timelordshangout.com. Database Snapshots. Who am I?.
E N D
Said Salomon timelord@timelordshangout.com Database Snapshots
Who am I? • I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities in the field in the areas of Network, Desktop Support, DBA, Staff Project Management, Application Software Development, Business Analysis and Quality Assurance. I have Microsoft certifications as a MCTS, MCPS, and MCNPS, and multiple certifications from the Insurance Institute of America. Current Said is a DBA at Unitrin Direct Insurance.
Philadelphia SQL Server User Group (PSSUG)Up coming events Specializing in Database and Business Intelligence topics for Philly and SJ For More Info: http://www.pssug.org
Agenda • What is Database Snapshot • Why use Database Snapshot • What can be done with Database Snapshot • How does a Database Snapshot work • Review basic T-SQL syntax • Demo • Q&A
What is Database Snapshot? • Microsoft – “A database snapshot is a read-only, static view of a database, called the source database. In Microsoft SQL Server 2005 and later versions, you must use Transact-SQL statements for creating, reverting to, and deleting a database snapshot. However, you can use SQL Server Management Studio to view existing database snapshots.”
What is it??? • A database snapshot is a point in time read only snapshot. It looks like a copy of the database but normally takes up less than 10% space.
Restrictions on Database Snapshots • Enterprise only • can not backup a snapshot • The source database cannot be dropped, detached, or restored. • Performance is reduced • Snapshots of the model, master, and tempdb databases are prohibited
Create Database Snapshot • CREATE DATABASE ssAdventureWorks_MySnap ON ( NAME = AdventureWorks_Data, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_MySnap.ss' ) AS SNAPSHOT OF AdventureWorks; GO
Select from Database Snapshot • SELECT * FROM [ssAdventureWorks_MySnap].[HumanResources].[Employee]
Restoring from Database Snapshot • RESTORE DATABASE AdventureWorks from DATABASE_SNAPSHOT = 'ssAdventureWorks_MySnap'; GO
Dropping Database Snapshot • DROP DATABASE [ssAdventureWorks_MySnap]
Demo • Demo
Resources • Microsoft http://msdn.microsoft.com/en-us/library/ms175158.aspx • Limts: http://msdn.microsoft.com/en-us/library/ms189940.aspx • Performance: http://sqlcat.com/whitepapers/archive/2008/02/11/database-snapshot-performance-considerations-under-i-o-intensive-workloads.aspx • http://www.timelordshangout.com
Philadelphia SQL Server User Group (PSSUG)Up coming events Specializing in Database and Business Intelligence topics for Philly and SJ For More Info: http://www.pssug.org