Tag: Redgate

  • Redgate Clone Graduating Images

    I wanted my own custom image in our internal Redgate Clone cluster, so I decided to make one. This is an overview of how this works.

    This is a series of posts on Redgate Clone, which is a way of quickly and easily creating ephemeral developer images of databases.

    Overview

    Usually a custom image comes from production, which is masked and subsetted, then available for devs. However, if you are working in greenfield development or want to experiment, you want to start somewhere. I decided to start with an empty instance and customize it.

    The process I followed is this:

    • create a blank container  (create)
    • make changes to the container
    • save the changes (save)
    • create an image from the container (graduate)

    I’ve added the RGClone commands in parenthesis after each of these steps.

    Creating a New Container

    We have an internal Redgate Clone cluster that many of our developers and teams use for spinning up database environments. I connected to this and created a data container using this command.

    rgclone create data-container –image empty-sql-current

    This is a blank image we have that contains SQL Server 2019 on it (current was a poor choice for naming) and no databases installed. As you can see below, this created the container and then returned the endpoint in a connection string, including credentials.

    2024- 08_ 0032

    When I then listed out the containers running, I could see mine below. It’s the last one, where the container name is the image with a random set of characters appended.

    2024- 08_ 0033

    Once this was done, I decided to connect to this instance and then customize things. This container is just a plain SQL Server instance, and appears like that on the network, so I connected to it in SSMS.

    Customizing things

    Once I connected, I could see this was a standard SQL Server instance, just as if I’d installed SQL Server on a VM.

    2024- 08_ 0038

    I had a script to create a database, so I ran that and created a new database and added some data. When I was satisfied with my changes, I decided to save this as a new image.

    Graduating the Image

    I don’t know why graduate was chosen as the verb, but it was. This means we’ll take an existing container and use it as the source for a brand new image. To do this, we follow a two step process: we save the container state and then create a new image.

    The first step is saving, and we use the save verb with the container who’s state we are saving. This creates a revision of this particular moment in time of what the container looks like. I didn’t include a version, since I was learning. The default is rev.x, where x is the next numeric version.

    Here’s the command and output.

    rgclone save data-container empty-sql-current-wyzpthav

    2024- 08_ 0034

    Now that I have a saved state, let’s use that to create a new image. I used the graduate verb here, but this didn’t work. There is an error that ran off to the side, which noted there was no revision number 1. That’s because the docs didn’t quite explain this, and I wasn’t sure.

    2024- 08_ 0035

    The better command is:

    rgclone graduate data-container empty-sql-curent-wyzpthav –revision rev.1 –name sql-2019-cu22-Northwind

    where we give the contained and the actual revision used (or returned from the save command. In this case, rev.1 is the revision. I also gave this a better name, which reflects the actual version of SQL Server.

    2024- 08_ 0036

    Once this was done, I could see my sql-2019-cu22-Northwind image in the list of data images. I could easily create a new container instance from this, which would be my starting point for more development work.

    Summary

    This is a basic look at how to use Redgate Clone to create custom images based on your work. Ideally, a bunch of this work would be automated, so we could get updated images of the current state of our development systems as we evolve and change our schema and data.

    There are ways to automate things, often starting with a backup, but if you have developers that might want or need to customize a container and want to deploy that to others, this is a way to do that.

    Redgate Clone is a part of our Test Data Manager solution, which includes the ability to also mask and subset your data.

  • Take the 2025 State of Database Landscape Survey

    The survey is out now and you can share your experiences for a chance at $250 in Amazon vouchers. No matter whether you think your org is great or not at managing databases, take the survey. Share some data.

    Last year, we had nearly 4000 responses and all the information is available here: https://www.red-gate.com/solutions/entrypage/state-of-database-landscape-2024/ 

    There were some interesting data points that came out of the survey. A few noticeable ones for me:

    • 43% of respondents support 4 or more database platforms
    • Skills are the top issue with people running multiple database platforms, not surprisingly. Since labor is a big cost, why keep adding platforms?
    • Synching app and database changes is the largest challenge reported by 31% of people. I’m glad it’s this low, but I suspect lots of people responding are proud of their work. People struggling might not fill out the survey.
    • 88% using the cloud, with 18% completely in the cloud
    • Only 20% of people using AI to manage databases. I wonder if this will grow for 2025.

    I’m looking forward to seeing the data from this year and if anything has changed.

    Take the survey today and good luck winning $250.

  • Friday Flyway Tips: Git Integration in Community Edition

    Redgate added Git integration to the free, Community edition of Flyway Desktop. I saw the announcement and decided to make this post to show how this can work for a new project.

    We do need git installed, so head over to the free git download if you don’t have it. From there, install Git and you’re ready to go.

    I’ve been working with Flyway Desktop for work more and more as we transition from older SSMS plugins to the standalone tool. This series looks at some tips I’ve gotten along the way.

    Source Controlling Your Project

    When you start Flyway Desktop Community, you should see the edition in the upper left, as shown here.

    2024-08_0054

    I’ll click Open project, and choose one of my existing projects. When I do that, I see all the migrations in the project. I can also select or add a target and run flyway commands from here.

    2024-08_0055

    What’s new is the right hand sidebar, which now has the VCS controls. If I click the left arrow in the upper right, I get the sidebar to expand. I can see I don’t have any changes. This bar wasn’t available previously, but now it is.

    2024-08_0057

    Let’s make a change. I’ll close this (click the arrow at the top) and return to the migrations screen. I’ll click the “add migration” button (the arrow points to this in the image below).

    2024-08_0058

    When the editor opens, I’ll add some code. I’ll also change the name. Notice there are no changes in the right sidebar.

    2024-08_0059

    When I save this, all of a sudden, there is a single change in the middle of the bar.

    2024-08_0060

    Expanding the sidebar and clicking on the middle icon, I see my one change has been added as a migration script.

    2024-08_0061

    I can add a comment and commit this or continue working. When I’m done committing, I can easily push my changes from here to the remote.

    I’m manually managing scripts in Community Edition, but I can do it all from Flyway Desktop, including all the version control work.

    Flyway Enterprise

    If you want to get more from Flyway, try Flyway Enterprise out today. If you haven’t worked with Flyway Desktop, download it today.

    If you use the CLI Flyway Community, download Flyway Desktop and get a GUI for your migration scripts as well as version control.

    Video Walkthrough

    No video walkthrough this week as I’m on the road.

    You can check out all the Flyway videos I’ve recorded.

  • Monday Monitor Tips: Changing the Fragmentation Alert

    I had a customer that was concerned about the fragmentation alert for indexes and wanted to know how to change it. This post discusses the change.

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

    Finding Alert Configuration

    The settings for Redgate Monitor are available with the gear icon in the upper right side the menu area. You can see this below.

    2024-07-22 16_52_18-ssc-db-n3_(local) - Server Overview — Mozilla Firefox

    Click this to get a list of settings. The second section below has the alert settings, which you can see here. Click this.

    2024-07-22 16_53_49-Zoomit Zoom Window

    This brings up a long list of alerts that are a part of Redgate Monitor. Scroll down a bit and you will see a fragmented indexes alert.

    2024-07-22 17_11_54-Alert settings _ All Servers — Mozilla Firefox

    If you click this, you may see this, as the alert is disabled. This has not proven to be a very useful alert for most organizations, so it’s off. However, you can click the “customize” radio button.

    2024-07-22 17_12_05-Edit Alert Configuration — Mozilla Firefox

    When you do this, you should then see the alert settings. This is defaulting to all your servers, but you can customize the level of alerting by clicking on the left side to a server or group. I’ll cover that in another post.

    The key things here are that you can exclude read-only databases, as the fragmentation won’t change. Below that, you see there is a medium alert specified at a default of 60%. You can change the low/med/hi with the drop down as well as the percentage in the spinner.

    2024-07-22 17_12_19-Edit Alert Configuration — Mozilla Firefox

    If you want more than one alert, flip the “Use multiple alert threshholds” button and you’ll see three choices. I might suggest you not do this as if you worry about fragmentation, it’s likely only a low or medium alert.

    2024- 08_ 0029

    At the bottom, you can set a minimum index size. Smaller indexes aren’t a problem, so keep this relatively high. You might have to decide if 1000 pages is really high enough.

    Below this, you can set your notifications for this. In general, use the defaults and don’t customize this for an alert. The changes get hidden and people forget. Use the same settings everywhere.

    That’s about it. However, read these thoughts from Jeff Moden before you get too worried about index fragmentation.

    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.