Category: "Extended Events"

Dieser Blog ist umgezogen // This Blog has moved: http://andreas-wolter.com/blog/

http://andreas-wolter.com/blog/

Liebe Leser
dieser Blog ist hiermit nur noch „Archiv“ und wird nicht mehr weiter gepflegt.
Seit August 2017 finden sich neue Artikel ausschließlich unter der neuen URL:
http://andreas-wolter.com/blog/

Dear Readers
this blog is now merely an „archive“ and no longer being updated.
Since August 2017 new articles are exclusively available under the new URL:
http://andreas-wolter.com/en/blog/

Die aufwändige Mehrsprachigkeit (Deutsch und Englisch professionell manuell übersetzt) wird beibehalten – aber Layout-technisch anders gelöst. Damit dürfte ich immer noch den einzigen mehrsprachigen IT-Blog weltweit betreiben.
Ich hoffe, das neue Design gefällt Ihnen.

The complex multilingualism (German and English professionally manually translated) is being continued – but solved differently in terms of layout. With that I most likely still operate the only multilingual IT-Blog worldwide.
I hope you like the new design.

 

 

Mein aktueller Artikel, der erstmalig ausschließlich auf der neuen Website zu finden ist, lautet: Optimieren von Workflows mit In-Memory und nativ kompilierten Objekten - oder wie es nicht funktioniert

My currently last article, which is exclusively available at the new website for the first time, is Optimizing workflows with In-Memory and Natively Compiled Objects - or how it does not work

 

Cu at my new Blog

Andreas

Die neue SQL Server Master-Class: Warum ein SQLSentry Bootcamp

The new SQL Server Master-Class in – why a SQLSentry Bootcamp

(DE)
Die wichtigsten Infos gerafft zuerst:
Vom 26. bis 28. Juni führe ich in Frankfurt eine neue SQL Server Master-Class durch: Das Performance Troubleshooting Bootcamp mit SQLSentry (Kürzel: PSS*) durch. Hier für die Eiligen der Link zur Anmeldung:

(EN)
First off, the most important information in a nutshell:
From 26-28 June, I am conducting a new SQL Server Master-Class: The Performance Troubleshooting Bootcamp with SQLSentry (shorthand: PSS*). For those in a hurry, the link for registration right below:

 SQL-Server-Master-Class.com/#PSS

 SentryOne Master-Class

Hintergründe zu der Master-Class Reihe

Seit 2013 führe ich unter dem Label SQL Server Master-Class 1-2 Mal jährlich (und zusätzlich je nach Bedarf inhouse bei Kunden) diese offenen Seminare durch. Das erste waren 2-Tage zu Extended Events (SQL Server Master-Class Seminare – Für Alle, die es genau wissen wollen – Start im Mai mit Extended Events).
Der Anspruch, den ich mit diesen Trainings habe, ist, die Themen in aller Tiefe und Praxisnah zu vermitteln – und damit eine Alternative oder Ergänzung zu den an verschiedenen Problemen leidenden MOC-Trainings (unrealistische Themenvielfalt, fehlerhafte Unterlagen, unerfahrene weil billige Trainer – „man bekommt, wofür man bezahlt“, etc.)  anzubieten.
Dass das gut gelingt, lässt sich hier in einigen Kundenstimmen nachlesen.

Background to the Master-Class series

Since 2013, I have been conducting these open seminars under the label SQL Server Master-Class once or twice a year (and additionally inhouse with clients, as needed). The first ones were 2-day classes on Extended Events (SQL Server Master-Class Seminars – The tools at your fingertips – Start in May with Extended Events).
With these trainings I seek an in-depth and practice-oriented approach to teaching the topics – thus offering an alternative or complement to the MOC trainings that suffer from various problems (unrealistic thematic diversity, faulty material, inexperienced because cheap trainers – “you get what you pay for”, etc.).

This has been a successful approach, as you can read in these customer reviews

Warum eine Master-Class zu SQLSentry?

Beginnen wir mal mit:

Warum SQLSentry?
Man kann sich jetzt gut fragen, warum jemand wie ich, der an sich unabhängig von Drittherstellern agiert, nun ein Training anbietet, das stark (ca. 50%) auf der Software eines bestimmten Herstellers basiert.

Das erläutere ich gerne. Dazu zunächst ein Schritt zurück:

Der Hintergrund, warum ich ungern auf bestimmte Software- (oder Hardware)-Hersteller verweise, ist, dass darauf basierende Entscheidungen dann naturgemäß auf mich zurückgeführt werden. Und es ist schon bei SQL Server selbst eine Herausforderung, das jeweils passendste („beste“, wenn man so will) Feature für bestimmte Ansprüche zu empfehlen. Das ist meine Hauptaufgabe, und dafür bin ich (zweifach) Master. Jetzt noch den Überblick über andere Software-Hersteller, deren Tools und vor allem ja variierende Qualität zu behalten, ist alles andere als trivial.

Daher muss es sich schon wirklich um das mit Abstand beste Werkzeug in einem Bereich handeln, und das auch mit genügend Kontinuität, dass ich meinen Namen damit verbinden lasse. Und so ist SQLSentry von SentryOne im Bereich Monitoring von SQL Server (aber auch SSAS, und Azure-Komponenten) ohne Zweifel eine eigene Liga.

Warum? Würde es nur ein einzelnes Merkmal sein, würde ich mich damit nicht aufhalten.

- Ganz nebenbei: gerade als MVP wird man häufig von Herstellern angeschrieben und kann deren Produkte testen oder mit Artikeln und ähnlichem mit Bewerben. – Das ist hier nicht der Fall. Diese Master-Class und dieser Artikel basieren vollkommen auf Eigeninitiative.

Why a Master-Class on SQLSentry?

Let’s start with:

Why SQLSentry?
One may wonder why someone like me who is acting independently of third-parties is now offering a training strongly based (approx. 50%) on the software of a certain manufacturer.

I am happy to elaborate on this. But first, let’s take a step back:

The reason as to why I am reluctant to refer to certain software (or hardware) manufacturers is that decisions based on them will naturally be attributed to me. And even with SQL Server itself, it is a challenge to recommend the most suitable (“the best,” if you will), feature for particular demands. That is my main task, and that is what I am a (two-fold) Master for. Keeping track of other software manufacturers, their tools and, above all, their varying quality, on top of all this, is tough.

Therefore, it must really be the very best tool in a particular area, and with sufficient continuity, before I associate my name with it. And it so happens that SQLSentry by SentryOne is without doubt its own league in the area of Monitoring SQL Server (but also SSAS and Azure components).

Why? If it was just a single feature, I would not be sticking to it.

- By the way: especially as an MVP one gets contacted a lot by software-producers and can test their products or write articles on them. – This is not the case here. This Master-Class and this article are based on my own initiative.

 

 

 

SQLSentry enthält eine Vielzahl von spezialisierten Komponenten für verschiedene Bereiche in SQL Server, von denen einige auch patentiert sind, aber ich versuche es kurzzufassen und nur die speziellsten zu nennen:

·       Der Event Calendar führt sämtliche SQL Agent Jobs, aber auch Windows Tasks sowie Auffällige Performance-Events in einem Outlook-Style Kalenderformat zusammen, und erlaubt so zeitliche Korrelationen

