Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
CHAPTER
A to Z for
SQL Azure Databases
Athens, GreeceAntonios Chatzipavlis
SQLschool.gr Founder, Principal Consultant
SQL ...
I have been started with computers.
I started my professional carrier in computers industry.
I have been started to work w...
Antonios
Chatzipavlis
Vasilis
Ioannidis
Fivi
Panopoulou
Sotiris
Karras
TEAM
My day
… and more than 3500 databases
Follow us in social media
Twitter @antoniosch / @sqlschool
Facebook fb/sqlschoolgr
YouTube yt/user/achatzipavlis
LinkedIn ...
help@sqlschool.gr
• Getting started with Microsoft SQL Azure Database
• Configuration and pricing
• Using Azure portal, SSMS and PowerShell ...
CHAPTER
Getting started with
Microsoft SQL Azure Database
• Infrastructure as a Service ( IaaS)
• Platform as a Service (PaaS)
• Software as a Service (SaaS)
The Microsoft Azure cl...
• Creating a Microsoft account
• http://signup.live.com
• Creating a Microsoft Azure subscription
• http://www.windowsazur...
DEMO
CHAPTER
Creating SQL Azure
database
CHAPTER
Configuration and pricing
• An instance of SQL Server can host multiple databases.
• Create an administrator account user name with a strong passwor...
• Quick Create
• This is a 1-GB Web Edition SQL Database with the default collation.
• Custom Create
• You have control ov...
It is important to understand that the IP address that needs to be
specified is not your IP address on your local network,...
• SQL storage
• Client bandwidth
• Backup storage bandwidth
• Optimizing your costs
Budgeting for SQL Database
• SQL storage
• Client bandwidth
• Backup storage bandwidth
• Optimizing your costs
Budgeting for SQL Database
The biggest...
• SQL storage
• Client bandwidth
• Backup storage bandwidth
• Optimizing your costs
Budgeting for SQL Database
• If you co...
• SQL storage
• Client bandwidth
• Backup storage bandwidth
• Optimizing your costs
Budgeting for SQL Database
• If you ha...
• SQL storage
• Client bandwidth
• Backup storage bandwidth
• Optimizing your costs
Budgeting for SQL Database
• Don’tstor...
CHAPTER
Using Azure portal, SSMS
and
PowerShell with SQL Azure Databases
DEMO
CHAPTER
Using Azure
Management Portal
DEMO
CHAPTER
Using SSMS
• Installing the Microsoft Azure PowerShell cmdlets
• http://azure.microsoft.com/en-us/downloads/
Using PowerShell
DEMO
CHAPTER
Using PowerShell
CHAPTER
Differences between SQL Server
and
Microsoft Azure SQL Database
• Agent Service
• Audit
• Backup / Restore
• Browser Service
• Change Data Capture (CDC)
• Common Language Runtime (CLR)
•...
• Allows connections only over TCP/IP.
• Does not support Windows authentication.
• Often requires that @<server> is appen...
CHAPTER
Migrating databases
on
SQL Azure databases
DEMO
CHAPTER
Migrating data using
Transact-SQL scripts
DEMO
CHAPTER
Importing a BACPAC to
Microsoft Azure SQL
Database
CHAPTER
Securing SQL Azure Database
• SQL Database Firewall restricts access to SQL Database based on
the origin IP address of the connection.
• SQL Database ...
• Windows Authentication is not supported
• CREATE LOGIN <name> WITH PASSWORD='<Password>‘
• Server-level permissions
• lo...
CHAPTER
Backup and Restore SQL Azure databases
• BACPAC files do not provide transactional consistency
• BACPAC is by copying tables individually, and modifications coul...
SELECT name, state_desc FROM sys.databases
WHERE name = <‘dbname‘>
You can obtain additional details about the copy operat...
Exporting a BACPAC
Exporting a BACPAC
Scheduling BACPAC exports
CHAPTER
Designing and tuning for scalability
and high performance
• Opening late, closing early
• Pooling connections
• Recovering from connection faults
Managing SQL Database connections
• Encapsulate complex data access in stored procedures
• Batch using table-valued parameters
• Use client-side storage and...
CHAPTER
Monitoring and management
DEMO
CHAPTER
Monitoring using the
management portal
Dynamic management views and functions
CHAPTER
V12 new features
• Users in Contained databases
• Table partitioning
• Larger transactions
• Online index build and rebuild
• Checkpoint su...
Thank you
SELECT
KNOWLEDGE
FROM
SQL SERVER
http://www.sqlschool.gr
Copyright © 2015 SQL School Greece
Upcoming SlideShare
Loading in …5
×

