SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group...
Transcript of SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group...
![Page 1: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/1.jpg)
SQL Azure
![Page 2: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/2.jpg)
Agenda
• Announcements
• SQL Azure: First Look
• Demo
![Page 3: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/3.jpg)
Announcements
• LA Cloud Camp Wed 9/30http://www.cloudcamp.com/losangeles/
• Moving to an every-other-month meeting schedule (no October meeting)
• Topic for November: Rich Internet Applications (RIAs)
![Page 4: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/4.jpg)
SQL Azure - Overview
• Database in the Cloud
• Very similar to SQL Server
• Database functionality only at present(no SSRS, SSAS, SSB)
• First preview CTP came out in late August
• First time most of us are seeing it is tonight
• Free to use between now and release
• Release is November 2009 PDC
![Page 5: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/5.jpg)
SQL Azure - Database Only
• SQL Azure does not support all of the features and data types found in SQL Server. Analysis Services, Replication, Reporting Services, and Service Broker are not currently provided as services on the Azure Services Platform.
![Page 6: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/6.jpg)
SQL Azure – How to Sign Up
• Just visit Azure.com and follow the sign-up link
• Your invitation tokenwill come in the mail
![Page 7: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/7.jpg)
SQL Azure – Manage from Azure.com
![Page 8: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/8.jpg)
SQL Azure – Manage from Azure.com
![Page 9: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/9.jpg)
SQL Azure Server Administration
Server Name
Admin
Data Center
Databases
Show Connection
String
Admin Password
Reset
Create New Database
![Page 10: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/10.jpg)
Connection Strings
• It’s intended that the main difference between SQL Server and SQL Azure is the connection string
• Connection String Format:Server=tcp:server.ctp.database.windows.netDatabase=databaseUser ID=userPassword=passwordTrustedConnection=False
![Page 11: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/11.jpg)
Create Database
![Page 12: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/12.jpg)
DEMO: SQL AZURE PORTAL
![Page 13: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/13.jpg)
Can I use SQL Server Mgmt Studio?
Yes, but it’s a little rocky right now. You need to follow these steps precisely to get it working:
1. Cancel out of the first Connect dialog that pops up.2. click on the New Query button from the toolbar3. enter
Server name: full servernameLogin: just the username (no @...) and password
4. Under Options, Connect to Database, enter db name5. Click Connect, ignore the ANSI NULLS error that is displayed.
![Page 14: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/14.jpg)
Step 1: Cancel Connect Dialog
CancelDialog
![Page 15: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/15.jpg)
Steps 2-3: Click New Query, Enter Info
Click New Query
Server Name
Admin user id and
password
![Page 16: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/16.jpg)
Step 4: Enter Database Name
Enter Database
Name
![Page 17: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/17.jpg)
Step 5: Click Connect, Ignore Error
![Page 18: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/18.jpg)
SQL Server Mgmt Studio Gotchas
• No Object Browseruse select * from sys.objects instead
• Connections time out after 5 minutesThis is to protect cloud users from adversely affecting each other
![Page 19: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/19.jpg)
Create DB Locally
![Page 20: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/20.jpg)
Script Table Creation
![Page 21: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/21.jpg)
Create Table in SQL Azure
![Page 22: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/22.jpg)
Create Table, Insert, Select in SQL Azure
![Page 23: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/23.jpg)
DEMO: USING SQL SERVER MANAGEMENT
STUDIO WITH SQL AZURE
![Page 24: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/24.jpg)
SQL Azure – Key Benefits
• Manageability– Scale and functionality of an enterprise data center w/o the admin overhead
– Self-managing capability allows organizations to provision data services without adding to their support burden
– Reduce the initial costs of data services by provisioning only what you need. Provision your data storage in minutes.
• High Availability– Built on Windows Server and SQL Server technologies, flexible enough to cope with any variations in usage and load.
– Replicates redundant copies of your data to multiple physical servers to maintain availability and business continuity.
– In the case of a hardware failure, SQL Azure provides automatic failover to optimize availability for your application.
• Scalability– Scale your solution with ease. After partitioning your data, the service scales as your data grows.
– You only pay for the storage that you use. Scale down the service when you do not need it.
• Familiar Development Model and Relational Data Model– Use the same tools and libraries to build solutions that you do for SQL Server.
– Data is stored in SQL Azure just like it is stored in SQL Server, by using Transact-SQL.
– Familiar database objects - multiple databases with tables, views, stored procedures, indices
• No Physical Considerations– SQL Azure servers and databases are virtual objects that do not correspond to physical servers and databases. By
insulating you from the physical implementation, SQL Azure enables you to spend time on your database design.
![Page 25: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/25.jpg)
Administration
• Logical Administration
– DBA manages schema creation, statistics management, index tuning, query optimization, and security administration (logins, users, roles…)
• Physical Administration
– SQL Azure service automatically replicates all data to provide high availably
– SQL Azure service manages load balancing and, in case of a server failure, transparent fail-over.
![Page 26: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/26.jpg)
Backup
• No backup and restore commands
• You can still use SQL Server Integration Services and the SQLCMD utility to bulk copy data.
![Page 27: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/27.jpg)
Provisioning Model
• Each Azure account can have multiple SQL Azure servers• Each SQL Azure server can be associated with one or
more databases.• A SQL Azure server is a logical group of databases and
acts as a central administrative point for multiple databases.
• Each SQL Azure server includes logins similar to those in instances of SQL Server on your premises.
• Each SQL Azure server has a fully qualified unique domain name, which is produced during the SQL Azure provisioning process. servername.ctp.database.windows.net
![Page 28: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/28.jpg)
Create a Database
• Interactively using the SQL Azure portal, or
• Programmatically with a CREATE DATABASE statement.
![Page 29: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/29.jpg)
Managing Users and Logins
• Server-level login administration– Server-level administration for logins and databases in SQL Azure differs from an
on-premise instance of SQL Server. – During provisioning, SQL Azure creates a server-level principal login equivalent to
the sa login in SQL Server– Additional SQL Azure databases and logins can then be created via T-SQL
• SQL Azure provides the same security principals as SQL Server, such as: – SQL Server logins: Authenticate access to SQL Azure at the server level.– Database users: Grant access to SQL Azure at the database level.– Database roles: Group users + grant access to SQL Azure at the database level.
• Database-level login administration– Database-level administration for users and roles in SQL Azure is the same as for an
on-premise instance of SQL Server.
![Page 30: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/30.jpg)
T-SQL SupportSupported Fully or Partially• Constants
• Constraints
• Cursors
• Index management and rebuilding indexes
• Local temporary tables
• Reserved keywords
• Stored procedures
• Statistics management
• Transactions
• Triggers
• Tables, joins, and table variables
• Transact-SQL language elements such as
– Create/drop databases
– Create/alter/drop tables
– Create/alter/drop users and logins
• User-defined functions
• Views
Not Available• Common Language Runtime (CLR)
• Database file placement
• Database mirroring
• Distributed queries
• Distributed transactions
• Filegroup management
• Global temporary tables
• Spatial data and indexes
• SQL Server configuration options
• SQL Server Service Broker
• System tables
• Trace Flags
![Page 31: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/31.jpg)
Programming Model
• Use one of two programming models when using SQL Azure, depending on the size of your database application.
• For smaller data sets, use a single database, similar to how you use an on-premise instance of SQL Server.
• For larger data sets, we recommend that you partition your data across multiple databases and write parallel "fan-out" queries to fetch the data. Doing this optimizes the performance and availability of SQL Azure.
![Page 32: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/32.jpg)
Migration Tips
• Try the SQL Azure Migration Wizardhttp://sqlazuremw.codeplex.com/
• Upgrade to SQL Server 2008 first
• Analyze errors into 2 categories:
– Different but equivalent in the cloud - minorExample: creating logins can’t be done in a batch
– No equivalent in the cloud – majorExample: no support for user-defined types
![Page 33: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/33.jpg)
DEMO: MIGRATING A SQL SERVER
DATABASE AND ASP.NET WEB APPLICATION TO USE SQL AZURE
![Page 34: SQL Azure - Ningapi.ning.com/.../2009.09.SQLAzure.pdf · • A SQL Azure server is a logical group of databases and acts as a central administrative point for multiple databases.](https://reader031.fdocuments.net/reader031/viewer/2022041606/5e3434e8fff95059fc58d04e/html5/thumbnails/34.jpg)
SQL Azure Resources
• Documentationhttp://msdn.microsoft.com/en-us/library/ee336279.aspx
• Sign up for SQL Azurehttp://www.Azure.com
• SQL Azure Developer Centerhttp://msdn.microsoft.com/en-us/sqlserver/dataservices/default.aspx
• Azure User Grouphttp://www.AzureUserGroup.com