SlideShare uma empresa Scribd logo
1 de 31
Top 5 Things to Know @SQL Azure By Ike Ellis http://www.ellisteam.net http://www.develop.com http://ellisteam.blogspot.com @ellisteam1
Dragon #1: The ConnectionString
Quick Demo: How to Sign Up Free Accounts BizSpark MSDN Subscription 30 day trial Bing SQL Azure 30 day trial….there are coupons and instructions. Look on the SQL Azure Team Blog Remember: Microsoft wants you to use this, there’s a way to try it for free…
Your SQL Server Your App Change Connection String SQL Azure
5 Things Make Up a Connection String What are they?
5 Things Make Up a Connection String What are they? UserName Password Database(Catalog) ServerName ProviderName
#1 ConnectionString <add name="FlashcardEntities" connectionString="metadata=res://*/Models.FlashcardData.csdl|res://*/Models.FlashcardData.ssdl|res://*/Models.FlashcardData.msl;provider=System.Data.SqlClient;provider connection string=&quot ;Data Source=etnejn2aev.database.windows.net;Initial Catalog=flashcards;Integrated Security=False;User ID=***(username@servername);Password=*******;MultipleActiveResultSets=True ;Encrypt=True(negotiated) ;TrustServerCertificate=False&quot;" providerName="System.Data.EntityClient" />
Connection Providers Use ADO.NET, ODBC, PHP (NOT OLE DB) Client libraries pre-installed in Azure roles Support for ASP.NET controls Clients connect directly to a database Cannot hop across DBs (no USE) May need to include <login>@<server> Use familiar tools (sqlcmd, osql, SSMS, etc) Use connection pooling for efficiency SSMS 2008 R2 can connect  http://blogs.msdn.com/ssds/archive/2009/11/11/9921041.aspx SSRS, SSIS, SSAS can all connect to SQL Azure using the right provider.
Typical ADO.NET Connection.Open()*Courtesy of BartR – Microsofthttp://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed:+Microsoft/MSDN-Blogs+(MSDN+Blogs) try
 {
     	using (SqlConnection conn = new SqlConnection(sqlConnectionString))
    {
         using (SqlCommandcmd = new SqlCommand(sqlStatement, conn))
       		 	{
             conn.Open(); using (SqlDataReaderdr=cmd.ExecuteReader())
             {
                 while (dr.Read())
                 {
                }
               }  catch (SqlException ex)
 {
   SxpLog.WriteSqlException(ex, "some", "other", "data");
 }
New Connection.Open()*Courtesy of BartR – Microsofthttp://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed:+Microsoft/MSDN-Blogs+(MSDN+Blogs) string sqlContext = string.empty; try
{
     using (SqlConnection conn = new SqlConnection(sqlConnectionString))
     {
         using (SqlCommandcmd = new SqlCommand(sqlStatement, conn))
       {
             sqlContext= GetSqlContextInfo(conn);             			using (SqlDataReaderdr=cmd.ExecuteReader())
            {
                 while (dr.Read())
                 {
                }
            }
              }  catch (SqlException ex)
 {
   SxpLog.WriteSqlException(ex, sqlContext, "some", "other", "data");
 }
GetSqlContextInfo http://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed:+Microsoft/MSDN-Blogs+(MSDN+Blogs)
Dragon #2: Some New Errors 40550 - Session has been terminated because it has acquired too many locks.  Try reading or modifying fewer rows in a single transaction. (Greater than 1,000,000 locks) 40551 - Session has been terminated because of excessive TempDBUsage(TempDB is only allowed to be 5GB in size) 40552 - Session used too much of the transaction log.  try modifying fewer rows in a single transaction. (Transaction consuming excessive log resources are terminated.  The max permitted log size for a single transaction is 1GB) 40544 - Database reached it's max size.  Switched to read-only 40553 - Session is terminated because of excessive memory usage.  (Where there is memory contention, sessions consuming greater than 16MB for more than 20 seconds are terminated in the descending order of time the resource has been held) 40549 - Session is terminated because of a long running transaction (SQL Azure kills all transactions after 24 hours.) 40501 The service is currently busy.  Retry the request after 10 seconds.  Code: %d  (SQL Azure might terminate the transactions and disconnect the sessions when the CPU utilization, input/output I/O latency, and the number of busy workers exceed thresholds.
Another Reason We Need Retry Code = Disaster Recovery/Database Replicas Multiple Physical Replicas Replica 1 Single Primary Single Logical Database Replica 2 DB Replica 3
Logical/Physical Databases/Servers
Dragon #3: Tooling SQL Azure Database Manager Silverlight Tool SSMS 2008 R2 Standard Tool
Dragon #4: Database Migration SSIS BCP SSMS – Generate Scripts DEMO:  SQL Azure Migration Wizard
Dragon #5: Performance Tuning Let’s get this out of the way – What we don’t have: no sql error log no sql profiler no pssdiag no bpa (best practices analyzer) no xevent no server side network capture no mps reports(microsoft product support reports) Only some DMVs
SQL Azure Performance Guide Missing Indexes or better indexes Use DMVs Use Query Plans 2) Covering indexes for the WHERE clause 3) Can sorting be done on the client? 4)  Minimize round trips 5) Limit records (paging) 6) Use Connection Pooling (open connection late, close them early) 7) Retry Logic (wait 10 seconds and then retry) 8)  Catch errors and understand that when azure throws an error, the tran rollback 9) Caching and batching - evaluate caching and batching to limit round-trips to the server 10) avoid latency - choose a data center nearest to your location 11) Trace connections - traced connections using context_info() to troubleshoot connectivity issues 12) CALL SUPPORT
What I Didn’t Cover, But You Might Want to Research Pricing Included/Excluded Features Product Roadmap SQL Azure Reporting Backup/Restore Options SQL Azure Data Sync SQL Azure Odata Future Differences Between Editions
Good Resources Inside SQL Azure – Kalen Delaney http://social.technet.microsoft.com/wiki/contents/articles/inside-sql-azure.aspx SQL Azure & Entity Framework – Julie Lerman http://msdn.microsoft.com/en-us/magazine/gg309181.aspx Doesn’t cover the retry issue. SQL Azure Team Blog & Twitter http://blogs.msdn.com/b/sqlazure/ Twitter: @sqlazure My Site http://www.ellisteam.net http://ellisteam.blogspot.com Twitter:  @EllisTeam1