A to z for sql azure databases

1,078 views

Published on

A to z for sql azure databases - Global Azure Bootcamp

Published in: Technology
  • Login to see the comments

A to z for sql azure databases

  1. 1. CHAPTER A to Z for SQL Azure Databases Athens, GreeceAntonios Chatzipavlis SQLschool.gr Founder, Principal Consultant SQL Server Evangelist, MVP on SQL Server Apr 25, 2015
  2. 2. I have been started with computers. I started my professional carrier in computers industry. I have been started to work with SQL Server version 6.0 I earned my first certification at Microsoft as Microsoft Certified Solution Developer (3rd in Greece) and started my carrier as Microsoft Certified Trainer (MCT) with more than 20.000 hours of training until now! I became for first time Microsoft MVP on SQL Server I created the SQL School Greece (www.sqlschool.gr) I became MCT Regional Lead by Microsoft Learning Program. I was certified as MCSE : Data Platform, MCSE: Business Intelligence Antonios Chatzipavlis Database Architect SQL Server Evangelist MCT, MCSE, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS, MCAD, MCP, OCA, ITIL-F 1982 1988 1996 1998 2010 2012 2013 CHAPTER
  3. 3. Antonios Chatzipavlis Vasilis Ioannidis Fivi Panopoulou Sotiris Karras TEAM
  4. 4. My day … and more than 3500 databases
  5. 5. Follow us in social media Twitter @antoniosch / @sqlschool Facebook fb/sqlschoolgr YouTube yt/user/achatzipavlis LinkedIn SQL School Greece group Pinterest pi/SQLschool/
  6. 6. help@sqlschool.gr
  7. 7. • Getting started with Microsoft SQL Azure Database • Configuration and pricing • Using Azure portal, SSMS and PowerShell with SQL Azure Databases • Differences between SQL Server and Microsoft Azure SQL Database • Migrating databases on SQL Azure databases • Securing SQL Azure Database • Backup and Restore SQL Azure databases • Designing and tuning for scalability and high performance • Monitoring and management • V12 new features Agenda
  8. 8. CHAPTER Getting started with Microsoft SQL Azure Database
  9. 9. • Infrastructure as a Service ( IaaS) • Platform as a Service (PaaS) • Software as a Service (SaaS) The Microsoft Azure cloud
  10. 10. • Creating a Microsoft account • http://signup.live.com • Creating a Microsoft Azure subscription • http://www.windowsazure.com. Getting signed up for SQL Database
  11. 11. DEMO CHAPTER Creating SQL Azure database
  12. 12. CHAPTER Configuration and pricing
  13. 13. • An instance of SQL Server can host multiple databases. • Create an administrator account user name with a strong password • Specify the geographical region where the server should be located physically. • To achieve the best performance, you should choose the region closest to your consumers. • Be sure that any Microsoft Azure cloud Web sites and services are hosted in the same region as the SQL Database servers they communicate with. • By locating both in the same region, you will avoid the bandwidth-based fee that gets incurred when your cloud sites, services, and databases communicate across different Azure regions. • You will also reduce latency, which results in significantly better performance. Creating a server
  14. 14. • Quick Create • This is a 1-GB Web Edition SQL Database with the default collation. • Custom Create • You have control over the options edition, size, and collation. • Import • Import an existing database from a BACPAC file. • A BACPAC file is, essentially, a backup of an entire database (schema and data), stored as a binary large object (BLOB). Creating a database
  15. 15. It is important to understand that the IP address that needs to be specified is not your IP address on your local network, but the IP address that the Microsoft Azure datacenter sees when you attempt to access something. Setting firewall rules
  16. 16. • SQL storage • Client bandwidth • Backup storage bandwidth • Optimizing your costs Budgeting for SQL Database
  17. 17. • SQL storage • Client bandwidth • Backup storage bandwidth • Optimizing your costs Budgeting for SQL Database The biggest cost of using SQL Database is for the actual disk space required for storage in Microsoft Azure If you already have an on-premises SQL Server database and would like to calculate the size of the database for estimating the migration cost to SQL Database, SELECT (SUM(reserved_page_count) * 8192) / 1024 / 1024 AS database_size_MB FROM sys.dm_db_partition_stats
  18. 18. • SQL storage • Client bandwidth • Backup storage bandwidth • Optimizing your costs Budgeting for SQL Database • If you connect to your SQL database from within the same datacenter, you do not incur any bandwidth charges for the data flowing either in to or out of the database. • If you connect to the database from outside the datacenter, your database incurs only “egress” charges for bandwidth usage, which means that data flowing out of the database to clients is charged, while “ingress” flows (data coming into the database) are free. • The charges are also different in different areas of the world. • Client bandwidth pricing is based on the location of the Microsoft Azure datacenter, regardless of where the client accessing the database is located.
  19. 19. • SQL storage • Client bandwidth • Backup storage bandwidth • Optimizing your costs Budgeting for SQL Database • If you have a 100-MB database and you have backups taken every day, your bandwidth charges are as follows 0.1 GB X $0.12/GB X 30 days = $0.36/month • If you choose to take backups each hour, your bandwidth charges would be as follows 0.1 GB X $0.12/GB X 24 hours/day X 30 days = $8.64/month • If you choose to run those backups within the same datacenter, the bandwidth is free.
  20. 20. • SQL storage • Client bandwidth • Backup storage bandwidth • Optimizing your costs Budgeting for SQL Database • Don’tstoreBLOBs in thedatabase. • Cycle outold recordsand tables in yourdatabase. • Place yourSQL Databasein the samedatacenter as your websites,mobile services,and otherAzurecomponentsthat will be clients of the database. • Use a strategyfor removingold backups suchthat you maintainhistorybut reduce storageneeds. • Insteadof usinga remotestorageaccountfor yourbackups, usegeo-replicated storageto keep fromincurringbandwidth charges. • If youintendto usea substantialamountof Azureresources for yourapplication,you can chooseto use a volume purchaseplan.
  21. 21. CHAPTER Using Azure portal, SSMS and PowerShell with SQL Azure Databases
  22. 22. DEMO CHAPTER Using Azure Management Portal
  23. 23. DEMO CHAPTER Using SSMS
  24. 24. • Installing the Microsoft Azure PowerShell cmdlets • http://azure.microsoft.com/en-us/downloads/ Using PowerShell
  25. 25. DEMO CHAPTER Using PowerShell
  26. 26. CHAPTER Differences between SQL Server and Microsoft Azure SQL Database
  27. 27. • Agent Service • Audit • Backup / Restore • Browser Service • Change Data Capture (CDC) • Common Language Runtime (CLR) • Compression • Database Object naming convention • Extended events • Extended stored procedures • File streaming (FILESTREAM) Unsupported features before V12 release • Full-Text Searching (FTS) • Mirroring • Partitioning • Replication • Resource Governor • Service Broker • System stored procedures • Tables without a clustered index • Transparent Data Encryption (TDE) • USE statement • XSD and XML indexing
  28. 28. • Allows connections only over TCP/IP. • Does not support Windows authentication. • Often requires that @<server> is appended to the login user name in connection strings. • Communicates only through port 1433 • Does not support static or dynamic port allocation like SQL Server does. • Fully support of Multiple Active Result Sets (MARS) • SQL Database connections can drop unexpectedly, and you need to account for this condition in your applications. • The latest version of the Entity Framework (EF6, Microsoft’s recommended data access API for .NET) has a new Connection Resiliency feature, which automatically handles the retry logic for dropped connections. • The Microsoft Enterprise Library Transient Fault Handling Application Block, lets you define and implement retry strategies to deal with dropped connections. • The ADO.NET SqlConnection class has an OpenWithRetry extension method that handles the retry logic based on the default retry policy SQL Database Connection limitations
  29. 29. CHAPTER Migrating databases on SQL Azure databases
  30. 30. DEMO CHAPTER Migrating data using Transact-SQL scripts
  31. 31. DEMO CHAPTER Importing a BACPAC to Microsoft Azure SQL Database
  32. 32. CHAPTER Securing SQL Azure Database
  33. 33. • SQL Database Firewall restricts access to SQL Database based on the origin IP address of the connection. • SQL Database Firewall rules allow connections to be made to a SQL Database server, they do not authorize access to objects within the SQL Database instance. • You can configure database-level firewall rules using the sp_set_database_firewall_rule stored procedure found in each database. • SQL Database server-based firewall rules are defined for an entire SQL Database server, they are stored in the master database Configuring SQL Database Firewall
  34. 34. • Windows Authentication is not supported • CREATE LOGIN <name> WITH PASSWORD='<Password>‘ • Server-level permissions • loginmanager • This role has prermissions to create logins in the SQL Database server • Similar to the securityadmin role in SQL Server • dbmanager • This role has permissions to create databases in a SQL Database server. • Similar to dbcreator role in SQL Server • CREATE USER <name> FROM LOGIN <login_name> • EXEC sp_addrolemember 'loginmanager', <‘user_name’>' • EXEC sp_addrolemember 'dbmanager', <‘user_name’> Authenticating and authorizing users
  35. 35. CHAPTER Backup and Restore SQL Azure databases
  36. 36. • BACPAC files do not provide transactional consistency • BACPAC is by copying tables individually, and modifications could occur between the time that the first table and last table are copied • The Database Copy feature creates a new database from an existing SQL Database that is transactionally consistent when the copy finishes. • It does this by replicating any changes that are made to the source database while the database is copying at the end of the process. • Database copies can be created either on the same SQL Database server or on a different server within the same region. CREATE DATABASE <dbname> AS COPY OF <server>.<dbname_copy> Copying a database
  37. 37. SELECT name, state_desc FROM sys.databases WHERE name = <‘dbname‘> You can obtain additional details about the copy operation SELECT * FROM sys.dm_database_copies AS c INNER JOIN sys.databases AS d ON c.database_id = d.database_id WHERE d.name = <‘dbname‘> Monitoring the progress of a database copy operation
  38. 38. Exporting a BACPAC
  39. 39. Exporting a BACPAC
  40. 40. Scheduling BACPAC exports
  41. 41. CHAPTER Designing and tuning for scalability and high performance
  42. 42. • Opening late, closing early • Pooling connections • Recovering from connection faults Managing SQL Database connections
  43. 43. • Encapsulate complex data access in stored procedures • Batch using table-valued parameters • Use client-side storage and caching • Avoid retrieving metadata at runtime Minimizing round trips
  44. 44. CHAPTER Monitoring and management
  45. 45. DEMO CHAPTER Monitoring using the management portal
  46. 46. Dynamic management views and functions
  47. 47. CHAPTER V12 new features
  48. 48. • Users in Contained databases • Table partitioning • Larger transactions • Online index build and rebuild • Checkpoint support • ALTER TABLE enhancements • TRUNCATE TABLE enhancements • More DBCC commands • Dynamic data masking preview • Row-level security (RLS) preview • V12 New Features • Window functions in Transact-SQL queries • .NET CLR integration • Change tracking for data • Table as a heap • Application roles • Several DMVs are added in V12 • Parallel processing for queries • Briefer I/O latency • Increased IOPS • Log rate http://azure.microsoft.com/en-us/documentation/articles/sql-database-preview-whats-new/
  49. 49. Thank you
  50. 50. SELECT KNOWLEDGE FROM SQL SERVER http://www.sqlschool.gr Copyright © 2015 SQL School Greece

×