·       Mit Intelligent Alerting lassen sich komplexe Konditionen definieren – denn oft sind einzelne Performance-Messzahlen alleine gar nicht ausreichend für eine Bewertung. Hiermit lassen sich diese kombinieren. Und damit ist auch Pro-Aktives Monitoring möglich(!)

·       Die Disk-Activity-Ansicht zeigt SQL-Dateiverwendung im Detail grafisch aufbereitet

·       Die AlwaysOn Availability Group-Visualisierungen zeigen die Architektur als auch Auslastung der Availability Gruppen – eigentlich fehlt mir nur noch etwas Vergleichbares für Replikation :-)

·       Index- und Statistik-Analyse – von Fragmentierung bis herunter auf Histogram-Ebene

·       Chaining von Jobs – Abläufe verschiedener Komponenten über Server hinweg verketten

·       Und natürlich das Performance Dashboard selber: Dies zeigt nicht nur die Auslastung des Servers (Windows, SQL und ggfl. VM Host), sondern erlaubt es auch schnell eigene Baselines anzulegen oder auf automatisch angelegte (wie „letzte Woche“, „gestern“) zurückzugreifen und für Vergleiche zu hinterlegen.

 

SQLSentry contains a plethora of specialized components for different areas in SQL Server, of which some are also patented, but I will try to keep it short and just name the most particular ones:

  • The Event Calendar merges all SQL Agent Jobs but also Windows Tasks and striking Performance Events in an outlook-style calendar format, thus allowing for time correlations.

  • Intelligent Alerting allows you to define complex conditions – because oftentimes, singular Performance Metrics alone do not suffice for an evaluation. With this feature, they can be combined. And this is how Pro-Active Monitoring is possible (!).

  • The Disk-Activity view shows the SQL file usage in a detailed graphic representation.

  • The AlwaysOn Availability Group Visualizations show the architecture and utilization of the Availability Groups – in fact, what’s still missing is something comparable for Replication. :-)

  • Index- and statistics analysis – from fragmentation down to histogram level

  • Job Chaining – chaining processes of different components across servers
  • And of course, the Performance Dashboard itself: it shows not only the utilization of the server (Windows, SQL and possibly VM Host), but it also makes it possible to quickly create one’s own baselines or to rely on automatically created ones (like “last week,” “yesterday”) and save them for comparisons.  

 

 SQLSentry_performance-advisor_dashboard

Abgesehen von den reinen Features, welche für sich gesehen schon konkurrenzlos sind, gibt es 2 weitere Aspekte, welche für ein professionelles Performance-Monitoring-Werkzeug wichtig sind:

1.       Geringer Overhead auf das beobachtete System: Tatsächlich hat SentryOne als einziger Hersteller detaillierte Zahlen zu dem Impact auf den überwachten Server selber veröffentlicht - und dieser ist aufgrund der optimierten selbstentwickelten Technologie sehr gering – was man über andere Tools häufig anders hört.

 Apart from the mere features that are already in themselves unrivaled, there are at least 2 more aspects that are important to a professional Performance Monitoring tool:

  1. Low Overhead on the monitored system: As a matter of fact, SentryOne is the only manufacturer to have published detailed numbers on the impact on the monitored server – and due to the optimized self-developed technology, it is very low – unlike what you will often hear about other tools. 

 

SQL Sentry: Overhead Analysis: http://bit.ly/SQLSentryOverheadAnalysisDOC

 

2.       Update-Zyklen: Auch das ein wichtiger Aspekt. Das Tool wird ständig weiterentwickelt. 2-4 Updates im Jahr sind die Regel, und mit im Maintenance-Service inkludiert (wie auch der Support).

 2. Update cycles: Also an important aspect. The tool is continually being developed further. Generally, there are 2-4 updates a year, which are included in the maintenance service (as is support).
 

Das alles sind die Gründe, weshalb ich reinen Gewissens hinter meiner „Produktempfehlung“ stehen kann, wohl wissend, dass dieses auf hohem Niveau weitergepflegt wird.

Ich möchte damit allerdings nicht sagen, dass man nicht auch mal andere Tools in Erwägung ziehen sollte. Es kommt auf die eigene Umgebung an: Größe, Komplexität, Performance-Level, SLA (Reaktionszeit: Proaktiv, oder Reaktiv ausreichend?), und nochmal Zeit: Zeit, wichtige Korrelationen manuell durchzuführen, Zeit, sich bestimmte Visualisierungen selbst zu bauen. - Wer Zeit hat, für den mag eine Ersparnis von ~ 1 Consultant-Tagessatz (pro überwachten Server) sinnvoll sein, und ich würde mich auch nicht scheuen, dies ggf. selber zu empfehlen. Auch dafür kann man mich gern ansprechen. (Ich bin also keineswegs SentryOne gegenüber irgendwie verpflichtet.)

These are the reasons as to why I can back my “product recommendation” with a clear conscience, knowing well that this product will be further maintained and updated at a high level on an ongoing basis.

However, I do not mean to say that one shouldn’t also consider other tools from time to time. It depends on one’s environment: Size, complexity, performance level, SLA (reaction time: proactive, or is reactive sufficient?), and, again, time: Time to manually execute important correlations, time to build certain visualizations oneself. – For those with time on their hands, a saving of approx. 1 consultant day rate (per monitored server) may make sense, and I would not hesitate to recommend this myself. That’s also what I am here to help with. (So just to be clear, I am in no way obliged to SentryOne.)

 

Warum nun eine Master-Class zu SQLSentry?

Kommen wir nun zu der Eingangsfrage, nachdem das Tool der Wahl begründet ist:

