Tag: Redgate

  • Grouping by Object Type in SQL Compare

    A customer recently was asking about grouping objects by type to see all the differences in two databases for one set of objects, like all stored procedures. This post shows how this works and what this changes for your system.

    This is part of a series of posts on SQL Compare.

    I have two databases, Compare_1_Source and Compare_2_Destination. I made a number of changes to the Source db and when I run SQL Compare between these, my default view shows me the different objects, as well as those in one database and not in the other. You can see this below.

    Screenshot 2024-07-31 170641

    This is the way most of us want to make changes, by deciding from this short list what changes to deploy. If you look closely, you can see there are 115 objects that are identical, so it’s nice to be able to see what has changed.

    However, I have had a few people ask to see all the stored procs that have changed, so they can decide what needs to move. They aren’t ready for table changes.

    In the upper right corner, above the destination database, I have a drop down for grouping options. I can use the default (type of difference), switch to type of object, or have no grouping.

    Screenshot 2024-07-31 171350

    If I choose object, I see this grouping. In here, the stored procedures are expanded, showing my differences. Second, in the middle, near where the checkboxes are for object selection, I see a count of how many objects are selected, and how many are changes. However, I don’t know the type of change.

    Screenshot 2024-07-31 171501

    I’ll modify a procedure and delete one and I see something slightly different. Now I see the object name to the right side of the checkbox, so I can infer a change if the name is on both sides, or a delete if there is an “x” next to the name.

    Screenshot 2024-07-31 172047

    My default view of tables is shown below. Note that my table changes are mixed within non-changed tables.

    Screenshot 2024-07-31 171517

    However, I can click on the Last modified column and resort the data. If I sort descending, then I see my table changes at the top.

    Screenshot 2024-07-31 172416

    Toggling these settings allows me to see different views. If I just want changes without groups or differences, then I can set no groups and see this (I’ve sorted by modified date).

    Screenshot 2024-07-31 172450

    I have a request to hide the unchanged objects, but that’s not something we do now, nor am I sure we will change things. You can submit your own ideas on Uservoice and get some votes from friends.

    SQL Compare is an amazing tool that millions of users have enjoyed for 25 years. If you’ve never tried it, give it an eval today and see what you think.

  • Monday Monitor Tips- Enabling Index Tracking in Redgate Monitor

    There is a new index feature in Redgate Monitor, but it’s disabled by default. This post shows how to enable things.

    This is part of a series of posts on Redgate Monitor. Click to see the other posts

    Getting Indexing Information

    If you look on monitor.red-gate.com, inside the details for one of your instances, there is a new Indexing tab. I’ve circled it below.

    2024-07-02 15_00_39-ssc-db-n3_(local) - Server Overview — Mozilla Firefox

    After clicking this, I see the data below for this instance. This shows me a lot of high level information usage on different indexes. The data shows index, then table, then database, but I can search/filter here. I can also sort by the columns, which contain size, updates, seeks, etc. Lots of data.

    2024-07-02 15_03_21-ssc-db-n3_(local) - Server Overview — Mozilla Firefox

    This is disabled by default, as the collection of this data used a lot of memory on the Base Monitor system for some users. Not necessarily something everyone wants, so we left it off.

    You can, however, enable it.

    Enabling Index Data

    There is a doc page for this feature, which I show below. This is a fairly easy procedure, but not everyone knows how to do this, so I’ll explain.

    2024-07-02 15_05_48-Indexes - Redgate Monitor 14 - Product Documentation

    If you look above, in the warning box, it notes how to enable this. From the base monitor, you need to add an environment variable.

    To do this on Windows, the easy thing is search the start menu for “environ”. You should see something like this. Pick the “edit the system environment variables” item at the top.

    2024-07-02 15_08_19-Media Player

    This should bring up the System Properties in Windows (desktop or server). You can also search for environment variables in the Control Panel. Earlier version of Windows let you right click the system and select properties.

    Notice the Environment Variables button at the bottom. We’ll click this.

    2024-07-02 15_08_59-System Properties

    This brings up a dialog that has two sections. We want the bottom, system variables, section. Click the New button at the bottom, below this list of system variables.

    2024-07-02 15_10_42-Environment Variables

    In the dialog, paste this in the variable name: SQLMONITOR_Indexes

    For the value, add “on”. I’m not sure if this is case sensitive, but past in lower case.

    2024-07-02 15_18_52-New System Variable

    Then you need to restart both the base monitor and the web server. This is in the Service Applet, where you can see the Base Monitor and the Web Service.

    Note: depending on versions, you might see this as “SQL Monitor Base Monitor” or “Redgate Monitor Base Monitor”.

    2024-07-02 15_23_01-LiveLabConnection (1) - 3.254.186.109 - Remote Desktop Connection

    Restart both of these services.

    When things come up, you’ll see blanks until some index data can be captured, but be patient and check back in an hour or two.

    Make sure you monitor memory usage on your base monitor machine. If you find yourself running low, you can disable this by setting the system variable to off. Or delete it.

    Or add more RAM. More RAM cures a lot of things.

    Redgate Monitor is a world class monitoring solution for your database estate. Download a trial today and see how it can help you manage your estate more efficiently.

  • The Redgate Summit: New York

    The final 2024 Redgate Summit in the US takes place in a few weeks, on Aug 21. Redgate Summit: The Database Landscape is coming to the Microsoft Office at Times Square in New York City and I’m excited to be going.

    You can register today and join us for a full day of learning about DevOps, database development and management, and how to build better software. We have three tracks, each full of events for the day.

    • New and Future Technologies
    • Deep Dive Solutions
    • Leadership

    We have both Redgaters and industry experts on hand to deliver a wide range of sessions and panels. I’m not sure what I’m doing yet, but I’m sure I’ll be assigned a few of the TBD speaker slots.

    Hopefully you can come enjoy a fun day in Manhattan in a few weeks. Tell your boss you want to learn how to better build and manage database software and head to the City. Then register and say hi to me in a few weeks.

  • Monday Monitor Tips – Adding Redgate Monitor Custom Metrics from SQLMonitorMetrics

    This post talks about adding custom metrics from the sqlmonitormetrics.com site automatically and how this works (and how it doesn’t).

    This is part of a series of posts on Redgate Monitor. Click to see the other posts

    What is SQL Monitor Metrics?

    SQLMonitorMetrics was a site that Redgate built years ago to hold various community submitted metrics that users of Redgate Monitor (formerly SQL Monitor) might care about or be interested in using. Myself, Grant, and a number of other MVPs and SQL Server experts submitted our own metrics in various categories.

    At some point an integration was created to make the install of these metrics easy. This post shows how to do this and not to do this below.

    How to Auto Install Metrics

    The proper way to install metrics is to start in Redgate Monitor. Go to the config screen by clicking the gear in the upper right.

    2024-07-02 14_37_58-Global Dashboard — Mozilla Firefox

    Next, in the Alerts section pick the custom metrics and alerts item. Click this.

    2024-07-02 14_38_43-Configuration — Mozilla Firefox

    This brings up a list of your custom metrics. In the text at the top, it says you can install a metric automatically, but you need to click the link my cursor is highlighted on below.

    2024-07-02 14_39_14-Custom metrics and alerts — Mozilla Firefox

    This brings me to the sqlmonitormetrics site. I’ll click find a metric. I could also click the Custom Metrics at the top.

    2024-07-02 14_40_42-Redgate Monitor Metrics - Custom metrics to use in Redgate Monitor — Mozilla Fir

    I’ll select the first one for this post, but you can filter, search, or scroll around to find one.

    2024-07-02 14_40_51-Custom Metric Archives - Redgate Monitor Metrics — Mozilla Firefox

    The page for the custom metric has a button at the top. Please read the page and test the SQL to see what’s returned before you click this, but when you’re ready, click the button.

    2024-07-02 14_42_59-Detecting Connection Timeouts - Redgate Monitor Metrics — Mozilla Firefox

    When I do this, I’m returned to Redgate Monitor, this time on the Create Custom Metric page, with the fields filled in. As with anything, be sure you review and check to be sure this is what you want.

    2024-07-02 14_43_49-Custom metrics — Mozilla Firefox

    That’s it. When you’re done, click create and your metric and/or alert will be set up.

    How Not to Install Metrics

    This works, but it’s a pain. If I go directly to https://sqlmonitormetrics.red-gate.com/ and then find a metric, such as the number of active backups and restores, I see this, an inactive button:

    2024-07-02 14_45_56-Number of active backups and restores - Redgate Monitor Metrics

    Because I didn’t start from Redgate Monitor, I can’t get this automatically.

    If I scroll down, I see all the fields (in bold) and the entries. I can copy/paste all of these into the form, but this is a slow way to add metrics.

    2024-07-02 14_46_45-Number of active backups and restores - Redgate Monitor Metrics

    Don’t do this. Go to Redgate Monitor and start there (as shown above).

    Summary

    This post shows how to automatically add custom metrics written by others from the sqlmonitormetrics website. This is a good way to add common checks to your system that others use.

    If you see something missing, submit it, or ping me and I’ll write it or find someone else to do so.

    Redgate Monitor is a world class monitoring solution for your database estate. Download a trial today and see how it can help you manage your estate more efficiently.