Mais conteúdo relacionado

Mais procurados

Qtp connect to an oracle database database - database skill
Qtp connect to an oracle database   database - database skillQtp connect to an oracle database   database - database skill
Qtp connect to an oracle database database - database skill
siva1991
 

Mais procurados (20)

10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators
 
Row Level Security in databases advanced edition
Row Level Security in databases advanced editionRow Level Security in databases advanced edition
Row Level Security in databases advanced edition
 
Apache Solr for begginers
Apache Solr for begginersApache Solr for begginers
Apache Solr for begginers
 
Qtp connect to an oracle database database - database skill
Qtp connect to an oracle database   database - database skillQtp connect to an oracle database   database - database skill
Qtp connect to an oracle database database - database skill
 
How to think like the engine
How to think like the engineHow to think like the engine
How to think like the engine
 
Row level security in enterprise applications
Row level security in enterprise applicationsRow level security in enterprise applications
Row level security in enterprise applications
 
Mongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesMongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategies
 
P9 speed of-light faceted search via oracle in-memory option by alexander tok...
P9 speed of-light faceted search via oracle in-memory option by alexander tok...P9 speed of-light faceted search via oracle in-memory option by alexander tok...
P9 speed of-light faceted search via oracle in-memory option by alexander tok...
 
Asegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingAsegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File Downloading
 
Orms vs Micro-ORMs
Orms vs Micro-ORMsOrms vs Micro-ORMs
Orms vs Micro-ORMs
 
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
 