Ganz einfach: Die Nachfrage. Ich habe mittlerweile einige Kunden, die mit SQLSentry arbeiten. Und da dieses Tool wie beschrieben umfangreich und mächtig ist, macht es hochgradig Sinn, den Umgang damit und die Konfigurationsmöglichkeiten im Detail zu erlernen, um die gesetzten Ziele:(Proaktives Monitoring, Zeit-effektives Troubleshooting, zu erreichen.

So why a Master-Class on SQLSentry?

Having justified the choice tool, let’s now turn to the initial question:

It’s simple: The demand. I have several clients by now who work with SQLSentry. Since this tool is comprehensive and powerful, as described above, it makes absolutely sense to learn the handling and configuration possibilities in detail in order to achieve the set goals: proactive monitoring, time-efficient troubleshooting.

 

Ich habe mich außerdem entschlossen, das Training ca. 50-50 aufzuteilen in native SQL Techniken und spezifische Bedienung von SQLSentry. Der Grund hierfür ist, dass meiner Meinung nach eine gewisse Kenntnis der internen Mechanismen und Beobachtungsmöglichkeiten von SQL Server zum einen dem Verständnis dienen, warum SQLSentry dies oder jenes so oder so macht, und zum anderen im Verlauf des praktischen Troubleshootings immer mal ein Ausflug auf den SQL Server direkt Sinn macht.

On top of that, I decided to split the training about 50-50 into native SQL techniques and specific handling of SQLSentry. The reason is that in my opinion, a certain knowledge of SQL Server’s internal mechanisms and monitoring possibilities serve, for one, the understanding of why SQLSentry does this or that in such and such a way, and, secondly, an occasional excursion directly to the SQL Server makes sense over the course of a practical troubleshooting. 

Daher werden wir sowohl mit dem Windows-Performance-Monitor, kurz Perfmon, Dynamic Management Views (DMVs), und Extended Events („Erweiterte Ereignisse“) arbeiten, die für Tiefenanalysen das Mittel der Wahl sind, und deren Verwendung hier erlernt wird. Für die Erkennung von Plan-Regression bietet sich natürlich die SQL Server Query Store an.

Mit all diesen Techniken werden wir uns verschiedene Szenarien ansehen:

·       Memory Probleme

·       Identifizieren von Plan Regression

·       Analyse von Indexen & Statistiken

·       Erkennen von I/O Latenzproblemen

·       Untersuchen von Tempdb-Performance

·       Locking & Blocking Analyse

·       Deadlocks

Therefore, we will be working with the Windows Performance Monitor (short: Perfmon), Dynamic Management Views (DMVs), and Extended Events, which are the tools of choice for In-Depth-Analysis, and whose use will be learned here. For the identification of Plan Regression, SQL Server Query Store of course lends itself for this purpose.

With all these techniques we will be looking at different scenarios:

  • Memory problems

  • Identifying Plan Regression

  • Analysis of Indexes & Statistics

  • Identifying I/O Latency problems

  • Analyzing Tempdb Performance

  • Locking & Blocking Analysis

  • Deadlocks

Wer sich noch einen der jetzt schon raren Plätze sichern möchte (innerhalb von 2 Wochen ist das Seminar bereits zu 70% ausgebucht, und dabei ist der Early-Bird-Tarif noch bis 23.5. aktiv), hier nochmal der Link zur Anmeldung und weiteren Infos:

If you would like to secure one of the rare spots (the seminar was already booked 70% within 2 weeks, even though the Early Bird Offer still applies until 23 May), below find once more the link for registration and further information:

 

SQL-Server-Master-Class.com/#PSS

 

bis bald  -- see you soon

Andreas

 

*Insider erkennen die Anleihe für „PSS“, das auch für „Product Support Services“ steht, und dass „PSS Diag“ ein Tool zum Sammeln von Performance-Daten ist, das auch das SQL Server PSS-Team verwendet ;-)

 

PS: Für diesen Blog-Post habe ich keinerlei Vergütung durch irgendeinen Hersteller erhalten ;-)

*Insiders will recognize the innuendo for “PSS,” which also stands for “Product Support Services,” and will also know that “PSS Diag” is a tool for collecting Performance data that is also used by the SQL Server PSS team ;-)

 

P.S.: For this blog post, I have received no remuneration whatsoever by any manufacturer ;-)

Where is that Preemptive Wait coming from? Database Ownership and Performance: a journey through SQL Server internals with XEvents, Windbg and Wireshark

 

(EN)
In this article I will bring together several techniques for troubleshooting a performance- and security-related “phenomenon” I recently noticed when doing some tests with Natively Compiled Stored Procedures.

(DE)
In diesem Artikel zeige ich einige Techniken zum Troubleshooten eines Performance- und sicherheitsrelevanten „Phänomens“, das mir kürzlich aufgefallen ist, als ich ein paar Tests mit Natively Compiled Stored Procedures durchführte.

Background:

In SQL Server 2014, Natively Compiled Stored Procedures did not support EXECUTE AS CALLER but EXECUTE AS “SpecificUser” was required. This user could be specified with “Username”, “Self” or simply “Owner” – in which case the owner of the procedure usually reverts to the schema owner, which mostly reverts to the Database Owner altogether.

Hintergrund: In SQL Server 2014 unterstützten Natively Compiled Stored Procedures EXECUTE AS CALLER nicht, sondern es war EXECUTE AS “SpecificUser” erforderlich. Dieser Nutzer konnte mit “Username”, “Self” oder einfach “Owner” spezifiziert werden – in dem Fall kehrt der Besitzer der Prozedurnormalerweise zum „schema owner“ zurück, was meistens ganz auf den Database Owner zurückkehrt. 

The phenomenon I encountered was that I noticed some pretty strange long execution times when running a workload consisting of a very basic stored procedure that does nothing more than insert one row of data into a small, unspectacular table.

The insert itself should run in less than a second for 1000 rows, but I could see up to 5 seconds.
The body of the procedure looks like this:

Das Phänomen, dem ich begegnete, war, dass ich einige ziemlich seltsam lange Ausführungszeiten bemerkte, als ich eine Workload laufen ließ, die aus einer sehr einfachen Stored Procedure bestand, die nichts weiter tat, als eine Datenreihe in eine kleine, unspektakuläre Tabelle einzufügen.
Das Insert selbst sollte weniger als eine Sekunde für 1000 Zeilen laufen, doch ich konnte bis zu 5 Sekunden sehen.
Der Inhalt der Prozedur sieht so aus:

 

SET NOCOUNT ON;
SET
XACT_ABORT ON;

INSERT UserSchema.TableName
      
(4 columns, int and char)
VALUES
      
(Parameters);

RETURN 0;

 

The analysis:

Since neither the query plan nor “Show Statistics ON” showed anything unusual, I took a step back and started a top-down-analysis with the Waits and Queues Methodology (which, if you are new in this area, has been a proven methodology for performance analysis for over a decade and is explained for SQL Server probably for the first time in detail here: SQL Server 2005 Performance Tuning using the Waits and Queues)
Using the new session-level waits-DMV in SQL Server 2016 (sys.dm_exec_session_wait_stats) I saw the following distribution of waits:

Die Analyse:

Da weder der Abfrageplan noch “Show Statistics ON“ irgendetwas Ungewöhnliches zeigten, ging ich einen Schritt zurück und begann eine Top-Down-Analyse mit der Waits and Queues Methode (die, wenn ihr in diesem Bereich neu seid, eine seit über einem Jahrzehnt bewährte Methode zur Performance-Analyse ist und für SQL Server wahrscheinlich zum ersten Mal im Detail hier erklärt wird: SQL Server 2005 Performance Tuning using the Waits and Queues)
Bei der Anwendung der neuen Session-Level Waits-DMV im SQL Server 2016 (sys.dm_exec_session_wait_stats) sah ich die folgende Waits-Verteilung: 

 

SELECT dm_exec_session_wait_stats.wait_type
       
, SUM(dm_exec_session_wait_stats.wait_time_ms) - SUM(dm_exec_session_wait_stats.signal_wait_time_ms) AS resource_wait_time_ms
       
, SUM(dm_exec_session_wait_stats.signal_wait_time_ms) AS signal_wait_time_ms
       
, SUM(dm_exec_session_wait_stats.wait_time_ms) AS wait_time_ms
       
, MAX(dm_exec_session_wait_stats.max_wait_time_ms) AS max_wait_time_ms
       
, SUM(dm_exec_session_wait_stats.waiting_tasks_count) AS waiting_tasks_count
FROM sys.dm_exec_session_wait_stats AS dm_exec_session_wait_stats
       
INNER JOIN sys.dm_exec_sessions AS dm_exec_sessions
                ON dm_exec_session_wait_stats.session_id = dm_exec_sessions.session_id
WHERE dm_exec_sessions.program_name ='Sarpedon-WorkoadSimulation-InsertProcs'
GROUP BY dm_exec_session_wait_stats.wait_type
ORDER BY max_wait_time_ms DESC;

 

