sql server 2012 top 10 new features. agenda 1.alwayson availability groups 2.columnstore index...

26
SQL Server 2012 Top 10 new features

Upload: stefanie-segers

Post on 14-Jun-2015

222 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

SQL Server 2012

Top 10 new features

Page 2: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

Agenda

1. AlwaysOn Availability Groups2. ColumnStore Index3. Contained database4. Windowing functions5. FileTable6. Semantic Search7. T-SQL enhancements8. Server roles en default schema voor groups9. SSIS project deployment10. BISM met PowerView

Page 3: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

1. Availability Groups

• Mirroring 2.0 (?)• Highlights:– Zelf groep van databases definiëren– Tot 4 secondaries– Read-only secondaries– Backup from secondary• (not differential)

• Zie sessie van Robert Hartskeerl over AlwaysOn om 11.00u

Page 4: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

2. Column store index

• Normale heap/index slaat records rij voor rij op• Veel IO overhead als niet alle kolommen nodig zijn • Column store index slaat gegevens per kolom op– Betere compressie– Minder IO– Veel betere performance

• Zie sessie van Hugo Kornelis: SQL Server 2012 ColumnStore index om 14.45u

Page 5: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

3. Contained Database

• Moving a database to a different SQL Server instance is easy– Detach / attach– Backup / restore

• Right?• How about

– Logins ?– Linked Servers ?– Database mail ?– Jobs ?– #temp tables / cross database joins and collation ?– … ?

Page 6: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

Contained Database geeft:

1. Database authentication• Users met wachtwoord / windows users• Geen mapping met login -> geen orphaned users

2. TempDB collation issues• Objecten in tempdb worden gemaakt met de collation van de

database

3. DB is meer een black box. Verplaatsen is makkelijker (Azure?, OTAP?, ..)

• Nog te wensen:– Volledige onafhankelijkheid van instance– Alleen partially contained is nu geïmplementeerd

Page 7: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

DEMOContained database

Page 8: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

Tot slot

• EXEC sp_configure ‘contained database authentication’, 1

• SELECT * FROM sys.dm_db_uncontained_entities

• ALTER DATABASE <name> SET CONTAINMENT PARTIAL

• Niet alle features zijn te combineren met contained databases• Er zijn enkele security implicties, oa:

– Databases met guest account enabled zijn benaderbaar– Users met control database permission kunnen containment aanzetten

en mensen toegang geven– … (zie BOL)

Page 9: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

4. Windowing functions

• over clause van aggregate functies uitgebreid met:– Rows x preceding– Rows between x preceding and y following– Rows unbounded preceding– …

• Geeft toepassingen als moving average, meelopend totaal, vergelijk met vorige maand, …

Page 10: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

DEMOWindowing functions

Page 11: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

Extra grouping functions• PERCENTILE_CONT, PERCENTILE_DISC– In statistics, a percentile (or centile) is the value of a

variable below which a certain percent of observations fall.

• PERCENT_RANK, CUME_DIST– Calculates the relative rank of a row within a group of

rows• FIRST_VALUE, LAST_VALUE– Returns the first, last value in an ordered set of values– +- Comparable to sibling functions in SSAS hierarchy

• LEAD, LAG– Accesses data from a subsequent, earlier row in the same

result set without the use of a self-join with a given offset

Page 12: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

5. FileTable• Klassiek database ontwerp issue:

BLOB’s in database of extern op fileshare?– Beide oplossingen hebben nadelen

• SQL Server 2008: FileStream– Best of both worlds: wij doen ze in de database maar SQL

Server zet ze op een fileshare– Nadeel: applicatiecode moet aangepast om feature te

gebruiken

• SQL Server 2012: FileTable– Geen onderscheid meer tussen fileshare en tabel– Intergreert goed met full text en semantic search

Page 13: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

6. Semantic Search

• Uit BOL: – provides deep insight into unstructured documents

stored in SQL Server databases by extracting statistically relevant key phrases, and then - based on these phrases – identifying similar documents. These results are made available as structured data through three Transact-SQL rowset functions

– full-text search: query for words in a document– semantic search: query the meaning of the document– E.g. query the document similarity index to identify

resumes that match a job description

Page 14: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

Voorbereiding

• Installeer en enable full text search• Run SemanticLanguageDatabase.msi– Unpacks mdf

• Attach semanticdb database• Register semanticdb:

– sp_fulltext_semantic_register_language_statistics_db @dbname = N'semanticsdb;

• Installeer iFilters om te zoeken inbijvoorbeeld docx, pptx, …

Page 15: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

DEMOFileTable + semantic search

Page 16: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

7. T-SQL enhancements

• Throw (ter vervanging van raiserror)• Sequence (ter vervanging van identity)• Paging (offset x rows fetch next y rows)• Functions:– Parse (convert met regional settings)– Try_parse (parse maar zonder errors)– Format (omdat we code 105 van convert niet kunnen

onthouden)– Concat (omdat we niet van NULL houden)– IIF (omdat CASE soms omslachtig is)

Page 17: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

DEMOT-SQL

Page 18: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

8. Security

• Server roles• default schema voor groups

Page 19: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

User defined server roles• Eigen rollen maken op instance level– Vergelijkbaar met database roles– Minder noodzaak voor sysadmin– Minder rechten voor administrators (better separation

of duties)– Triggers voor add/remove logins to user-defined server

roles • T-SQL– CREATE/DROP SERVER ROLE– ALTER SERVER ROLE• E.g. ALTER SERVER ROLE Production ADD MEMBER

[TrainSQL\Peter] ; • Vervangt sp_addrolemember

Page 20: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

default schema voor groups

• Probleem met SQL Server 2008 en eerder:– Schema en user worden automatisch aangemaakt

als object gemaakt in default schema en er is geen default schema

– Logins gebaseerd op groepen kennen geen default schema

• Login gebaseerd op windows groep kan nu default schema krijgen (no. 1 customer request)

• Schema management makkelijker

Page 21: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

DEMOSecurity

Page 22: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

9. SSIS project deployment

• Probleem met SQL Server 2008 en eerder:– Deployen naar filesystem of SQL Server (msdb)?

• Project deployment:– SSISDB catalog (vergelijkbaar met ReportServer

database)– Meer versies van project mogelijk– Environments vervangen configurations– Parameters vervangen parent package configurations

• T-SQL procedures om packages uit te voeren

Page 23: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

DEMOSSIS

Page 24: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

10. BISM met PowerView

• BISM = BI Semantic Model– Nieuw model naast SSAS UDM– Gebaseerd op PowerPivot

• PowerView:– Rapportage tool voor niet techneuten

• Zie sessie van Marcel Westra om 13.30u

Page 25: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

GetReady 2012

• Utrecht• 19 juni• Hele dag nieuwe features• Peter ter Braake

Page 26: SQL Server 2012 Top 10 new features. Agenda 1.AlwaysOn Availability Groups 2.ColumnStore Index 3.Contained database 4.Windowing functions 5.FileTable

Peter ter [email protected]@pbraake

BEDANKT!