SQL Explore 2012 - Meir Dudai: DAC
-
Upload
sqlservercoil -
Category
Technology
-
view
681 -
download
1
Transcript of SQL Explore 2012 - Meir Dudai: DAC
סיפורו של חוזר איך בתשובה:
השתכנעתי הולך DACש-
לשנות את חיי DBAה-
Number of database apps
Number of DBAs
1990 2000 2010
Hardware computing ca
pacityUnderutilized
hardware
Overburdened Administrators
Having fun with deployment
? בתוכנית מה
זה • בסלון DACמה לישון אותו שלחתי ולמההאחרונה • בשנה קרה מההדגמה•
מיקום
ChallengesDevelopment
• No uniform DB project system and workflow
Deployment
• DBAs and Developers work in silos
• Time consuming and error prone
Management
• Difficult to centrally control the environment
InvestmentsDevelopment
• Data-tier Application project
• Integrated editor, debugger, IntelliSense, policy designer
• Static code analysis, build service
Deployment
• Easier to deploy and upgrade Data-tier Apps from VS and SSMS (and now SSDT)
Management
• Manage @ Scale: SQL Server Control Point
• Visualize resource utilization at the instance & application level
Concepts
.dacpac = unit of deployment (data-tier application + developer intent)Data-tier Application Component
• Improves collaboration between developer and DBA
• Moves developers from a procedural model to a declarative model
Data-tier Application Component
Schema
LOGICALTables, Views, Procs, UDFs
PHYSICAL
Users, Logins, Indexes
DAC Deployment ProfileDeployment Requirements,
Management Policies
Data-Tier Applications
Data-Tier Applications
• Often referred to as the DAC Framework (or DAC Fx)• Collection of APIs, file and data formats, and services• Dramatically simplify database deployment and
versioning• Fully integrated into SSDT and essential for developers!• Allows a focus on the data model rather than on scripts• Target on-premises or cloud
כפירה הרהורי
•Enterprise Edition Only- מ ) (UCPכחלקהאובייקטים • בכל תמיכה היתה לא
•... בהם התלויים האובייקטים וכל•- ב לא AdventureWorksאפילו
באמצעות • DAC : Side by Sideשדרוג•- ב תמיכה Dataאיןישנות • בגרסאות תמיכה אין
? השתנה מה
v2 DAC Upgrade
• Side-by-side process• Data migrated to new database• Retained copy of previous database
v3 DAC Upgrade
• Shipped with SQL Server 2012• Supports in-place upgrades• No need to copy/migrate all the data (#1 requested feature)• Support for SQL Server 2005 SP4 (or later) and SQL Azure• Need to ensure sufficient transaction log space is available for
upgrade process• PowershellIncrementalUpgrade() method added
Enhanced Object Support
Significant enhancement to list of supported objects
• 98% SQL Azure parity• Support added for permissions and roles
Enhanced database object support:Newly Supported Objects
SYNONYM SEQUENCE
SPATIAL INDEX GEOMETRY
GEOGRAPHY HIERARCHYID
Cursor Parameters in Stored Procedures STATISTICS
Platform Targeting
Single project can target multiple platforms
• Versions of SQL Server• SQL Azure
Build prevents use of unsupported features for platformEasy migration of databases to SQL Azure
• Create down-level .dacpac file
Demo
Database Project vs. DAC ProjectData-tier Application Project V1
(Small Apps)
Visual Studio
Build
.dacpac
Database Project(Mission Critical, Business Critical)
Visual Studio
.dbschema.sql
Build
DeployDeploy
Generate scripts
DAC Exports
Option to export both schema and data to a single file
• Exports logins, users, tables, columns, constraints, indexes, views, stored procedures, functions and triggers
• First added in DAC v2 Feature Pack CTP
.bacpac files• Uses JSON format for data• Much easier than using (and configuring) bcp• Avoids issues with code pages and precision
Not intended as a backup mechanism
• No transaction log or history• Not transactionally consistent (where concurrent access is occurring)DACImportExportCLI.exe –s localhost-d RetailDB -f C:\EXPORT\
RetailDB.bacpac -x -e
DACImportExportCLI.exe –s localhost-d RetailDB -f C:\EXPORT\RetailDB.bacpac -x -e
DAC Import
Imports schema and data• Registers Data-Tier Application
Greatly simplifies migrations• SQL Server -> SQL Azure
DACImportExportCLI.exe –s sdf23sdf.database.windows.net -d RetailDB -f C:\EXPORT\RetailDB.bacpac -i -u Username -p Password
DACImportExportCLI.exe –s sdf23sdf.database.windows.net -d RetailDB -f C:\EXPORT\RetailDB.bacpac -i -u Username -p Password
SQL Azure Integration
BACPAC can also be used in SQL Azure portal• Databases export .bacpac to Windows Azure
storage• Create one or more databases based on
importing .bacpac from storage
Extract/Deploy Data-Tier Applications to/from local filesystem
• Use SSMS directly connected to SQL Azure
Call To Action!
Consider using DAC Fx on your next project• Focus on the data model, not on the schema
changes
Simplify your application deployment• Move on from error-prone scripts• Distribute .dacpac or .bacpac files with your
application