From this list, Latch-contention, blocking and some waiting for IO is to be expected with a very concurrent workload (50 threads trying to insert on the last page).
The wait-types marked red are the ones that caught my attention.
As Preemptive waits are a quite different beast, and I initially thought maybe there was some authentication issue with the client, I decided to take a look at the CMEMTHREAD.

Von dieser Liste sind Latch-contention, Blocking und einiges Warten auf IO bei einer sehr simultanen Workload zu erwarten (50 Threads, die versuchen, sich auf der letzten Page einzufügen).
Die rot-markierten Wait-Typen sind diejenigen, auf die ich aufmerksam wurde.
Da Preemptive Waits ein spezielles Biest sind, und ich anfangs dachte, dass es vielleicht ein Authentifikationsproblem beim Client gab, entschied ich mich, einen Blick auf den CMEMTHREAD zu werfen.  

The CMEMTHREAD is an indicator that many threads are contending simultaneously for a thread-safe memory object.
Now since we are running a highly concurrent workload, I could just leave it at that, but remember: “Never make quick decisions by confusing symptom with cause”. Keep looking for the real cause. (A good article by Paul Randal on exactly this issue: “Avoiding Knee-Jerk Performance Troubleshooting”)

So, the question is, which memory object is so special here.

Der CMEMTHREAD ist ein Indikator dafür, dass viele Threads gleichzeitig um ein thread-safe Memory-Object konkurrieren.
Nun, da wir eine höchst konkurrierende Workload laufen haben, könnte ich es einfach darauf beruhen lassen, doch denkt dran: „Niemals schnelle Entscheidungen treffen, indem man das Symptom mit der Ursache verwechselt.“ Sucht weiter nach der wahren Ursache. (Hier ein guter Artikel von Paul Randal zu genau diesem Thema: “Avoiding Knee-Jerk Performance Troubleshooting”)

Also ist die Frage, welches Memory-Object hier so besonders ist.  

Time for Extended Events

One of the niftiest features of extended events is, that you can get a full stack dump of just a single thread, using the Action “sqlserver.create_dump_single_thread”. ”. Similarly, using “package0.callstack” you can get a callstack of the last 16 frames.
 You can analyze the outcome with Windbg. – Or, using Trace Flag 3656, you can even query the Extended Event targets directly with XQuery from within Management Studio and the callstack will be materialized, provided you have loaded the correct symbols. (Nothing you should do on a production Server!)
(An example how to do that can be found here: Resolving DTC Related Waits and Tuning Scalability of DTC)

With the dump opened in Windbg the following function calls inside the SQL Server engine can be seen:

Zeit für Extended Events

Eine der raffiniertesten Features von Extended Events ist, dass man einen vollständigen Stack Dump von einem einzelnen Pfad erhalten kann, wenn man die Action “sqlserver.create_dump_single_thread” verwendet.
Auf ähnliche Weise kann man einen Callstack der letzten 16 Frames erhalten, wenn man “package0.callstack” verwendet.
Man kann das Ergebnis mit Windbg analysieren – oder, wenn man Trace Flag 3656 verwendet, kann man sogar die Extended Event Targets direkt mit XQuery aus Management Studio heraus abfragen und der Callstack wird materialisiert. (Nichts, das man auf einem Produktions-Server machen sollte!)

(Ein Beispiel dafür, wie das gemacht werden kann, ist hier: Resolving DTC Related Waits and Tuning Scalability of DTC)

Mit dem in Windbg  geöffneten Dump können die folgenden Funktions-Calls in der SQL Server Engine gesehen werden:

 

 

The Stack dump rings a bell. Right before allocating the memory (CMemThread<CMemObj>::Alloc (red), several functions with very familiar names were called (orange):

Bei dem Stack Dump läuten doch einige Glocken. Kurz vor dem Zuteilen des Memory (CMemThread<CMemObj>::Alloc (rot) wurden mehrere Funktionen mit sehr bekannt klingenden Namen abgerufen (orange):

sqllang!CWindowsSecurityPrimaryInfo::GetNtGroupsViaAuthZ
sqllang!CreateLoginToken
sqllang!CreateLoginTokenForImpersonation

And those in turn must have been caused by the sqllang!CAutoExecuteAsContext::Set, sqllang!CMsqlExecContext::FExecute and so on (green).
At this point I pretty much knew where to look. But just to show you an example of how this can be done without even touching Windbg, here is an (accumulated and commented) result from the Extended Event callstack-Action:

Und diese wiederum müssen von sqllang!CAutoExecuteAsContext::Set, sqllang!CMsqlExecContext::FExecute verursacht worden sein, und so weiter (grün).
In diesem Moment wusste ich im Prinzip schon, wo ich suchen musste. Aber um euch ein Beispiel zu zeigen, wie man das auch machen kann, ganz ohne Windbg anzurühren, ist hier ein (gesammeltes und kommentiertes) Ergebnis der Extended Event Callstack-Action:  

 

  

This callstack results from the PREEMPTIVE_OS_LOOKUPACCOUNTSID Wait-Type, which I noticed would happen exactly once per procedure call. When analyzing different callstacks together I could draw the conclusion that the following function calls lead to the respective Wait-Types:

Dieser Callstack resultiert vom PREEMPTIVE_OS_LOOKUPACCOUNTSID Wait-Type, was, wie ich bemerkte, genau einmal pro Procedure Call geschehen würde. Beim Analysieren verschiedener Callstacks zusammen konnte ich die Schlussfolgerung ziehen, dass die folgenden Funktions-Calls zu den jeweiligen Wait-Types führen:

sqllang.dll!LookupAccountNameInternal -> PREEMPTIVE_OS_LOOKUPACCOUNTSID
sqllang.dll!CWindowsSecurityPrimaryInfo::GetNtGroupsViaAuthZ -> PREEMPTIVE_OS_AUTHZINITIALIZERESOURCEMANAGER
sqllang.dll!CWindowsSecurityPrimaryInfo::Init -> PREEMPTIVE_OS_AUTHORIZATIONOPS

The Preemptive Waits read from the Extended Events file-target can be ordered in their occurrence (from top to bottom), leading to the following picture:

Die Preemptive Waits, aus dem Extended Events Datei-Ziel gelesen, können nach ihrem Auftreten sortiert werden (von oben nach unten), was folgendes Bild ergibt:

 

 

The here unreadable callstack for the call to AUTHORIZATIONOPS (undocumented) on the bottom.

Der hier unlesbare Callstack für den Call AUTHORIZATIONOPS (undokumentiert) unten. 

 

First outcome:

From those calls one can deduct that not the client is authenticating at SQL Server, but actually the procedure call itself causes Windows API calls (LOOKUPACCOUNTSID, AUTHZINITIALIZERESOURCEMANAGER) for authentication purposes.
Now at the very latest it’s time to check the ownership-chain for the stored procedure.
So I checked the header of the proc, and indeed, just as I expected it contained a “WITH EXECUTE AS OWNER”.
That alone can’t be it, so the question is, who is the owner. I already suspected it and there it was: The database was owned by a LOCAL Windows account.
Now, that is rare, but it all makes sense now: For every execution of the procedure, the ownership had to be verified – and since it is a Windows-Account, it had to go out of SQL Server OS, using a Preemptive call to Windows, wait, and continue only after Windows returns control of this thread back to SQL Server.

Erstes Ergebnis:

Aus diesen Call lässt sich ableiten, dass es nicht der Client ist, der sich bei SQL Server authentifiziert, sondern dass es tatsächlich der Procedure Call selbst ist, der Windows API Calls (LOOKUPACCOUNTSID, AUTHZINITIALIZERESOURCEMANAGER) für Authentifizierungszwecke verursacht.
Spätestens jetzt ist es an der Zeit, die Besitzerkette für die Stored Procedure zu überprüfen. Also habe ich den Kopf der Prozedur geprüft, und tatsächlich, genau wie ich erwartet hatte, enthielt es ein “WITH EXECUTE AS OWNER”.
Das allein kann es nicht sein, also stellt sich die Frage, wer der Owner ist. Ich vermutete es bereits, und da war es: Die Datenbank gehörte zu einem LOKALEN Windows-Konto.
Nun, das ist eher selten, doch jetzt ergibt alles Sinn: Für jede Ausführung der Prozedur musste der Besitz verifiziert werden – und da es ein Windows-Konto ist, musste es raus aus SQL Server OS gehen, indem ein Preemptive Call an Windows verwendet wird, dann warten, und erst dann weitermachen, nachdem Windows die Kontrolle dieses Pfades an SQL Server zurückgegeben hatte.

 

Testing the improvement options:

Now, obviously, I did not stop here but rather made some more tests. Based on the fact that there are 3 possible types of owner for objects within SQL Server, I compared the execution times (and waits) between those 3 possible
Database owner-types:

1.       SQL Account

2.       Windows DomainAccount

3.       Local Windows Account

- I did also test with Admin vs. non-Admin and NTLM vs. Kerberos but saw no difference.

Testen der Verbesserungsmöglichkeiten:

Natürlich hörte ich nicht hier auf, sondern machte noch weitere Tests. Ausgehend von der Tatsache, dass es mögliche Typen von Owner für Objekte innerhalb SQL Server gibt, verglich ich die Ausführungszeiten (und Wartezeiten) zwischen diesen 3 möglichen Datenbank-Owner-Types:

  1. SQL Account
  2. Windows DomainAccount
  3. Local Windows Account

- Ich testete auch mit Admin vs. non-Admin und NTLM vs. Kerberos, stellte jedoch keinen Unterschied fest. 

So here is the result of the Performance-Comparison with different Database-/Procedure-Owners:

Hier ist also das Ergebnis des Performance-Vergleichs mit unterschiedlichen Datenbank-/Procedure-Owners:

 

 

 

Interpretation:

1)      The obvious: Using a local Windows Account results in a huge performance-penalty for such a simple INSERT-statement

2)      Using a Domain Account I could notice that every 10 minutes the next execution would be a bit slower.

