Said Salomon [email protected]. I has over 25 year experience as an Information...

20
Database Snapshots Said Salomon [email protected]

Transcript of Said Salomon [email protected]. I has over 25 year experience as an Information...

Page 1: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Database Snapshots

Said [email protected]

Page 2: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

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.

Page 3: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Philadelphia SQL Server User Group (PSSUG)Up coming events

Date Topics Location

10/13/2010 at 5:30PM

SSRS R2Parallel Data Warehouse

Microsoft Malvern Office

10/18/2010 at 6:00PM

System Tables part 1 Live Meeting event

10/26/2010 at 5:30PM

Dyn Config PackagesSQL 2008 R2 Overview

Haddon Heights Library(South Jersey)

11/10/2010 at 5:30PM

TBA Microsoft Malvern Office

11/08/2010 - 11/12/2010

PASS Summit Seattle, WA

11/15/2010 at 6:00PM

System Tables part 2 Live Meeting event

12/08/2010 at 5:30PM

TBA Microsoft Malvern Office

March 2011 Philly SQL Saturday TBA

Specializing in Database and Business Intelligence topics for Philly and SJ

For More Info: http://www.pssug.org

Page 4: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

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

Page 5: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

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.”

Page 6: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

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.

Page 7: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

How Database snapshots work

Page 8: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

When to use a Database Snapshot

Page 9: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

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

Page 10: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

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

Page 11: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Select from Database Snapshot

SELECT * FROM [ssAdventureWorks_MySnap].

[HumanResources].[Employee]

Page 12: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Restoring from Database Snapshot

RESTORE DATABASE AdventureWorks from DATABASE_SNAPSHOT = 'ssAdventureWorks_MySnap'; GO

Page 13: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Dropping Database Snapshot

DROP DATABASE [ssAdventureWorks_MySnap]

Page 14: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Demo

Demo

Page 15: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Snapshot Creation Time

100 500 1000 15000

500

1000

1500

2000

2500

Database Snapshot Creation Time with Varying Workload

User Load (Number of active user connections)

Data

base s

napshot

cre

ati

on t

ime (

seconds)

Page 16: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Multiple Snapshots

1 2 3 4 50

500

1000

1500

2000

2500

3000

3500

4000

Creating Multiple Successive Database Snapshots

500 Users 1000 Users 1500 Users

Number of Database Snapshots

Data

base s

napshot

cre

ati

on t

ime (

sec)

Page 17: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Snapshot Response Time

01

23

45

0

2

4

6

8

10

12

Impact of Multiple Database Snapshots on Transaction Response Time

Transaction 1 Transaction 2 Transaction 3 Transaction 4 Transaction 5

Number of Existing Database Snapshots

Avera

ge R

esponse T

ime (

sec)

Page 18: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Snapshot Index Creation

NonClustered Index Clustered Index NonClustered Index Clustered Index0 500

0

1000

2000

3000

4000

5000

6000

7000

8000

Impact of Database Snapshot creation on Index Creation

With No DB Snapshot With 1 DB Snapshot

User Load (Number of Active User Sessions)

Index C

reati

on T

ime (

seconds)

Page 20: Said Salomon timelord@timelordshangout.com.  I has over 25 year experience as an Information Technology Professional. He has a vast array of abilities.

Philadelphia SQL Server User Group (PSSUG)Up coming events

Date Topics Location

10/13/2010 at 5:30PM

SSRS R2Parallel Data Warehouse

Microsoft Malvern Office

10/18/2010 at 6:00PM

System Tables part 1 Live Meeting event

10/26/2010 at 5:30PM

Dyn Config PackagesSQL 2008 R2 Overview

Haddon Heights Library(South Jersey)

11/10/2010 at 5:30PM

TBA Microsoft Malvern Office

11/08/2010 - 11/12/2010

PASS Summit Seattle, WA

11/15/2010 at 6:00PM

System Tables part 2 Live Meeting event

12/08/2010 at 5:30PM

TBA Microsoft Malvern Office

March 2011 Philly SQL Saturday TBA

Specializing in Database and Business Intelligence topics for Philly and SJ

For More Info: http://www.pssug.org