Avoid Corruption Nightmares within your Virtual Database

Post on 12-Apr-2017

314 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

Transcript

Avoid Corruption Nightmares with IDERA’s Virtual Database and CheckDB

February 10th, 2016

John MorehouseDatabase ArchitectFarm Credit Mid-America, Louisville, Kentucky

Who Am I 1

• Work and live in Louisville, Kentucky• Co-founder of the Omaha SQL/BI User Group • Frequent Speaker of SQL Saturday’s & other conferences• Heavily involved with SQL PASS• PASS Outstanding Volunteer• Friend of Red Gate• Idera ACE 2016

Contact Me 2

@SqlRUs

http://linkedin.com/in/sqlrus

http://www.sqlrus.com

john@jmorehouse.com

Agenda

Virtual Database

Common CheckDB Problems

Common CheckDB Solutions

Process

3

12

4

4

5 Demo

The Problem..

• You have a lot of databases• You have a couple 1TB+ databases• Your server is highly volatile• You know need to run DBCC CheckDB• You know that running CheckDB takes up

critical resources

5

The Problems..

• You have a lot of databases• You have a couple 1TB+ databases• Your server is highly volatile• You know need to run DBCC CheckDB• You know that running CheckDB takes up

critical resources

6

What do you do?

Solutions…

• You could run CHECKDB at night• You could run CHECKDB on the weekends• You could run CHECKDB during maintenance windows• You could run CHECKDB on secondary AG group• You could performance tune CHECKDB with Trace Flags• You could performance tune TempDB• You could run CHECKDB on restored backup copy on

secondary server• You could run portions of CHECKDB• You could run CHECKDB on secondary log shipped

database• And so on….

7

Solutions…

• You could run CheckDB at night• You could run CheckDB on the weekends• You could run CheckDB on secondary AG group• You could performance tune CheckDB with Trace Flags• You could performance tune TempDB• You could run CheckDB on restored backup copy on

secondary server• You could run CheckDB on secondary log shipped

database• And so on….

9

There might be another solution..

SQL Virtual Database 10

• Allows you to virtual restore databases• Run queries• Change data• Utilizes sparse file technology

– Works with limited disk space• Memory is your friend

– Cost effective

Virtual Database 11

• The other solution– CheckDB on a virtual restore– Use PowerShell– Use a virtual machine

• BONUS– Validate database backups

A Solution 12

• SQL Instance• SQL Virtual Database• SQL Agent Job• PowerShell Script

The Process 13

• Find most recent backups– Can include full,

differential, or transaction log backups

• Restore each one– Using MOVE cmd

• Run CheckDB• Track the progress

DEMO 14

What you’ll see..

• See how sparse file technology helps

• Finding the latest Full/Diff backup• Generating the MOVE command• Calling Virtual Database to restore• Running CheckDB• Tracking the status of things

Some Notes.. 15

• SQL Agent Service Account needs access to backup location

• Virtual DB service account needs the ability to restore on the destination instance

• Cannot restore large number of database at once• You could use the backup location as the source instead

of MSDB– potentially messier script

• Assume backup strategy is set in place– Adjustments can break this process

• Folder permission issues with Virtual Database

Q&A 16

THANK YOU!!

@SqlRUs

http://linkedin.com/in/sqlrus

http://www.sqlrus.com

john@jmorehouse.com

Free Trial Offers 19

Download any of product free for 14-days.

www.IDERA.com

top related