Interpretation:

  1. Das Offensichtliche: Die Verwendung eines lokalen Windows-Kontos führt zu eine riesigen Performance-Impakt für ein solch simples INSERT-Statement

  2. Beim Verwenden eines Domain-Kontos konnte ich sehen, dass die nächste Ausführung alle 10 Minuten etwas langsamer war. 

Further analysis

When checking the Wait-stats again, I could see that usually the Windows-Domain-Account had the following simple waits:

Weitere Analyse

Beim erneuten Überprüfen der Warte-Statistiken konnte ich feststellen, dass der Windows-Domain-Account meistens die folgenden einfachen Waits hatte: 

 

 

 

Pretty ok and nothing to worry about. But the first call after 10 minutes would always result in the same wait-types as I observed for the local Windows Account, except that the wait-times are much much lower. (You can compare the below picture with the one from the beginning of the article.)

Ziemlich in Ordnung und nichts, worüber man sich Sorgen machen müsste. Doch der erste Call nach 10 Minuten ergab immer dieselben Wait-Typen, die ich für das lokale Windows-Konto beobachtete, außer dass die Wartezeiten um Vieles geringer sind. (Ihr könnt das Bild unten mit dem am Anfang des Artikels vergleichen.)

 

 

 

Behind the Scenes: Network Tracing

To explain the difference, I ran a Network Trace using Wireshark
And exactly every 10 minutes I saw some additional KERBEROS-traffic going to the Domain Controller. Below you see the opened data frame with the Request for a Ticket Granting Service Ticket (TGS-REQ).

Hinter den Kulissen: Network Tracing

Um den Unterschied zu erklären, führte ich ein Network Trace mit Wireshark aus.
Und genau alle 10 Minuten sah ich einigen zusätzlichen KERBEROS-Traffic zum Domain Controller fließen. Unten seht ihr den geöffneten Datenrahmen mit dem Request for a Ticket Granting Service Ticket (TGS-REQ).

 

 

 

Background infos:

As the User, on whose behalf the service requests the service ticket, is identified using the user name and user realm/domain (SQL\SQLDBOwner in my case), the padata type PA-FOR-USER is used, as you can see in the screenshot. You can even see the Checksum added for protection.

The S4U2self extension of the PA-DATA structure allows a service to obtain a service ticket to itself on behalf of a user. The user is identified to the KDC using the user's name and realm.

Hintergrundinformationen:

Wenn der Nutzer, für den der Service das Service-Ticket anfordert, unter Verwendung des Nutzernamens und user realm/Domäne (SQL\SQLDBOwner in meinem Fall) identifiziert wird, wird der Padata Type PA-FOR-USER verwendet, wie im Screenshot zu sehen. Man kann sogar die Checksum sehen, die zum Schutz hinzugefügt wurde.

Die S4U2self Extension der PA-DATA-Struktur erlaubt einem Service, ein Service-Ticket im Auftrag eines Nutzers für sich selbst zu beziehen. Der Nutzer wird gegenüber dem KCD identifiziert, unter Verwendung des Nutzernamen und Realm. 

Luckily the DC answers right away with a TGS-REP, containing the PA-DATA-structure with ticket for the service that was named in the TGS-REQ from above:

Zum Glück antwortet der DC sofort mit einem TGS-REP, der die PA-DATA-Struktur mit einem Ticket für den oben im TGS-REQ genannten Service enthält:

 

 

 

There is plenty literature available if you want to learn more about the Kerberos Protocol-Elements. Here is a documentation from Microsoft:

Es gibt eine Menge an Literatur, falls ihr mehr über die Kerberos-Protokollelemente erfahren wollt. Hier ist eine Dokumentation von Microsoft:

The 10-minutes puzzle:

1) After doing some extensive testing, I conclude that the 10-minute interval after which a new Ticket Granting Service Ticket-Request is initiated must be a SQL Server specific enhancement for Domain Accounts to avoid making this round trip for every SID-validation. The 10 minutes are consistent and independent from other workload influencers. The cause behind is not documented.

2) The much faster validation for the AD-Account is very fast thanks to some caching in Windows. (Thank you, Jack Richins from formerly SQL Security Team, for reminding me of this)

3) For the local Windows Account, there is no such performance improvement via caching which results in much slower response times.

Das 10-Minuten-Puzzle:

  1. Nach ausgiebigem Testen schließe ich, dass das 10-Minuten-Intervall, nach dem ein neuer Ticket Granting Service Ticket Request eingeleitet wird, eine SQL-Server-spezifische Erweiterung für Domain-Accounts sein muss, um diese Rundreise nicht für jede SID-Validierung machen zu müssen. Die 10 Minuten sind konsistent und unabhängig von anderen Workload-Beeinflussern. Die Ursache dahinter ist nicht dokumentiert.

  2. Die viel schnellere Validierung für das AD-Konto ist so schnell dank einigem Caching in Windows. (Danke, Jack Richins vom ehemaligen SQL Security Team, der mich daran erinnert hat)

  3. Für das lokale Windows-Konto gibt es keine solche Performance-Verbesserung via Caching, was zu viel längeren Antwortzeiten führt.

 

