Share
Embed
Mythbusting Azure SQL
Slidedeck of the Azure SQL Talk at Microsoft Techsummit 2016
Marcus Ross
December 08, 2016
Transcript
48 slides
-
Warum diese Session? Marie von Ebner-Eschenbach (1813-1916) „Wer nichts weiß,
muss alles glauben.“ -
Mythbusting...? • Es gibt viele Gerüchte zu Azure SQL •
Hier meine Erfahrungen aus Consulting / Training – kein Marketing! -
• Nein! • DaaS (PaaS) - Lösung • quasi Zero-Administration
• eignet sich für WebApps • Ideal für 12Factor-Apps Der Microsoft Blick an SQL-Optionen -
Nachteile • nur TCP/IP Verbindungen • keine dynamischen Ports (1433)
• keine Windows-Auth. (Azure-AD) • kein SQL-Server Agent • nur teilw. T-SQL kompatibel • SQL_Latin1_General_CP1_CI_AS • Pay-per-Hour Azure SQL (DaaS) Vorteile • wenig Administration • keine Wartung (OS,SQL) • HA built-in • keine Backups notwendig • Point-in-Time Recovery • Geo-Replication • Elastic Datapools -
Nachteile • komplette Administration • selber Patchen (OS / SQL)
• eigene Backup-Strategie • Performance kostet extra (SSD -> P10, P20, P30) SQL Server auf Azure als VM (IaaS) Vorteile • Pay-per-use (pro Minute) oder vorh. Lizenzen • voll Anpassbar • kompletter SQL Server -
• Nein! • DaaS (PaaS) - Lösung • quasi Zero-Administration
• eignet sich für WebApps • Ideal für 12Factor-Apps Azure SQL ist ein SQL Server in der Cloud -
• Nein, es wurde nur umbenannt! • Azure SQL Database
• Windows Azure SQL Database • SQL Server Data Services • Microsoft Azure SQL Database • SQL Azure • SQL Services Viele SQL-Dienste gibt es nicht mehr! https://azure.microsoft.com/en-us/blog/sql-data-services- announces-plans-to-accelerate-core-relational-database-features/ https://www.flickr.com/photos/foto_db/ -
• Clients habe einen Standardtimeout • Standard ist 15 Sekunden
• Hochsetzen auf 30 Sekunden wirkt Wunder! Es geht natürlich, aber... (ProTip) -
• Ja! – aber es ist OK • Kein Windows
Authentication (Azure AD ist supported) • TCP/IP nur auf Port 1433 • Keine SQL Server Agent Jobs • Fixed Collation (SQL_Latin1_General_CP1_CI_AS) • Restricted usernames (admin, administrator, guest, root, sa, ‘\’) Mit Azure SQL gibt es Einschränkungen https://azure.microsoft.com/en-us/documentation/articles/sql-database-general-limitations/ -
• Basic – 2 Gb • Standard - 250 Gb.
• Premium – 1 Tb Es gibt DB-Size Limits -
Features die nicht unterstützt sind • Connection related: Endpoint statements,
ORIGINAL_DB_NAME. Windows authentication is not available for logins or contained database users. • Cross database queries using three or four part names. (Read-only cross-database queries are supported by using elastic database query.) • Cross database ownership chaining, TRUSTWORTHY setting • Data Collector • Database Diagrams • Database Mail • DATABASEPROPERTY (use DATABASEPROPERTYEX instead) • EXECUTE AS logins • Encryption: extensible key management • Eventing: events, event notifications, query notifications • Features related to database file placement, size, and database files which are automatically managed by Microsoft Azure. • Features that relate to high availability which is managed through your Microsoft Azure account: backup, restore, AlwaysOn, database mirroring, log shipping, recovery modes. • Features that rely upon the log reader running on SQL Database: Push Replication, Change Data Capture. • Features that rely upon the SQL Server Agent or the MSDB database: jobs, alerts, operators, Policy-Based Management, database mail, central management servers. • FILESTREAM • Functions: fn_get_sql, fn_virtualfilestats, fn_virtualservernodes • Global temporary tables • Hardware related server settings: memory, worker threads, CPU affinity, trace flags, etc. Use service levels instead. • HAS_DBACCESS • KILL STATS JOB • Linked servers, OPENQUERY, OPENROWSET, OPENDATASOURCE, BULK INSERT, 3 and 4 part names • Master/target servers • .NET Framework CLR integration with SQL Server • Resource governor • Semantic search • Server credentials • Sever-level items: Server roles, IS_SRVROLEMEMBER, sys.login_token. Server level permissions are not available though some are replaced by database- level permissions. Some server-level DMV's are not available though some are replaced by database- level DMVs. • Serverless express: localdb, user instances • Service broker • SET REMOTE_PROC_TRANSACTIONS • SHUTDOWN • sp_addmessagesp_configure options and RECONFIGURE • sp_helpuser • sp_migrate_user_to_contained • SQL Server audit (use SQL Database auditing instead) • SQL Server Profiler • SQL Server trace • Trace flags • Transact-SQL debugging • Triggers: Server-scoped or logon triggers • USE statement: To change the database context to a different database you must make a new connection to the new database. -
• Nein! • Backup ist „automagic“ • Self-Service Restore •
Automation ist aber möglich Kein SQL-Agent, kein Backup! -
• Log-Backup – alle 5 Minuten • Full-Backup – wöchentlich
• Diff-Backup – stündlich • Zeitplan für Full/Diff wird nach dem Systemworkload erstellt So funktioniert das Backup bei Azure SQL -
• Tarif „Basic“: 7 Tage • Tarif „Standard“: 35 Tage
• Tarif „Premium“: 35 Tage • Long-Term Backup Retention Azure Recovery Services vault für bis zu 10 Jahre Retention-Time bei Azure SQL Backup -
• Nein! – es geht, aber warum? • DMVs •
Database Advisor • Query Performance Insight • Query Store Ich kann Azure SQL nicht „optimieren“ -
• Überwachen von Datenbanken mithilfe von DMVs • sys.resource_stats (logischen
master-DB) • sys.dm_db_resource_stats (Benutzerdatenbank) Selber Optimieren - DMV Hinweis: sys.dm_db_resource_stats in Web/Business Edition-Datenbanken ein leeres Resultset -
Selber Optimieren- Query Performance Insight • Achtung das Tool benötigt
den Query Store als Grundlage -
• Der SQL Query Store (SQL 2016) gibt es auch
in Azure • Quasi ein sys.dm_exec_query_stats aber auch nach Reboots! Selber Optimieren - Query Store Best Practice unter: https://msdn.microsoft.com/en-us/library/mt604821.aspx -
• Genau, weil kein Adminaufwand • Mappen Sie alles auf
die Primary • oder lassen Sie es migrieren... • Die Storage Engine verteilt es selber, die Partitionen können weiter genutzt werden. Es gibt keine Filegroups mehr https://docs.microsoft.com/en-us/azure/sql-database/sql-database-transact-sql-information -
• Nein! • Das Feature steht für den Tarif Premium
zur Verfügung • kein „Standard“ oder „Basic“ L Es gibt kein In-Memory OLTP mehr https://msdn.microsoft.com/de-de/library/dn133186.aspx -
• Jaein! • Always-Encrypted Feature ist GA • nicht per
default „an“ • Verschlüsselung End-to-End • Aber der Treiber muss es können (NET ok / ODBC, JDBC bald) Azure SQL ist per Default verschlüsselt -
• Nein! • SQL-Logins und Azure-AD • Bitte keine Secrets
im ConnectionString! • besser ClientId + Certificate! • möglichkeit Azure Key-Vault Azure SQL Zugriff ist unsicher -
• auch im deutschen Azure • PowerShell • Dot.Net •
REST • Java Azure Key Vault https://docs.microsoft.com/de-de/azure/key-vault/key-vault-use-from-web-application -
• Nein! • SSMS Migration Wizard • SQL Azure Migration
wizard • viele Tools (SqlPackage.exe) • Free ebook: Microsoft Azure Essentials Migrating SQL Server Databases to Azure Von On-Premise migrieren ist schwierig -
• Integriert ins SSMS • offizieller Microsoft Weg • Wizard-geführt
• inkompatibilitäten erst am Ende SSMS Migration Wizard -
• Codeplex Projekt (sqlazuremw.codeplex.com) • Erstellt T-SQL Script der inkompatiblen
Teile • Transformiert soweit möglich • Migration in 2 Teilen • Schema • Daten SQL Azure Migration wizard -
• Exportiert eine Livedatenbank • Datenbankschemas • Benutzerdaten • Importiert
in eine Instanz • Aktualisiert auch inkrementell • Erstellt XML-Bericht von Änderungen SqlPackage.exe https://msdn.microsoft.com/de-de/library/hh550080(v=vs.103).aspx -
Darum diese Session! „Wer nichts weiß, muss alles glauben.“ Marie
von Ebner-Eschenbach (1813-1916) -
Zusammenfassung • Azure SQL kann schnell bereit gestellt werden •
Azure SQL ist für die meisten Anwendungen ok • Azure SQL ist transparent zu Programmieren • Azure SQL braucht keine Administration