Chubold My Clone Zone

  вторник 16 октября
      29

If you have a very large database, up to 2TB in size, will let you copy, or clone, that database many times, very quickly, making the full database available in multiple SQL Server instances across your development and test environments. And yet in each of these instances, the cloned database takes up only a few tens of megabytes, and creating the clone takes seconds, rather than minutes or hours. How is it possible that the cloned databases could be so small and lightweight, and yet behave exactly like any normal database, complete with all the data?

Is a clone like a snapshot? Are we using some strange compression techniques?

Tag: Category: Gay & Yaoi. Crash Bandicoot - Not So Tiny Anymore. Arionne's Legendary Blessing. Aggressive Buff Haida.

It sounds like magic, but it’s not; SQL Clone does all this by making clever use only of technologies built into Windows. The Heavy Lifting of Traditional Database Provisioning All developers and testers would like to work with a database that is as close as possible to production, in terms of data volume and distribution. There are many advantages to being able to perform integration and acceptance testing with realistic production-like data, from as early as possible in the development cycle. However, for databases of any size, this means copying a lot of bytes of data onto every development or test environment that needs a copy of the database. It also usually means a slow, manual process of restoring the latest backup of the production database onto each of the target SQL Server instances.

Figure 1 shows a 200GB production database that we’ve restored to both the QA and Development environments, therefore requiring 600GB of disk space in total. Each of the orange squares represents the same 10GB block of data in the MDF and LDF files (the blocks in this diagram are purely conceptual). The red square represents data that has been modified in the QA environment.

Part of the problem is that we’re copying around the same bytes, unchanged, again and again. We might, in the QA environment, for example, make a few changes to the data, to perform scenario testing. Likewise, in development, we might make a few changes to get the data into a state where you can reproduce a bug. However, the rest of the data will be the same. Database Provisioning With SQL Clone The simple answer to the question why is a clone is so small? Is that SQL Clone uses disk storage virtualization technologies, built into Windows, to remove the need to copy of all these same bytes onto each instance. Instead, SQL Clone works to virtualize the data on each instance.

SQL Clone creates one full copy of all the data and metadata that makes up the source database. This is called an image. We copy the bytes only once. From this image, it can then create clones on each of the QA and Development SQL Server instances. Each clone has access to all those same bytes by reading from the image.

The only data stored locally for each instance are data pages containing changes made directly to the local clone database. In Figure 2, we have around 10GB of data changes in the QA clone, so that clone is roughly 10GB in size. Currently, there are no changes made to the Development clone, so it’s negligible in size. Of course, there is some overhead associated with managing clones, and there may be local changes made to the clone if, for example, SQL Server had to upgrade the database version to create the clone on that instance. However, it will still only a be few tens of MB in size. In short, virtualizing the data allows us to reuse the data in the image in each clone rather than copying them around to every environment. This means we have a very lightweight way to create as many clones as we like, in as many SQL Server instances as we like.

Remember that the more local changes you make, the bigger the clone will grow. Each time you modify a row, the page containing that row is copied locally. If you decided to rebuild every index on the database, for example, this will result in copying a lot of data pages from the image file into the clone. Working With Clones We can use a clone just like any normal database: we can read and modify data in the clone, perform standard operations such as, and so on. How does this work though, if there is little, or no, data in the clone?

In fact, it’s reading any changed data pages from the local clone and all other data pages from the remote image. All of this is completely transparent to SQL Server; it just sees the full 200GB database. Ask SQL Server to perform a database backup of a clone, and it will perform just a normal database backup of all 200GB. Under the covers, SQL Clone is using standard disk virtualization technologies to ‘trick’ SQL Server into thinking all the data is local. Let’s see how all this works in more detail. How SQL Clone Works SQL Clone uses no bespoke technologies; it’s all done using the 64-bit virtualization technologies built into the Windows operating system. The image is just a Virtual Hard Disk (VHD) mount point, which holds the copies of the MDF and LDF files from the source database.

Cak mocni Amerikanci imaju zestoke probleme zbog „sequestration.“ Mnogo nijihovih jedinica I ne lete neki dio vremena. Rukovodstvo po materialjnoj chasti i ekspluatacii tanka t 55 plus. A drzave Hrvatska su jos losija – 50 satova na godinu je dobar rezultat. Sumnjaju da je ovo jedan od razloga mongo katastrofalnih sudara (naprimjer sudar 2 Ch-53 helikoptera prije par godina). Francuzksa naprimjer ima problem sto mnogo lovackih pilota ne lete cak 120 sati na godinu. Odlucili su da ce ti piloti letjeti trenazne avione poput PC-21 za neko vrijeme (ne znam da li su ovo postigli jer PC-21 nije narucen).