Final results and learnings:

1)      Using local users for SQL Server can create noticeable impact for short transactions. Yet another reason to stay away from local accounts.

2)      For the SQL Account, naturally no Windows calls are necessary at all, but the performance-advantage compared to the AD-Account is marginal, even for high-speed scenarios.

3)      Network latency matters even between SQL Server and DC. Not just for the initial Login-phase but even for ongoing validations from within SQL-statements.

4)      I can stick to my recommendation for Database Ownerships (SQL Server Database Ownership: survey results & recommendations) :-)

Endergebnis und Gelerntes:

  1. Die Verwendung von lokalen Nutzern für SQL Server kann deutliche Auswirkungen für kurze Transaktionen verursachen. Noch ein weiterer Grund dafür, sich von lokalen Konten fernzuhalten.

  2. Für den SQL Account sind natürlich keine Windows-Calls notwendig, doch der Performance-Vorteil gegenüber dem AD-Account ist geringfügig, selbst für High-Speed-Scenarien.

  3. Netzwerk-Latenz spielt selbst zwischen SQL Server und DC eine Rolle. Nicht nur für die anfängliche Login-Phase, sondern sogar für fortlaufende Validierungen innerhalb von SQL-Statements.

  4. Ich kann meine Empfehlung für Datenbank-Ownerships aufrechterhalten (SQL Server Database Ownership: survey results & recommendations) :-)

I hope you found this an interesting read.

Ich hoffe, dies war eine interessante Lektüre für euch. 

 

Andreas

 

PS: for the geeks among you:

The Stack Dump in Text format together with some comments:

P.S. Für die Geeks unter euch:

Der Stack Dump im Textformat mitsamt einigen Kommentaren:

 

Child-SP          RetAddr           Call Site

000000e9`2f0b79d8 00007ffe`f9e51118 ntdll!NtWaitForSingleObject+0xa

-> this function is actually deprecated (Hello, Microsoft?)

000000e9`2f0b79e0 00007ff7`04999fef KERNELBASE!WaitForSingleObjectEx+0x94
000000e9`2f0b7a80 00007ff7`04999d7d sqlservr!CDmpDump::DumpInternal+0x22f
000000e9`2f0b7b20 00007ff7`049a15b8 sqlservr!CDmpDump::DumpFilter+0xcd
000000e9`2f0b7c10 00007ffe`ef0ef2cb sqlservr!memset+0x1819
000000e9`2f0b7c40 00007ffe`fc98398d msvcr120!__C_specific_handler+0x93 [f:\dd\vctools\crt\crtw32\misc\amd64\chandler.c @ 162]
000000e9`2f0b7cb0 00007ffe`fc9493a7 ntdll!RtlpExecuteHandlerForException+0xd
000000e9`2f0b7ce0 00007ffe`fc948fbd ntdll!RtlDispatchException+0x197
000000e9`2f0b83b0 00007ffe`f9e58b9c ntdll!RtlRaiseException+0x18d
000000e9`2f0b8b70 00007ff7`04999c9c KERNELBASE!RaiseException+0x68
000000e9`2f0b8c50 00007ffe`f05602c6 sqlservr!CDmpDump::Dump+0x4c
000000e9`2f0b8c90 00007ffe`f105c411 sqllang!SQLDumperLibraryInvoke+0x1f6
000000e9`2f0b8cd0 00007ffe`f105ce94 sqllang!SQLLangDumperLibraryInvoke+0x161
000000e9`2f0b8d80 00007ffe`f102cd0b sqllang!CImageHelper::DoMiniDump+0x475
000000e9`2f0b8f90 00007ffe`f072e9c4 sqllang!stackTrace+0x9db
000000e9`2f0ba9b0 00007ffe`f072f6ae sqllang!XeSqlPkg::IsSystem+0x174
000000e9`2f0bab90 00007ffe`ef2e779a sqllang!XeSqlPkg::CreateDumpSingleThreadActionInvoke+0x1e

-> you can clearly see how this stack dump was created: XEvents

000000e9`2f0babc0 00007ffe`ef2a1b8e sqldk!XeSosPkg::wait_info_external::Publish+0x1a9

-> Now we will see our wait-type when we ask the DMVs or XEvents

000000e9`2f0bac20 00007ffe`ef2a63a4 sqldk!SOS_Scheduler::UpdateWaitTimeStats+0x596
000000e9`2f0bb530 00007ffe`f0d94fac sqldk!SOS_Task::PopWait+0xba
000000e9`2f0bb590 00007ffe`f0d9481e sqllang!CWindowsSecurityPrimaryInfo::GetNtGroupsViaAuthZ+0x75c

-> this will lead to the Preemptive Wait: PREEMPTIVE_OS_AUTHZINITIALIZERESOURCEMANAGER

000000e9`2f0bb890 00007ffe`f0d956ed sqllang!CWindowsSecurityPrimaryInfo::Init+0x2ce
000000e9`2f0bba00 00007ffe`f041a88b sqllang!GetWindowsSecurityPrimaryInfo+0xbe
000000e9`2f0bba60 00007ffe`f041cadb sqllang!CreateLoginToken+0x2d7
000000e9`2f0bbc50 00007ffe`f041dca8 sqllang!CreateLoginTokenForImpersonation+0xcb2

-> an Impersonation is happening (EXECUTE AS)

000000e9`2f0bc400 00007ffe`f0358342 sqllang!CAutoExecuteAsContext::Set+0xe2d
000000e9`2f0bc680 00007ffe`f001245e sqllang!CSECExecAsRuntimeServices::_Set+0x424
000000e9`2f0bc900 00007ffe`f0012041 sqllang!CMsqlExecContext::FExecute+0x336
000000e9`2f0bcc30 00007ffe`f0d1d83d sqllang!CSQLSource::Execute+0x983
000000e9`2f0bcdd0 00007ffe`f0d1d241 sqllang!CStmtExecProc::XretLocalExec+0x26e
000000e9`2f0bce50 00007ffe`f0d19f98 sqllang!CStmtExecProc::XretExecExecute+0x481
000000e9`2f0bd600 00007ffe`f00119ca sqllang!CXStmtExecProc::XretExecute+0x38
000000e9`2f0bd640 00007ffe`f0012933 sqllang!CMsqlExecContext::ExecuteStmts<1,1>+0x40d
000000e9`2f0bd780 00007ffe`f0012041 sqllang!CMsqlExecContext::FExecute+0xa9e
000000e9`2f0bdab0 00007ffe`f0cd3f6d sqllang!CSQLSource::Execute+0x983
000000e9`2f0bdc50 00007ffe`f0ce0e6c sqllang!ExecuteSql+0x93d
000000e9`2f0be7d0 00007ffe`f0ce1549 sqllang!CSpecProc::ExecuteSpecial+0x15c
000000e9`2f0be8d0 00007ffe`f001a82b sqllang!CSpecProc::Execute+0x299
000000e9`2f0bea00 00007ffe`f0021542 sqllang!process_request+0xe61
000000e9`2f0befd0 00007ffe`f00210a3 sqllang!process_commands_internal+0x2df
000000e9`2f0bf050 00007ffe`ef2a5bfd sqllang!process_messages+0x253
000000e9`2f0bf260 00007ffe`ef2a58f5 sqldk!SOS_Task::Param::Execute+0x231
000000e9`2f0bf860 00007ffe`ef2a554d sqldk!SOS_Scheduler::RunTask+0xaa
000000e9`2f0bf8d0 00007ffe`ef2cd7c8 sqldk!SOS_Scheduler::ProcessTasks+0x3cd
000000e9`2f0bf9b0 00007ffe`ef2cdb10 sqldk!SchedulerManager::WorkerEntryPoint+0x2a1
000000e9`2f0bfa80 00007ffe`ef2cdcd7 sqldk!SystemThread::RunWorker+0x8f
000000e9`2f0bfab0 00007ffe`ef2cd9f8 sqldk!SystemThreadDispatcher::ProcessWorker+0x2de
000000e9`2f0bfb60 00007ffe`fc6e13d2 sqldk!SchedulerManager::ThreadEntryPoint+0x1d8
000000e9`2f0bfc10 00007ffe`fc9603c4 kernel32!BaseThreadInitThunk+0x22
000000e9`2f0bfc40 00000000`00000000 ntdll!RtlUserThreadStart+0x34

