cesium 风向数据_风向标; 针对“实时”生产数据SQL Server开发/测试数据库克隆

cesium 风向数据

介绍 (Introduction)

Today, with DevOps, the need for database cloning is urgent. The development and testing process is shorter and it is required to work and test the data faster.

如今,借助DevOps,迫切需要数据库克隆。 开发和测试过程更短,并且需要更快地工作和测试数据。

How can we test a Database that is already on production and online? The answer is database cloning.

我们如何测试已经生产和在线的数据库? 答案是数据库克隆。

什么是数据库克隆? (What is database cloning?)

Database cloning allows to clone a database. This is a writable replica that can be used for testing, development, and is delivered in seconds, with minimal storage consumption.

数据库克隆允许克隆数据库。 这是一个可写副本,可用于测试,开发,并在几秒钟内交付,而存储消耗最小。

In this article, we will talk about Windocks. This software provides the ability to clone SQL Server databases (also named volume snapshots). With Windocks you can create clones of your database with minimal disk consumption, and work with the database clones with SQL Server containers or conventional instances.

在本文中,我们将讨论Windocks 。 该软件提供了克隆SQL Server数据库(也称为卷快照)的功能。 使用Windocks,您可以以最少的磁盘使用量创建数据库的克隆,并可以使用具有SQL Server容器或常规实例的数据库克隆。

什么是Windocks? (What is Windocks?)

Windocks is a port of of Dockers’s source to Windows used to create SQL Server containers. Docker is mainly Linux based whereas Windocks is specialized in the Windows market.

Windocks是Dockers的源代码移植到Windows的端口,用于创建SQL Server容器。 Docker主要基于Linux,而Windocks专业于Windows市场。

Windocks SQL Server images are based on a local installed instance, which is cloned to deliver a SQL Server container, with support for all editions of SQL Server version starting at SQL Server 2008.

Windocks SQL Server映像基于本地安装的实例,该实例被克隆以提供SQL Server容器,并支持从SQL Server 2008开始的所有版本SQL Server。

Windocks is also a database cloning solution, and supports the creation of clonable database images from storage arrays or SQL Server backups and Windows Virtual Hard Drives (VHDs). Database clones are writable, and are delivered in seconds even for large databases. Windocks supports the delivery of clones to SQL Server containers, as well as SQL Server instances, and even SQL Server Linux containers.

Windocks还是数据库克隆解决方案,并支持从存储阵列或SQL Server备份以及Windows虚拟硬盘(VHD)创建可克隆的数据库映像。 数据库克隆是可写的,即使是大型数据库也可以在几秒钟内交付。 Windocks支持将克隆传递到SQL Server容器,SQL Server实例甚至SQL Server Linux容器。

图像和容器之间有什么区别? (What is the difference between an image and a container?)

Basically, images define what is delivered (based on a Docker file). Images can deliver a SQL Server container, or a SQL container with database cloning, or a database clone that is for use with a SQL Server instance. A SQL Server container is a SQL Server instance.

基本上,图像定义了交付的内容(基于Docker文件)。 图像可以传递SQL Server容器,带有数据库克隆SQL容器或与SQL Server实例一起使用的数据库克隆。 SQL Server容器是一个SQL Server实例。

SQL Server的Windocks容器 (Windocks containers for SQL Server)

The Windocks containers are handled like SQL Server instances. SQL Server licenses allow for unlimited “instances” created by cloning a licensed installed instance, so Windocks SQL Server containers are “free” under existing MS licenses.

Windocks容器的处理方式类似于SQL Server实例。 SQL Server许可证允许通过克隆许可的已安装实例创建无限的“实例”,因此在现有的MS许可证下,Windocks SQL Server容器是“免费的”。

Windocks是Docker的一部分吗? (Is Windocks part of Docker?)

No, Windocks is an independent company that ported the Docker source technology for SQL Server Database Cloning.

不,Windocks是一家独立公司,已将Docker源技术移植到SQL Server数据库克隆中。

容器是否正在取代虚拟机? Docker是否正在取代虚拟机? (Are the Containers replacing the Virtual Machines? Is Docker replacing the Virtual Machines?)

Yes and no. Each VM runs a full operating system, which requires CPU and RAM. Containers make it practical to run up to 20 or more containers on a single host. Windocks reports that clients typically use a 4 core machine with 32 GB of RAM to support 20 or more containers. So, most users reduce the use of VMs for dev/test by up to 5-10:1.

是的,没有。 每个VM运行一个完整的操作系统,这需要CPU和RAM。 容器使在单个主机上运行多达20个或更多容器成为现实。 Windocks报告说,客户端通常使用具有32 GB RAM的4核计算机来支持20个或更多容器。 因此,大多数用户最多可将VM用于开发/测试的使用量减少5-10:1。

