Download presentation
Presentation is loading. Please wait.
1
SQLIntersection May 24rd, 2017
4/21/2018 7:46 PM SQLIntersection May 24rd, 2017 Disney World Swan Resort, Orlando, Florida © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
2
SQL Server Hybrid What Every SQL Professional Should Know
4/21/2018 7:46 PM slideshare.net SQL Server Hybrid What Every SQL Professional Should Know Bob Ward Principal Architect Microsoft Data Group, Tiger Team @bobwardms #bobsql © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
3
Consistent data platform across on-premises and cloud
Least vulnerable and proven data platform across all environments Develop once and deploy anywhere Common tools for development and management Common T-SQL surface area Simple cloud migration Single vendor for support PaaS Azure SQL Database Azure SQL Data Warehouse IaaS SQL Server (DW) in Azure VM SQL Server in Azure VM On-premises SQL Server SQL Server (DW) Reference Architecture
4
What is SQL Server Hybrid?
4/21/2018 7:46 PM What is SQL Server Hybrid? Features or components of SQL Server that integrate with a Microsoft Azure Cloud Service © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
5
The SQL Server Hybrid Landscape
4/21/2018 7:46 PM The SQL Server Hybrid Landscape SQL Server Backup to URL SQL Server Stretch Database Extend on-premises Always On Availability to Azure SQL Server Data Files in Microsoft Azure Always Encrypted and Azure Key Vault External Tables and Azure Blob Storage (Polybase) © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
6
SQL Server Backup to URL Create your own offsite DR strategy
4/21/2018 7:46 PM SQL Server Backup to URL Create your own offsite DR strategy © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
7
Back up SQL Server to Azure as a DPM workload
Just do It! Use SSMS These five simple steps 1. Create an Azure Storage Account (easy in the portal) 2. Create a container for the backup files (easy in the portal) 3. Setup credentials to access the storage account or container 4. Obtain the URL (easy in the portal) 5. Backup the database to the URL using T-SQL Example syntax BACKUP DATABASE [adventurework2016ctp3] TO URL = N' 739.bak' WITH NOFORMAT, NOINIT, NAME = N'adventurework2016ctp3-Full Database Backup', NOSKIP, NOREWIND, NOUNLOAD, STATS = 10 Back up SQL Server to Azure as a DPM workload © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
8
Backup to URL Best Practices
4/21/2018 7:46 PM Backup to URL Best Practices Use WITH COMPRESSION If speed matters, pick a close Azure region BACKUP Options and striping needed for VLDB. See blog post Watch out for throttling in Azure VM. See blog post © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
9
Other Considerations RESTORE using URL (requires CREDENTIAL)
4/21/2018 7:46 PM Other Considerations RESTORE using URL (requires CREDENTIAL) Restore like any other backup Troubleshooting guidance can be found here Trace Flag 3051 can provide additional diagnostics © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
10
SQL Server Managed Backups
4/21/2018 7:46 PM SQL Server Managed Backups Automate your database and log backups to Azure T-SQL stored procedure interface Configure for instance or per database Basic Mode Storage location and retention time and your done Advanced Options Configuration encryption Set your own customized schedule Look at David Browne’s blog post © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
11
4/21/2018 7:46 PM How does this work? SQL Agent “smartadmin” subsystem and jobs via T-SQL procedures Full database backup executed if.. First time Tlog has grown 1Gb since last full 1 week has gone by since last full backup Log chain broken Tlog backup executed if… First time after full executes Transaction log spaced used is 5Mb or greater 2 hours since last log backup Log backups lagging behind full db backup BACKUP options used COMPRESSION ENCRYPTION (if you configure) © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
12
Demo Using Azure as an offsite backup strategy
4/21/2018 7:46 PM Demo Using Azure as an offsite backup strategy Managed Backups to automate © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
13
SQL Server Stretch Database A new way for managing cold data
4/21/2018 7:46 PM SQL Server Stretch Database A new way for managing cold data © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
14
4/21/2018 7:46 PM What is Stretch? SQL Stretch Database is a hybrid solution for securely migrating cold data to Azure, with remote query processing abilities Cost effective online cold data Reduced local storage and maintenance costs Entire table always online and accessible No application changes Supports Always Encrypted and Row- Level Security Compute and Storage Priced Separately Stretch gives you the ability to selectively, securely and transparently migrate cold or historical data from your existing storage solution, to the Azure. It allows you to free up disk space and reduce your enterprise storage costs, without impacting your existing business operations and applications. It allows you to take on that journey to the cloud on your terms. © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
15
How does Stretch work? Creates a secure connection between the Source SQL Server and Azure Provisions remote instance and begins migration Apps and Queries continue to run for both the local database and remote endpoint Security controls and maintenance remain local Available in all versions of SQL Server 2016 SQL Stretch Database 2016 Cold Data Hot data Cold data On-premises network Azure PaaS Trickle migration Users continue to access data thru local instance Let me show you how it works Talk about steps for enabling and trickle start Remember! It happens transparently and in the background, it doesn't interfere with your operations. We do this while you're online, your queries are not affected and your users are not aware of it. Are there other solutions? Sure, but Stretch takes the thinking our of it. Stretch doe not require that you update your apps, does not require additional expertise.
16
Preparing sp_configure 'remote data archive', ’1’
4/21/2018 7:46 PM Preparing sp_configure 'remote data archive', ’1’ Done by SSMS wizard if not already set Need help to decide? Database Migration Assistant (DMA) You need an Azure Subscription Pick an Azure Region closest to you. Uses sys.dm_db_index_operational_stats and a min of rows (configuration) TODO: What is trace flag 4631? © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
17
Entire table or filter rows
4/21/2018 7:46 PM Initial Migration I recommend this Use the SSMS Stretch Wizard The “Manual” Way Enable for database Create a database master key Create a CREDENTIAL ALTER DATABASE <db> SET REMOTE_DATA_ARCHIVE = ON Create an Azure SQL Stretch Database Server Azure firewall configuration Enable for a table(s) CREATE <table> … WITH ( REMOTE_DATA_ARCHIVE = ON …) ALTER TABLE <table> … SET ( REMOTE_DATA_ARCHIVE=ON…) Entire table or filter rows Migrate started © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
18
What about the Azure side?
4/21/2018 7:46 PM What about the Azure side? New resource of SQL Server Stretch Database type Storage is charged at a fixed per Gb rate per month Inbound data free/Outbound data charged per Gb/month What is a Database Stretch Unit (DSU)? Performance and pricing Higher = more compute resources = higher price Can scale up and down to match query needs Basic 100 DSU is $2.50/hr up to 2000 DSU which is $50/hr. Max database is 240TB $0.16/Gb/month Outbound data transfer rate First 5 GB /Month Free 5 GB - 10 TB 2 /Month $0.087 per GB © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
19
Demo Stretch your Cold Data 4/21/2018 7:46 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
20
Now What? Just Query your Data No joins required
4/21/2018 7:46 PM Now What? Only access data in Azure if it is migrated and query criteria requires it Just Query your Data No joins required Data accessed where it lives REMOTE_DATA_ARCHIVE_OVERRIDE hint New or updated data matching criteria gets migrated Pausing and resuming data migration at any time TODO: How do we detect data meets criteria to migrate or not? © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
21
Monitoring and Insights
4/21/2018 7:46 PM Monitoring and Insights SSMS Monitoring Metadata sys.remote_data_archive_databases sys.external_data_sources sys.remote_data_archive_tables sys.databases and sys.tables new sp_spaceused options DMV sys.dm_db_rda_migration_status sys.dm_db_rda_schema_update_status Extended Events stretch_* (54 events) © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
22
Behind the Scenes PREEMPTIVE_COM_QUERYINTERFACE task to migrate
4/21/2018 7:46 PM Behind the Scenes PREEMPTIVE_COM_QUERYINTERFACE task to migrate External ExternalResource=MSQL_DQ Remote Query Operator for queries Rows are migrated in max batches of 9999 rows © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
23
Demo Query and Get Insights to your Stretched Data 4/21/2018 7:46 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
24
Maintenance BACKUP RESTORE ALTER table – Don’t change schema
4/21/2018 7:46 PM Maintenance BACKUP SQL Server will create a shallow backup (only local data backed up) Azure provides automatic backups (and geo-dr) for remote data SQL Server retains staging table data RESTORE Restore and “reauthorize” (reconnect remote) Restore point in time in Azure ALTER table – Don’t change schema DROP table – This can orphan the remote data so disable first instead Disabling Bring data back local Abandon remote data © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
25
Compatibility and Limitations
4/21/2018 7:46 PM Compatibility and Limitations Works with… Availability Groups Always Encrypted TDE Temporal Tables (history table) Limits You can’t update or delete remote rows memory-optimized tables are not eligible “Parent” tables in fkey relationships are not eligible Complete list documented here Override exists © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
26
Interesting Scenarios
4/21/2018 7:46 PM Interesting Scenarios How to stretch a sliding window Requires a new filter function for “window” ALTER TABLE to apply new filter Stretch your temporal history table Stretch entire history table Stretch based on filter Use above sliding window technique © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
27
SQL Server Hybrid – Cloud on your terms
4/21/2018 7:46 PM SQL Server Hybrid – Cloud on your terms Backup to URL to create an offsite DR strategy Managed backups to automate your offsite DR strategy Identify cold data - stretch to SQL Server Stretch Database Save on storage costs Transparently access your data Reduce operational tasks such as backups © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
28
References SQL Server Backup to URL docs
4/21/2018 7:46 PM References SQL Server Backup to URL docs SQL Server Managed Backup docs Guidance from SQL CAT on Backup to URL SQL Server Stretch Database docs SQL Server Stretch Database blog posts Here what the community says about Stretch slideshare.net © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
29
4/21/2018 7:46 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.