EOF

Sessions submitted for major conferences 2016. Topics: Security – Performance – In-Memory

Vorträge für die großen Konferenzen 2016 eingereicht. Themen: Sicherheit - Performance - In-Memory

(DE)
Nach dem tollen Verlauf der deutschen SQLKonferenz im Februar, wo ich die Ehre hatte, zusammen mit Joachim Hammer, dem Program Manager der Security-Teams für die relationalen SQL Engines bei Microsoft in Redmond die neuen Sicherheitsfeatures des SQL Server 2016 vorzustellen (mehr Infos), habe ich nun endlich Zeit gefunden, die nächsten großen Konferenzen dieses Jahres anzugehen.

(EN)
After the great success of the German SQLKonferenz in February, where I had the honor of presenting the new security features of SQL Server 2016 together with Joachim Hammer, the Program Manager of the security teams of the relational SQL Engines at Microsoft in Redmond (more info), I finally found time to go about the next big conferences this year.

Für den PASS Summit 2016, der wieder in Seattle/USA stattfindet, und auch für den SQLServerGeeks Annual Summit 2016, der in Bangalore/Indien stattfindet habe ich insgesamt 6 Sessions aus den Themengebieten „Sicherheit“, „Performance Analyse“ und „In-Memory“ ausgearbeitet und eingereicht. Dazu kommen 2 ganztägige PreCons zum Thema „Sicherheit“ und „In-Memory“.
Wen es interessiert, zu sehen, was ich diesmal „in Petto“ habe, kann die Abstracts hier einsehen.

For the PASS Summit 2016 which is again taking place in Seattle/USA as well as for the SQLServerGeeks Annual Summit 2016 which is taking place in Bangalore/India, I worked out and submitted 6 sessions altogether from the subject areas “Security,” “Performance Analysis” and “In-Memory.” Added to that 2 full-day PreCons with the topics “Security” and “In-Memory.”
For whoever is interested to see what I have “up my sleeve” this time, can review the abstracts here.

 

Pre-Conferences:

SQL Server Security black belt – attack, protect and keep secure

Security Hardening is a subject which, sooner or later, every DBA will face. Microsoft SQL Server, according to the NIST vulnerability database the most secure RDBMS for years, contains many features that help keep the data secure on different layers. At the same time, ever-new applications which use databases on your servers, support-personnel, deployment-processes, auditors, and other processes and real people are constantly demanding access to your Server.

At this full-day pre-conference you will see how external and internal attackers can gain access to sensitive data. You will then learn how to secure the different attack surfaces of a typical SQL Server, and protect not only Data at Rest but also Data in Use and Data in Transit and learn best practices to prevent common vulnerabilities.

In the second part you will get to know fundamental security principles such as

  • Least Privilege;
  • Segregation of Duties;
  • Reconstruction of Events;
  • Delegation of Authority;

and you will learn how to use built-in functionalities of SQL Server (some limited to v2016) to build your own security frameworks to secure Deployment and Monitoring, separate Job-permissions; how to implement time-based permissions and which techniques can help reconstruct security-relevant events.

If you are in charge of creating or implementing security concepts or need a full picture of attack surface protection and concepts, this session is exactly right for you.

 

In-Memory in SQL Server 2016 – from 0 to Operational Analytics Hero

The Columnstore Index technology came with SQL Server 2012 in the form of Nonclustered Columnstore, and SQL Server 2014 brought us updatable Clustered Columnstore Indexes and a completely new In-Memory Engine for memory optimized table & indexes.

SQL Server 2016 is adding the updatable Nonclustered Columnstore Indexes that can both operate on row store as well as on memory-optimized tables, called In-Memory Operational Analytics. With the In-Memory engine being extensively improved in terms of both scalability and T-SQL language support, In-Memory will become a viable option in many projects.

On this training day, attendees will be given a complete picture on the current state of technology and how and where to use either In-Memory OLTP or ColumnStore or both for efficient queries and data store.

 

General sessions:

Extended Events – The Top Features for efficient Traces

Extended Events, which entered the product in SQL Server 2008, are replacing the old SQL Trace & Profiler - and there are many good reasons for that. In this session you will see a selection of the most fascinating possibilities using this Tracing Framework. If you want to find out how to trace in a flexible and lightweight way, how to do advanced analysis directly inside the GUI, how to audit Database and Table-access without Auditing, how to analyze deadlocks without old-fashioned TraceFlags based on the built-in system_health session, this session is just for you. You will also learn how to use the GUI in an effective way for top-down-analysis and what is possible with some XQuery scripting.

 

Performance Analyzing SQL Server workloads with DMVs and XEvents

This session you will be lead you through an example performance-analysis using mainly DMVs and Extended Events. You will see how a top-down analysis using built-in tools can be conducted. This will include wait statistics on different scopes to identify performance problems and bottlenecks up to identifying query plan changes – with & without using the Query Store of SQL Server 2016. If you are new to performance analyzing this session will give you a practical insight into how to methodically approach performance troubleshooting.

 

SQL Server 2016 – the evolution of In-Memory technologies

For SQL Server 2014 a completely new In-Memory Engine for memory optimized table & indexes was integrated into SQL Server with in fact very limited functionality.

For SQL Server 2016 the In-Memory engine is being extensively improved in terms of both scalability as well as T-SQL language support. Moreover the ColumnStore index technology has been improved and can now even be combined with memory-optimized tables.

This session will provide an overview of the new possibilities and demonstrate where a particular technology may help – or where you cannot expect benefits. If you are planning to go on SQL Server 2016 any time soon, this session shows you two of the most important features that SQL Server 2016 brings.

 

 

SQL Server Security black belt series: Securing Data

You have installed SQL Server and have heard about several “best practices,” maybe renamed the sa account, but now what?

In this session you will see demos of several methods how an attacker can get access to data in Use & in Transit and see which available built-in technologies provide help in mitigating such attacks. You will be given guidance on how to systematically identify possible threats and ne given best practices at hand.