For testing and development, it is recommended for containers to run on a VM.

为了进行测试和开发,建议容器在VM上运行。

入门 (Getting Started)

Let’s start with it. We will use the free Community edition of Windocks for database cloning that you can download here:

让我们开始吧。 我们将使用免费的Windocks社区版进行数据库克隆,您可以在此处下载:

The scenario is the following. We have a live database in production, but we need to test that live database in different environments. We need to clone the production database for the QA team and for the developers. We have 20 QAs and 30 developers and each one needs a clone of the production database. To have 50 VMs would require many resources and time, so that is why we need a Database cloning software. We need to clone the database easily, automatically, and efficiently.

情况如下。 我们在生产中有一个实时数据库,但是我们需要在不同的环境中测试该实时数据库。 我们需要为质量检查团队和开发人员克隆生产数据库。 我们有20个质量检查人员和30个开发人员,每个人都需要一个生产数据库的克隆。 拥有50个虚拟机将需要大量资源和时间,因此这就是为什么我们需要数据库克隆软件的原因。 我们需要轻松,自动和高效地克隆数据库。

安装软件 (Installation of the software)

The software installation is simple. You just need to check the following:

该软件的安装很简单。 您只需要检查以下内容:

  • Windocks supports Windows 8.1 and 10 Professional or Enterprise editions, Windows Server 2012 R2, and Windows Server 2016

    Windocks支持Windows 8.1和10专业版或企业版,Windows Server 2012 R2和Windows Server 2016
  • A locally installed SQL Server instance, from SQL Server 2008 or later

    来自SQL Server 2008或更高版本的本地安装SQL Server实例
  • Use a local machine administrator login

    使用本地计算机管理员登录名
  • Windocks includes a web app (Chrome or Firefox), open ports 3000,3001, and 5985, 5986

    Windocks包括一个Web应用程序(Chrome或Firefox),开放端口3000,3001和5985、5986

Windocks文件夹 (The Windocks folder)

Once installed check your installation a Windocks folder is created like this:

安装完成后,检查安装情况,将如下所示创建一个Windocks文件夹:

containers folder

I will not explain all the folders, but just some of them. First of all, the docs folder that contains several pdf and txt documents about installation, licenses, configuration for the database cloning software.

我不会解释所有文件夹,而只解释其中一些。 首先,是docs文件夹,其中包含几个有关数据库克隆软件的安装,许可证和配置的pdf和txt文档。

If you want the full list of documents you can go to the website documentation.

如果需要完整的文档列表,可以转到网站文档

The images and containers are also listed in folders, you can see the list of images and containers in the folders.

图像和容器也列在文件夹中,您可以在文件夹中看到图像和容器的列表。

In the images you will see the YAML file, which is a configuration file inside the metadata folder and it is named manifest:

在图像中,您将看到YAML文件,它是元数据文件夹中的一个配置文件,名为清单:

docker manifest file

This file contains names, versions, description and other configuration information. The # is used for comments.

该文件包含名称,版本,描述和其他配置信息。 #用于注释。

Another interesting folder is the samples. It contains several useful examples to handle PowerShell, Database cloning, deploy in Git and more:

另一个有趣的文件夹是样本 。 它包含一些有用的示例来处理PowerShell,数据库克隆,在Git中进行部署等:

samples folder

If we open a docker file in the samples folder, we will note that it is easy to read and understand:

如果我们在示例文件夹中打开一个docker文件,我们会注意到它很容易阅读和理解:

dockerfile example

The following example is adding the customerdata.mdf (the sample database in Windocks) database to the mssql-2017 image and coping the cleanseData.sql and executing it.

下面的示例将customerdata.mdf(Windocks中的示例数据库)数据库添加到mssql-2017映像中,并处理cleanseData.sql并执行它。

If you have errors, the log folder contains the logs with useful information that can provide you deeper details or it can help to the support team.

如果有错误,日志文件夹将包含日志,其中包含有用的信息,这些信息可以为您提供更详细的信息,或者可以为支持团队提供帮助。

命令行入门 (Getting started with the command line)

OK, less bla, bla and more action…. Now we will show some useful examples to run the command line. In DevOps it is essential to have a fast automated process for database cloning. This is possible in Windocks using the command line which allows to automate all the process.

好吧,少点bla,多点bla,多采取行动……。 现在,我们将显示一些有用的示例来运行命令行。 在DevOps中,必须有一个快速的自动化数据库克隆流程。 在Windocks中,使用允许自动执行所有过程的命令行是可能的。

Open the command line and run the following command:

打开命令行并运行以下命令:

Docker ?

码头工人?

You will notice that docker started in Linux because you will receive the following message:

您会注意到Docker在Linux中启动,因为您会收到以下消息:

docker: ‘?’ is not a docker command. See ‘docker ––help’.

码头工人:'?' 不是docker命令。 请参阅“ docker –帮助”。

If you are familiar with Linux, all the configuration files, command lines will be familiar for you. If you are not familiar with Linux, do not worry, this tutorial will help you on that.

如果您熟悉Linux,则所有配置文件和命令行都将为您所熟悉。 如果您不熟悉Linux,请不要担心,本教程将在此方面为您提供帮助。

Let’s try docker ––help:

让我们尝试docker ––help:

Docker ––help

Docker –帮助

This will show the list of commands available.

这将显示可用命令列表。

If, for example, you want to get information about the docker search, write the following command:

例如,如果您想获取有关docker搜索的信息,请编写以下命令:

Docker search ––help

Docker搜索–帮助

This will help you with the synaxis to search images.

这将帮助您搜索图像的同步性。

To list the images, use the following command:

要列出图像,请使用以下命令:

>docker images

>码头图片

To create a stopped container, you can use the following commands:

要创建停止的容器,可以使用以下命令:

>docker create full1

>码头工人创建full1

The following command list all the containers of database cloning:

以下命令列出了数据库克隆的所有容器:

>docker ps

> docker ps

To start the container:

要启动容器:

docker start <ContainerID>

码头工人开始<ContainerID>

The following example, will create a container based on the image mssql-2017 and clone the database customers from the backup and copy and run the script named cleanseData.sql.

以下示例将基于mssql-2017映像创建一个容器,并从备份克隆数据库客户,然后复制并运行名为cleanseData.sql的脚本。

FROM mssql-2017
SETUPCLONING FULL customers C:\windocks\dbbackups\customerdatafull.bak
COPY cleanseData.sql .
RUN cleanseData.sql

从mssql-2017
建立完整的客户C:\ windocks \ dbbackups \ customerdatafull.bak
复制cleanseData.sql。
运行cleanseData.sql

Windocks网络应用程序 (The Windocks web app)

The web app that comes with the installer helps to deliver containers using the UI and without the need of the command line. It is simple to use and intuitive for database cloning.

安装程序随附的Web应用程序有助于使用UI交付容器,而无需命令行。 它易于使用并且直观地用于数据库克隆。

To open it, just go to your browser and type the local IP: HTTP://127.0.0.1

要打开它,只需转到浏览器并输入本地IP: HTTP : //127.0.0.1

In the textbox type the local IP 127.0.0.1 and press the Get button. The Community Edition does not include user authorization, as shown below.

在文本框中,键入本地IP 127.0.0.1,然后按“ 获取”按钮。 社区版不包括用户授权,如下所示。

Connect to local server

Contact tech support for your login and password and press login:

联系技术支持以获取您的登录名和密码,然后按登录键:

Windocks user name and password

The button deliver will deliver containers based on the images:

按钮交付将根据图像交付容器:

Database Cloning Winddocks Web app

You can set the name, port and password using the web app.

您可以使用网络应用设置名称,端口和密码。

Once that your database is cloned, you can use it for testing or development. As you can see, the usage is very simple.

克隆数据库后,就可以将其用于测试或开发。 如您所见,用法非常简单。

结论 (Conclusions)

In this article, we learned how to clone a database using Windocks. Windocks is a modern technology based on docker that supports both SQL Server containers and database cloning. It is possible to clone SQL Server databases, SSRS and target to any SQL version in Windows or Linux (the supported SQL Server Linux versions).

在本文中,我们学习了如何使用Windocks克隆数据库。 Windocks是基于docker的现代技术,支持SQL Server容器和数据库克隆。 可以克隆SQL Server数据库,SSRS并以Windows或Linux中的任何SQL版本(支持SQL Server Linux版本)为目标。

To automate the process, you can use batch files or even PowerShell. We show the command line, so writing your own automated scripts will be a straightforward process.

要自动化该过程,可以使用批处理文件,甚至可以使用PowerShell。 我们显示了命令行,因此编写自己的自动化脚本将是一个简单的过程。

We also learned that the software is simple to use, fast and can help to deliver databases for testing and development efficiently.

我们还了解到该软件易于使用,快速且可以帮助有效地交付用于测试和开发的数据库。

A Terabyte database cloning can be done in seconds with this new technology and reduces the need of several VMs. It can also work in Azure, Docker containers in Linux with clusters and more.

这项新技术可在几秒钟内完成TB级数据库的克隆,从而减少了对多个VM的需求。 它也可以在Azure,带有集群的Linux中的Docker容器中工作。

翻译自: https://www.sqlshack.com/windocks-database-cloning-for-sql-server-dev-test-on-live-production-data/

cesium 风向数据

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值