Welcome #sqlclone sqlclonefeedback@red-gate.com
What problems do we face when provisioning databases? Grant Fritchey
Problem: Realistic Data • Matching production volumes • Mirroring data distribution of real data • Repeatable testing • Accurate testing and evaluation
Problem: Drive Space • Multiple teams and multiple branches • Realistic data • Isolated environments • 8x the amount of production data
Problem: Shared Environments Multiple development teams • Multiple developers per team • Multiple branches of code • Main branch • Hot fixes • New Development • Testing teams for each •
Problem: Regulatory Compliance Business regulations are increasing • Health Care • Banking • Insurance • Mens rea • International compliance (GDPR) • Cost of data breaches! •
Problem: General Data Cleanliness It’s not just about regulations & jail… • Email • Customer info • Special needs for testing or business
Do more with the same you • More development teams, more testing teams and more projects • Must meet more and growing list of requirements • Same DBA team sqlclonefeedback@red-gate.com
Alexa… clone my database
How SQL Clone helps you solve these provisioning problems Steve Jones and Richard Macaskill
What is SQL Clone “SQL Clone is a database provisioning tool that lets you create ‘full - sized’ copies of SQL Server databases and backups in in secon onds ds, using around 40MB MB of dis isk k space ce per clone.”
How does SQL Clone work? 1. Create a data image of a live SQL Server database or backup 2. Create clones from your data image on any machine that can access the file
Demo
What can SQL Clone do for you? Realistic data More drive space Isolated environments sqlclonefeedback@red-gate.com Do more with the same you! Fast small restores Automate jobs Self-service of clones
Using PowerShell with SQL Clone to automate provisioning jobs Richard Macaskill and Steve Jones
Example #1: Create an image for the latest backup, every night Day of the Week: Tuesday Wednesday Thursday Friday Monday Tuesday Daily Imag ages es: AW_20170321 AW_20170322 AW_20170324 AW_20170327 AW_20170328 AW_20170323 CloneA CloneB CloneC
Demo
Example #2: Create a clone for this feature branch on every workstation Image: Forex_20170327 (53GB) Clone: Clone: Clone: CloneA Forex-Hotfix-18554 Forex-Hotfix-18554 Forex-Hotfix-18554 CloneB (48MB) (48MB) (48MB) CloneC
Example #2: Create a clone for this feature branch on every workstation SQL Clone Server http:\\cloneserver:14145 File Share \\filestore1\clone\ Dev-wks01 Dev-wks02 Dev-wks03
Demo
Learn More • https://documentation.red-gate.com/ • Cmdlet reference • Worked examples • https://forums.red-gate.com/
What can SQL Clone do for you? Give your team their own local production-like database in seconds using a fraction of the disk space. Allow developers to work in isolated environments without overwriting each others’ changes. Test against realistic data and server settings to identify issues before they reach production. Automate provisioning for testing on realistic data and scenarios. Create clones during application debug to test code against realistic data. Reduce time to analysis and fix issues in production faster. sqlclonefeedback@red-gate.com
Competition
Why are clones so small? The technology behind SQL Clone Chris Hurley
Why are clones so small? 200GB 0GB 100MB 0MB
Why are clones so small? 200GB 0GB 100MB 0MB Data Virtualization
Data Virtualization .mdf df and .ldf 200GB 0GB Production 200GB 0GB 600GB 0GB QA 200GB 0GB Development
Data Virtualization 200GB 0GB Production 200GB 0GB 600GB 0GB QA 200GB 0GB Development
Data Virtualization 200GB 0GB Image 10GB GB 210GB 0GB QA 0GB Development
Accessing data on clones Image Dev SELECT ([Name]) FROM [Customers]
Accessing data on clones Image Dev INSERT INTO [Customers] ([Name]) VALUES(N'Dave')
Accessing data on clones Image Dev SELECT ([Name]) FROM [Customers]
Built on Microsoft technologies • Windows Virtual Disk Service • Windows Shadow Copy Service • SQL Server backup, restore, and attach
Making an image Windows Image ge VHD Virtua ual l Hard Disk Servi vice ce
Making an image from a database MDF LDF MDF LDF MDF LDF Windows Shadow Copy Servi vice ce
Making an image from a database MDF LDF MDF LDF Image ge VHD
Making an image from a backup MDF LDF Backup up Image ge VHD SQL Serve ver instanc ance
Making a clone MDF LDF Image ge VHD \\fileser eserver ver\sha share re
Making a clone MDF LDF Image ge VHD Clone e VHD Windows \\fileser eserver ver\sha share re Virtua ual l Hard Disk Servi vice ce
Making a clone MDF LDF Image ge VHD Clone e VHD Windows \\fileser eserver ver\sha share re Virtua ual l Hard Disk Servi vice ce
Making more clones Clone e VHD MDF LDF Image ge VHD \\fileser eserver ver\sha share re Clone e VHD
Things to remember Unchanged data is always read from the image • Changing the database will make changes to the clone’s local • data files The image is never modified – every clone is isolated and is • safe to delete and reset
Summary Data virtualization is used to make clones so small • SQL Server sees the clone database as being on a local disk, but only • changes are stored locally This is powered by the Windows Virtual Hard Disk service and either the • Shadow Copy Service or SQL Server backup restore sqlclonefeedback@red-gate.com
Recommend
More recommend