Among the technologies that can be seen are Network sniffing, a Threat Modeling Tool, TDE and the new Always Encrypted technology of SQL Server 2016. This session is mainly targeting Administrators but many concepts and samples should be valuable knowledge for developers as well.

 

SQL Server Security black belt series: Securing Operations

You got SQL Server up and running and thought you could easily secure it by completely denying all access to everybody else except you and your co-admin, but you realize that there are many more individuals demanding access for daily or weekly operations. You have heard about “Segregation of Duties” and “Least Privilege” and are looking into how you can properly implement it with SQL Server.

In this session you will learn about techniques and approaches on how to implement secure processes in order to ensure both “Least Privilege” and “Segregation of Duties” and at the same time “Reconstruction of Events.” Among the techniques shown are “time based-permissions” and custom server roles for performance analysis and job-monitoring.

 

“SQL Attack…ed” – SQL Server under attack via SQL Injection

One of the most frequently attacked targets is the data that resides in a database server. SQL Server is considered “secure by default,” but this is only relevant until the first databases and configurations have been changed. This is why most of the exploited weaknesses are due to misconfiguration or weak coding practices as opposed to security bugs in SQL Server itself, of which we had only a few in the last 10 years.

In this purely demo-based session you will see samples of several real-life attacks, from mere reading up to disrupting service availability via various types of manual and automated SQL Injection, including a broadly unknown elevation of privileges attack for a non-sa account.

If you have a database-server which is accessible by processes beyond your direct control or which even can be reached by some kind of frontend applications, and you are unsure what the possible security implications to watch out for, this session is meant for you.

 

Ich werde natürlich posten, wenn meine Vorträge für 2016 feststehen. Vielleicht sieht man sich ja auf der einen oder anderen Konferenz. :-)

Of course I will post when my presentations for 2016 are fixed. Maybe you can meet me at one or another conference. :-)

 

Andreas

My conference-sessions in 2015: from Extended Events over In-Memory to Security

(en)
Finally I get to write about my conference-talks in 2015.

The year started really great with the German SQL Server Konferenz in Darmstadt with 2 sessions on In-Memory OLTP in SQL Server 2014 – one of them being even a full-day PreCon, which I co-presented with Niko Neugebauer,  who was talking about Clustered ColumnStore Indexes.

(de)
Endlich komme ich dazu, auf meine Konferenz-Vorträge dieses Jahr einzugehen.

Das Jahr begann gleich großartig mit der Deutschen SQL Server Konferenz in Darmstadt mit 2 Sessions zu In-Memory OLTP in SQL Server 2014 – eine davon sogar eine ganztägige PreCon, welche ich mit Niko Neugebauer co-präsentierte, der über Clustered ColumnStore Indexe sprach.

 PreCon: “In-Memory Internas: Clustered Columnstore & In-Memory OLTP Deep Dive”

Session: “In-Memory OLTP für Entwickler“ (In-Memory OLTP for Developers)

 

In March I was happy to have been speaker for the second time at the SQLBits in London -
probably THE event outside of PASS in Europe if not worldwide.
There I presented one of my favorite topics on Performancetools: Extended Events

Im März war ich glücklich zum zweiten Mal auf den SQLBits in London als Sprecher zu sein – wahrscheinlich DEM Event außerhalb der PASS in Europe wenn nicht weltweit.
Dort präsentierte ich zu einem meiner Lieblingsthemen zu Performancetools: Extended Events

 

Extended Events – Top Features

 

In April I joined the SQLDay Poland for the first time, giving a session on Locking & Blocking and a second session on Security, namely SQL Injection:

Im April war ich das erste Mal auf dem SQLDay Poland  , mit einer Session zu Sperren & Blockaden und einer zweiten Sessio zu Sicherheit, genauer SQL Injection:

 

From Locks to Dead-locks.  – Concurrency in SQL Server

“SQL Attack…ed” – SQL Server under attack via SQL Injection

 

For June I am happy to be able to announce that I will again present on Extended Events at the SQL Saturday #409 Rheinland/Germany. -
In fact I have already presented at the first German SQL Saturday in 2012 on Extended Events (“Tracing with SQL Server 2012 Extended Events”) – I hope this year it will be the final round to get even the last one off from the old & dusty SQL Profiler.

Added to that I am honored to give one of the 2 full day and free of cost PreCons: Together with Patrick Heyde, Microsoft (Technet-Blog), I will talk on SQL Server in Azure Environments. Specifically on how to optimally configure such a deployments to performance and cost-efficiency at the same time. (Also see my blog article “SQL Server in Microsoft Azure: How to gain performance by flexibility and save costs at the same time”)

Besides giving a free PreCon and regular session, my Company Sarpedon Quality Lab is again officially sponsoring this home-event. This is part of my commitment to the German PASS Community – especially since my own family starts taking more time, this is a bit of what I can do to support the PASS Deutschland e.V..

Für den Juni darf ich mich glücklich schätzen, bekanntzugeben, dass ich auf dem SQL Saturday #409 Rheinland wieder zu Extended Events präsentieren werde. – Tatsächlich hatte ich bereits auf dem ersten Deutschen SQL Saturday 2012 zu Extended Eventzs präsentiert
(“Tracing with SQL Server 2012 Extended Events”) – Ich hoffe dieses Jahr wird die letzte Runde sein, um auch den Letzten von dem alten & verstaubten SQL Profiler abzuholen.

Zusätzlich dazu fühle ich mich geehrt, eine der 2 ganztägigen und kostenlosen PreCons zu geben: Zusammen mit Patrick Heyde, Microsoft (Technet-Blog), werde ich über SQL Server in Azure Umgebungen sprechen. Und zwar, wie man solche Deployments optimal konfiguriert um sowohl Performance- als auch Kosteneffizient zugleich zu sein. (Siehe auch meinen Blog-Artikel “SQL Server in Microsoft Azure: Wie man durch Flexibilität Leistung gewinnt und zugleich Kosten spart”)

Abgesehen von der kostenblosen PreCon und regulärem Vortrag, ist meine Firma Sarpedon Quality Lab wieder offizieller Sponsor dieses Events. Das ist Teil meines Engagements für die deutsche PASS Community – speziell seit meine eigene Familie mehr Zeit beansprucht, ist das ein wenig dessen, was ich tun kann, den PASS Deutschland e.V. zu unterstützen.

 

PreCon: Hybrid IT – Azure Scenarios & Dynamic Infrastructure

Tracing with Extended Events – Top Features

-           If you are still using Profiler, or just started with XEvents, be sure to come along to see some of the nifty features ;-)

 

In September I will be at the SQLSaturday #413 Denmark in Copenhagen, organized among other by Regis Baccaro. I will be giving yet another PreCon on In-Memory OLTP and Clustered ColumnStore and a regular session on SQL Server storage.

Im September werde ich auf dem SQLSaturday #413 Denmark in Kopenhagen, organisiert neben anderen von Regis Baccaro, sein. HIer gebe ich wieder eine PreCon zu In-Memory OLTP und Clustered ColumnStore und eine reguläre Session zu SQL Server Speicher.

 

PreCon: New Index technologies: Clustered ColumnStore and In-Memory OLTP: the good and the bad

A journey into SQL Server Storage - from Memory to Disk

 

I hope to see YOU :-)

 Andreas

1 3