Time-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy QueriesTime-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy Queries
 
Oracle result cache highload 2017
Oracle result cache highload 2017Oracle result cache highload 2017
Oracle result cache highload 2017
 
Oracle12c installation 2015
Oracle12c installation 2015Oracle12c installation 2015
Oracle12c installation 2015
 
Oracle JSON internals advanced edition
Oracle JSON internals advanced editionOracle JSON internals advanced edition
Oracle JSON internals advanced edition
 
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
 
Building a near real time search engine & analytics for logs using solr
Building a near real time search engine & analytics for logs using solrBuilding a near real time search engine & analytics for logs using solr
Building a near real time search engine & analytics for logs using solr
 
Oracle Result Cache deep dive
Oracle Result Cache deep diveOracle Result Cache deep dive
Oracle Result Cache deep dive
 
Ashawr perf kscope
Ashawr perf kscopeAshawr perf kscope
Ashawr perf kscope
 
Persitance Data with sqlite
Persitance Data with sqlitePersitance Data with sqlite
Persitance Data with sqlite
 

Destaque (6)

iPad Development Slides #ilta12
iPad Development Slides #ilta12iPad Development Slides #ilta12
iPad Development Slides #ilta12
 
SQL Server Tips & Tricks
SQL Server Tips & TricksSQL Server Tips & Tricks
SQL Server Tips & Tricks
 
SQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & TricksSQL Pass Architecture SQL Tips & Tricks
SQL Pass Architecture SQL Tips & Tricks
 
Kedi story 2009 10
Kedi story 2009 10Kedi story 2009 10
Kedi story 2009 10
 
CGMA: Elevating the Finance Function
CGMA: Elevating the Finance FunctionCGMA: Elevating the Finance Function
CGMA: Elevating the Finance Function
 
Fake presentation
Fake presentationFake presentation
Fake presentation
 

Semelhante a Top 5 things to know about sql azure for developers

Semelhante a Top 5 things to know about sql azure for developers (20)

Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
 
Azure + DataStax Enterprise (DSE) Powers Office365 Per User Store
Azure + DataStax Enterprise (DSE) Powers Office365 Per User StoreAzure + DataStax Enterprise (DSE) Powers Office365 Per User Store
Azure + DataStax Enterprise (DSE) Powers Office365 Per User Store
 
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto EditionEnter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
 
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysql
 
Jump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on DatabricksJump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on Databricks
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and Delta
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuning
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and Histograms
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
 
Azure Data Factory presentation with links
Azure Data Factory presentation with linksAzure Data Factory presentation with links
Azure Data Factory presentation with links
 
NoSQL em Windows Azure Table Storage - Vitor Tomaz
NoSQL em Windows Azure Table Storage - Vitor TomazNoSQL em Windows Azure Table Storage - Vitor Tomaz
NoSQL em Windows Azure Table Storage - Vitor Tomaz
 
Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 

Mais de Ike Ellis

Mais de Ike Ellis (20)

Storytelling with Data with Power BI
Storytelling with Data with Power BIStorytelling with Data with Power BI
Storytelling with Data with Power BI
 
Storytelling with Data with Power BI.pptx
Storytelling with Data with Power BI.pptxStorytelling with Data with Power BI.pptx
Storytelling with Data with Power BI.pptx
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptx
 
Data Modeling on Azure for Analytics
Data Modeling on Azure for AnalyticsData Modeling on Azure for Analytics
Data Modeling on Azure for Analytics
 
Migrate a successful transactional database to azure
Migrate a successful transactional database to azureMigrate a successful transactional database to azure
Migrate a successful transactional database to azure
 
Data modeling trends for analytics
Data modeling trends for analyticsData modeling trends for analytics
Data modeling trends for analytics
 
Data modeling trends for Analytics
Data modeling trends for AnalyticsData modeling trends for Analytics
Data modeling trends for Analytics
 
Relational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsRelational data modeling trends for transactional applications
Relational data modeling trends for transactional applications
 
