Blog Post

Creating a SQL Clone Image from a SQL Clone Database

,

A customer asked if a new image could be created from a database that was itself a SQL Clone. It can, and I’ll show that in this post.

This is part of a series of posts on SQL Clone, which is a virtualization product from Redgate Software.

Creating a New Image

To start with, I’ll look at the clones that I have deployed on a test server. As you can see below, I have a database, called “SimpleTalk”, on a local instance.

2023-09-29 15_52_52-Zoomit Zoom Window

I’m going to use this to create an image. First, I’ll click “Create Image” on the left. I’ll choose SQL Server, since I will use the existing cloned database as the source.

2023-09-29 15_53_00-SQL Clone

I pick the instance and database. As you can see, I’ve chosen the database that was listed above as a clone.

2023-09-29 15_53_10-SQL Clone

Next we skip the classification screen. This is a test db, so no data in there to worry about.

2023-09-29 15_53_14-SQL Clone

I’m not going to modify this, as this is a test.

2023-09-29 15_53_17-SQL Clone

Now I pick the destination, which is a local share.

2023-09-29 15_53_21-SQL Clone

I give this a name which differentiates from the original db and other images. I normally want to name all images as _new or _current for rotation purposes, but here I’m adding a test name since I’ll delete this right away.

2023-09-29 15_53_32-SQL Clone

You can see this start working.

2023-09-29 15_53_36-SQL Clone

And it completes in about the time for a restore. If I had added masking, this would run a little slower.

2023-09-29 15_53_59-SQL Clone

I have the image created, so it’s time to test this with a new database.

Validating the Image with a Clone

Click “Create clone” on the left menu and you get a dialog that asks for an image. I’ll pick the one I created above.

2023-09-29 15_54_06-SQL Clone

Once we chose the image, we can modify it. We won’t here.

2023-09-29 15_54_11-SQL Clone

Now we add an instance and a name. I’ve entered those below.

2023-09-29 15_54_24-SQL Clone

Once this completes, I can see this database, and my other clone in the SSMS Object Explorer.

2023-09-29 15_54_37-SQLQuery14.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (75))_ - Microsoft SQL Serve

If I query both databases, I get the same data, since I haven’t changed either one during this process. Note below that each one of these queries is from a cloned database.

2023-09-29 15_55_23-SQLQuery1.sql - ARISTOTLE.SimpleTalk Cloned Clone (ARISTOTLE_Steve (54))_ - MicrThe SQL Clone cloned database is just a database. SQL Server sees it as any other database, as SQL Clone presents the mdf/ldf/ndf as any other database. You can back it up like any other one.

If you are looking to save storage space for multiple copies of databases, or give each user a consistent copy in seconds, check out SQL Clone.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating