Author: way0utwest

  • Early Bird SQL Bits Pricing

    You can register today and save for the next few days. It’s only £799 for the full SQL Bits 2019 conference until Saturday. If you’ve ever  been, you know this is the best SQL Server conference out there, at least, that’s how I feel, and I go to a lot of conferences.

    I won’t be there next year, as I have a conflict. I’m sad, because I really look forward to this event every year. Fingers are crossed for next year, as I’m hoping to make a vacation of it with my wife.

    Go ask the boss and register today. The savings alone pay for some of your hotel. You know you want to go, and you’ll learn a lot. Microsoft has a large presence, so you can get some tech support for those pressing issues.

    There are always great sessions, from some of the top SQL Server experts in the world. You can see the submissions, and those alone should convince you this is worth the cost. Nowhere else can you get a four day conference for this price.

    Register for SQL Bits and then you can get to work on the really important stuff: picking a costume for the party Winking smile

  • Building Better Training Opportunities

    Recently I wrote a piece about some advice on quitting over training budgets, or the lack thereof. It had some interesting comments, but one stood out to me because it’s something I’ve heard and seen before. One of the readers noted that their company had bought a subscription for employees to learn new skills, but few of them had taken advantage of the courses.

    I’m not surprised. Many people are tired at the end of the day. Many people are fairly satisfied with their jobs. They’re not great, but not horrible, and we enjoy solving problems most days. Most of us would like to continue working where we are, in a stable situation. Not all of us, but many of us want to go to work and get paid for doing so, without a lot of motivation to do more.

    That’s fine, and I understand the pressures and stresses from the rest of life that weigh you down. I do understand that there are times that most of us would like to get away from work when we can and enjoy time with family, hobbies, faith, and more. My advice is that those things are important, but so is your career. Make some time to improve and grow your career and skills, even if you plan to stick with your current job. You never know when things will change.

    With that in mind, I think buying a subscription to Pluralsight or some other training option without providing any motivation or incentive is a poor plan. There needs to be some goals or expectations, and hopefully some sharing of the learning experience.

    If you need motivation, or you want to motivate co-workers, what about a competition? Challenge each other to complete a module of a course and write some code. Whether that’s to script installs with Chef, create a CI pipeline, count words with Python, or write faster T-SQL, if you have a goal, you’ll do better. I’ve had companies where we scheduled group watching of training, and with a small competition at the end, we found more people to be engaged and active in their learning.

    You could even make this a part of the review process, though please don’t just make this a checkbox. Ensure that if you want employees to learn something, you ask that they complete a class and contribute something back. Teach others, build something useful, or benefit the organization in some way.

    When there is a little more motivation, there’s a little more effort, and that can go a long way towards improving the skills of your workforce.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 3.5MB) podcast or subscribe to the feed at iTunes and Libsyn.

  • TDE and DDM

    Someone asked a question about TDE (Transparent Data Encryption) and DDM (Dynamic Data Masking), which are two different technologies that are in the security area. As I’ve mentioned in the Stairway to Dynamic Data Masking, DDM is not a security technology. It makes programming some obfuscation easy, but it’s not really security. It can be easily bypassed.

    In any case, how do these work together? Or do they work together? Good questions, and I’ll answer them.

    First, TDE is a technology that encrypts your data at rest, meaning when on storage devices. This handles the encryption and decryption as data is read or written from storage, without coding for it or the user having to do anything.

    DDM is a technology that takes results from a query and replaces some of the data with masked values. This works in memory, after a query runs. Query processing, with WHERE, GROUP BY, etc. clauses is not affected by DDM.

    These work together since data is encrypted on disk. It is read into RAM and decrypted. The query processor then assembles some of this data into a result set. Once this is done, before the results are sent to the client, DDM will make data.

    Demo

    I’ll setup TDE and then add DDM and run a query. Here’s a quick table and enabling TDE:

    CREATE DATABASE TDE_Primer;
    GO
    -- create and populate a table
    USE TDE_Primer
    go
    CREATE TABLE MyTable
    ( myid INT
    , myname VARCHAR(20)
    , mychar VARCHAR(200) 
    ) ;
    go
    DECLARE @i INT = 65;
    WHILE @i < 92
      begin
       INSERT mytable SELECT @i, 'Steve Jones', REPLICATE(CHAR(@i), 200);
       SELECT @i = @i + 1;
      END;
    GO

    From here, let’s enable TDE. If you have a master key in the master database, you’ll get an error, but it won’t really affect things.

    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'AlwaysU$eaStr0ngP@ssword4This';
    go

    -- create certificate to secure TDE
    CREATE CERTIFICATE TDEPRimer_CertSecurity WITH SUBJECT = 'TDE_Primer DEK Certificate';
    go

    USE TDE_Primer;
    GO
    -- Create DEK
    CREATE DATABASE ENCRYPTION KEY
    WITH ALGORITHM = AES_128
    ENCRYPTION BY SERVER CERTIFICATE TDEPRimer_CertSecurity;
    GO

    ALTER DATABASE TDE_Primer
       SET ENCRYPTION ON;
    GO

    Once this is done, let’s alter our table. We also need a user that isn’t privileged.

    ALTER TABLE dbo.MyTable ALTER COLUMN myname ADD MASKED WITH (FUNCTION = 'partial(1,"XXX",0)')
    GO

    CREATE USER JoeDBA FROM LOGIN JoeDBA

    GRANT SELECT ON dbo.mytable TO JoeDBA

    Now we can check the execution of a query.

    2018-11-14 10_37_40-Microsoft Edge

    Masked data with TDE.

  • Moving to Query Store

    In SQL Server 2016, Microsoft introduced the Query Data Store (QDS) as a tool that would capture data about the execution of queries inside of your database. This was a project that had been in the works for a number of years, and one that many of us that were bound by NDA agreements had been following. We were excited by the chance to actually gather some information on the.

    Are you using Query Store? You should be, as this tool will become more valuable over time. I know that there are potential overhead issues (3-5% for most people, but possibly larger). I would argue that the potential for better performance and understanding of our systems outweighs the overhead. After all, if we’re unwilling to devote some resources to measuring our systems, how do we really know what to improve?

    We upgraded the SQLServerCentral servers to SQL Server 2017 this year (2018), and I’ve been wanting to enable the Query Store. I’ve been slightly hesitant with over 75,000 air miles and 5,000 driving miles on the road since the upgrade. Being distracted and out of my routine isn’t the best way to document and carefully observe the effects of a change. Not to mention concerns over data leakage for a company bound by the GDPR. After a little discussion and debate, and my schedule slowing, I’m looking to change that soon.

    I don’t expect that a lot of improvement at SQLServerCentral from changing this, as our third party forums and much of the internal code is batch SQL, and quite a bit generated on the fly. However, there are some stored procedures, and I might be very wrong. While we’re over provisioned with resources to avoid any performance problems, I do expect that we’ll learn a few things. I hope we find places to better tune code, and with some documentation of the process, hopefully some of you out there might spot things our team doesn’t.

    If you’ve got stories of the QDS working well or not well, let us know. Certainly let Microsoft know as well. The QDS is a major part of the SQL Server platform improving in the future and there are enhancements in SQL Server 2019. While I don’t know that the QDS and some of the automatic tuning features remove the need for a data professional to watch a system, I’d like to think they do provide opportunities and insight for how we might better structure and develop applications, as well as help us find better patterns that are useful in our initial database coding.

    If you’ve got stories, Erin Stellato wants to know (and she has a few in the post). If you’re concerned about overhead, read her other post. If you’re confused, we’re working on some articles to help you learn more. Give the QDS a try, especially if you’ve got some less critical systems. Part of our job is learning how to use new tools, and this is one that ought to be on most DBAs ToDo list.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 4.4MB) podcast or subscribe to the feed at iTunes and Libsyn.