Power bi premium
Power bi premiumPower bi premium
Power bi premium
 
Move a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloudMove a successful onpremise oltp application to the cloud
Move a successful onpremise oltp application to the cloud
 
Azure Databricks is Easier Than You Think
Azure Databricks is Easier Than You ThinkAzure Databricks is Easier Than You Think
Azure Databricks is Easier Than You Think
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to dax
 
Pass the Power BI Exam
Pass the Power BI ExamPass the Power BI Exam
Pass the Power BI Exam
 
Slides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATESlides for PUG 2018 - DAX CALCULATE
Slides for PUG 2018 - DAX CALCULATE
 
Introduction to DAX
Introduction to DAXIntroduction to DAX
Introduction to DAX
 
60 reporting tips in 60 minutes - SQLBits 2018
60 reporting tips in 60 minutes - SQLBits 201860 reporting tips in 60 minutes - SQLBits 2018
60 reporting tips in 60 minutes - SQLBits 2018
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017
 
A lap around microsofts business intelligence platform
A lap around microsofts business intelligence platformA lap around microsofts business intelligence platform
A lap around microsofts business intelligence platform
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Top 5 things to know about sql azure for developers

  • 1. Top 5 Things to Know @SQL Azure By Ike Ellis http://www.ellisteam.net http://www.develop.com http://ellisteam.blogspot.com @ellisteam1
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Dragon #1: The ConnectionString
  • 14. Quick Demo: How to Sign Up Free Accounts BizSpark MSDN Subscription 30 day trial Bing SQL Azure 30 day trial….there are coupons and instructions. Look on the SQL Azure Team Blog Remember: Microsoft wants you to use this, there’s a way to try it for free…
  • 15. Your SQL Server Your App Change Connection String SQL Azure
  • 16. 5 Things Make Up a Connection String What are they?
  • 17. 5 Things Make Up a Connection String What are they? UserName Password Database(Catalog) ServerName ProviderName
  • 18. #1 ConnectionString <add name="FlashcardEntities" connectionString="metadata=res://*/Models.FlashcardData.csdl|res://*/Models.FlashcardData.ssdl|res://*/Models.FlashcardData.msl;provider=System.Data.SqlClient;provider connection string=&quot ;Data Source=etnejn2aev.database.windows.net;Initial Catalog=flashcards;Integrated Security=False;User ID=***(username@servername);Password=*******;MultipleActiveResultSets=True ;Encrypt=True(negotiated) ;TrustServerCertificate=False&quot;" providerName="System.Data.EntityClient" />
  • 19. Connection Providers Use ADO.NET, ODBC, PHP (NOT OLE DB) Client libraries pre-installed in Azure roles Support for ASP.NET controls Clients connect directly to a database Cannot hop across DBs (no USE) May need to include <login>@<server> Use familiar tools (sqlcmd, osql, SSMS, etc) Use connection pooling for efficiency SSMS 2008 R2 can connect http://blogs.msdn.com/ssds/archive/2009/11/11/9921041.aspx SSRS, SSIS, SSAS can all connect to SQL Azure using the right provider.
  • 20. Typical ADO.NET Connection.Open()*Courtesy of BartR – Microsofthttp://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed:+Microsoft/MSDN-Blogs+(MSDN+Blogs) try
 {
    using (SqlConnection conn = new SqlConnection(sqlConnectionString))
    {
        using (SqlCommandcmd = new SqlCommand(sqlStatement, conn))
        {
            conn.Open(); using (SqlDataReaderdr=cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                }
            } catch (SqlException ex)
 {
  SxpLog.WriteSqlException(ex, "some", "other", "data");
 }
  • 21. New Connection.Open()*Courtesy of BartR – Microsofthttp://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed:+Microsoft/MSDN-Blogs+(MSDN+Blogs) string sqlContext = string.empty; try
{
    using (SqlConnection conn = new SqlConnection(sqlConnectionString))
    {
        using (SqlCommandcmd = new SqlCommand(sqlStatement, conn))
       {
            sqlContext= GetSqlContextInfo(conn);             using (SqlDataReaderdr=cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                }
            }
        } catch (SqlException ex)
 {
  SxpLog.WriteSqlException(ex, sqlContext, "some", "other", "data");
 }
  • 23. Dragon #2: Some New Errors 40550 - Session has been terminated because it has acquired too many locks. Try reading or modifying fewer rows in a single transaction. (Greater than 1,000,000 locks) 40551 - Session has been terminated because of excessive TempDBUsage(TempDB is only allowed to be 5GB in size) 40552 - Session used too much of the transaction log. try modifying fewer rows in a single transaction. (Transaction consuming excessive log resources are terminated. The max permitted log size for a single transaction is 1GB) 40544 - Database reached it's max size. Switched to read-only 40553 - Session is terminated because of excessive memory usage. (Where there is memory contention, sessions consuming greater than 16MB for more than 20 seconds are terminated in the descending order of time the resource has been held) 40549 - Session is terminated because of a long running transaction (SQL Azure kills all transactions after 24 hours.) 40501 The service is currently busy. Retry the request after 10 seconds. Code: %d (SQL Azure might terminate the transactions and disconnect the sessions when the CPU utilization, input/output I/O latency, and the number of busy workers exceed thresholds.
  • 24. Another Reason We Need Retry Code = Disaster Recovery/Database Replicas Multiple Physical Replicas Replica 1 Single Primary Single Logical Database Replica 2 DB Replica 3
  • 26. Dragon #3: Tooling SQL Azure Database Manager Silverlight Tool SSMS 2008 R2 Standard Tool
  • 27. Dragon #4: Database Migration SSIS BCP SSMS – Generate Scripts DEMO: SQL Azure Migration Wizard
  • 28. Dragon #5: Performance Tuning Let’s get this out of the way – What we don’t have: no sql error log no sql profiler no pssdiag no bpa (best practices analyzer) no xevent no server side network capture no mps reports(microsoft product support reports) Only some DMVs
  • 29. SQL Azure Performance Guide Missing Indexes or better indexes Use DMVs Use Query Plans 2) Covering indexes for the WHERE clause 3) Can sorting be done on the client? 4) Minimize round trips 5) Limit records (paging) 6) Use Connection Pooling (open connection late, close them early) 7) Retry Logic (wait 10 seconds and then retry) 8) Catch errors and understand that when azure throws an error, the tran rollback 9) Caching and batching - evaluate caching and batching to limit round-trips to the server 10) avoid latency - choose a data center nearest to your location 11) Trace connections - traced connections using context_info() to troubleshoot connectivity issues 12) CALL SUPPORT
  • 30. What I Didn’t Cover, But You Might Want to Research Pricing Included/Excluded Features Product Roadmap SQL Azure Reporting Backup/Restore Options SQL Azure Data Sync SQL Azure Odata Future Differences Between Editions
  • 31. Good Resources Inside SQL Azure – Kalen Delaney http://social.technet.microsoft.com/wiki/contents/articles/inside-sql-azure.aspx SQL Azure & Entity Framework – Julie Lerman http://msdn.microsoft.com/en-us/magazine/gg309181.aspx Doesn’t cover the retry issue. SQL Azure Team Blog & Twitter http://blogs.msdn.com/b/sqlazure/ Twitter: @sqlazure My Site http://www.ellisteam.net http://ellisteam.blogspot.com Twitter: @EllisTeam1

Notas do Editor

  1. This is you
  2. You are very good looking.
  3. You are sailing safely on the waters of an ON PREMISE SQL SERVER….You know these waters…and they are comfortable.
  4. What’s that up ahead?
  5. It’s a cloud! A SQL Azure Cloud! And it look unavoidable…yet fun! You decide to consult your map, to learn more about what might be in that cloud.
  6. That dragon on the map looks scary!
  7. But when you look closer at the real dragon, you find that it’s not so scary…in fact, kind of harmless….