Top Banner

of 20

[Dean Vitner] SQL Server “Denali” Contained Databases

Jul 13, 2015

Download

Documents

Sasa Stankovic
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

SQL Server Denali Contained DatabasesDean Vitner

The problem Logically, a database is a basic, self-contained unit But... A database depends a lot on the environment Different settings on different instances Collations Linked servers Logins This makes it hard to move a database from one instanceto another

DEMO 1

The solution Contained database All important settings are contained inside the database Everything travells along with the database when wemove it

Is it contagious?

DEMO 2

Item User Data (default) Temp Data (default) Metadata Temporary Metadata Variables Goto Labels Cursor Names

Non-Contained Database DATABASE_DEFAULT TempDB Collation DATABASE_DEFAULT TempDB Collation Instance Collation Instance Collation Instance Collation

Contained Database DATABASE_DEFAULT DATABASE_DEFAULT CATALOG_DEFAULT CATALOG_DEFAULT CATALOG_DEFAULT CATALOG_DEFAULT CATALOG_DEFAULT

Application vs Management model Application model Objects contained inside the database Metadata (sys.tables etc) Users with passwords User tables Management model Objects outside the database Instance-level functions Divided by application boundary

Application boundary Divides application and management model The idea was to put everything that logically belongs toapplication model into a database

Everything else is part of management model Features Outside of the Application Model:http://msdn.microsoft.com/en-us/library/ff929118(v=SQL.110).aspx

Application model In SQL Server code name Denali: Users without login #temp object collations are always database_default Catalog collation is always: Latin1_General_100_CI_AS_WS_KS PARTIAL containment only

DEMO 3 & 4

Loginless users Logged in to the instance as guests Must have default database specified in connection string Both for SQL and Windows logins Precede same-name logins CREATE USER xxx WITH PASSWORD = 123QWERTY sp_migrate_user_to_contained

Is my database contain-able? sys.dm_db_uncontained_entities dynamic managementview

database_uncontained_usage Xevent User with login Dynamic SQL xp_cmdshell sp_send_db_mail ...

DEMO 5 & 6

What is it good for? Failover in mirroring or log shipping scenarios Consolidation Testing Deploying applications All editions No performance hit

Section headline

Thank you for your attention.

Openness and Interoperability @MicrosoftMicrosoft and Open Sourcegateway for deeper exploration of open source engagementshttp://www.microsoft.com/ openness

Port25blogs from the platform community and the OSS Lab teamshttp://Port25.technet.com

Codeplexresources for developers and consumers of open source projectshttp://www.codeplex.com

Interoperability Bridgestechnical collaborative workshttp://www.interoperability bridges.com

Open Upcross-Industry Interoperability and Standards activitieshttp://www.microsoft.com/ interop/openup

Shared Sourceportal for programmatically sharing codehttp://www.microsoft.com/ sharedsource

ODataopen source starter kit for Internet publishing of Government datasets using the Open Datahttp://ogdisdk.cloudapp.net

Open Specprotocols, file formats, standards, technical specificationshttp://www.microsoft.com/ openspecifications

BizSparkProgram for Start-Up companies from both commercial and open source backgroundshttp://www.microsoft.com/ bizspark

How can I receive up-to-date Openness announcements from Microsoft? In addition to the websites above, you can receive regular updates to Microsofts openness, interoperability and standards efforts via the following channels: http://blogs.technet.com/b/openness/ http://blogs.msdn.com/b/interoperability/ http://twitter.com/OpenAtMicrosoft http://port25.technet.com http://channel9.msdn.com/Blogs/Interoperability

Please rate this lecture and WIN HTC MOZART!Help us choose the best Sinergija lecturer! Telekom Srbija and Microsoft will award you at the conference end, well give one HTC Mozart WP7 phone to someone from the audience randomly. Go to www.mssinergija.net, log in and cast your votes.You can rate only lectures that you were present at, just once. More lectures you rate, more chances you have. Please use computers at the front of this room, or rate lecture from your phone or home computer, at Sinergija portal. This prize contest will end at Thursday, October 20th at 9 PM. Winner will be announced at the official Sinergija web portal, www.mssinergija.net

is a friend of Sinergija 2011 Conference and Imagine Cup student competition in Serbia.