将弹性池数据库从一个租户移动到另一个租户。 [英] Move Elastic Pool database from One tenant to another tenant.

查看:104
本文介绍了将弹性池数据库从一个租户移动到另一个租户。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望将数据库从1个SQL弹性池移动到Azure中托管的不同租户中的另一个SQL弹性池。那么请你帮我们写一下这个脚本吗?或者,如果您已经拥有,请与我们分享。以下是具体要求。

We want to move a DB from 1 SQL elastic pool to another SQL elastic pool in different tenant hosted in Azure. So can you please help us to write the script for it? Or if you already have any, then kindly share it with us. Below is the exact requirement.

 

1。租户1:  abc.onmicrosoft.com

1. Tenant 1 : abc.onmicrosoft.com

   订阅:abc

    Subscription : abc

    SQL弹性池:  abc.database.windows.net

    SQL Elastic Pool : abc.database.windows.net

     DB:abc(此数据库将移至租户2

    DB : abc (This DB to be moved to tenant 2

  ;

需要将DB:abc移动到新租户和不同的SQL弹性池

Need to move DB : abc to new tenant and a different SQL elastic pool

 

2.租户2:&absp; xyz.onmicrosoft.com

2. Tenant 2 : xyz.onmicrosoft.com

  订阅:xyz

    Subscription : xyz

    SQL Elastic Pool:  xyz.database.windows.net

    SQL Elastic Pool : xyz.database.windows.net

    DB:abc(这应该是来自租户1的移动项目)

    DB: abc (This should be the moved item from tenant 1)

 

Chidambar

Chidambar

推荐答案

您好Chidambar,

Hi Chidambar,

如果您查看以下内容  Transact-SQL:管理池数据库
T-的例子SQL需要在托管池中执行某些操作。在您的情况下,您将使用

ALTER DATABASE(Azure SQL数据库)
,用于在托管池之间移动数据库。 

If you take a look at the following Transact-SQL: Manage pooled databases there are examples of the T-SQL needed to perform certain actions within managed pools. In your case, you will use ALTER DATABASE (Azure SQL Database) to move databases between managed pools. 

示例T-SQL将如下所示:

An example T-SQL will look like:

ALTER DATABASE db1
MODIFY ( SERVICE_OBJECTIVE = ELASTIC_POOL ( name = pool1 ) ) ;

如果需要在订阅之间移动数据库,则不能使用T-SQL。你需要使用

PowerShell
并从源数据库导出为.bacpac并将目标弹性池中的.bacpac导入其所根据的订阅,您可以移动订阅之间。

以下文件
解释了导出数据库的所有方法。

If you need to move databases between subscriptions, you cannot use T-SQL. You need to use PowerShell and by exporting as a .bacpac from the source db and importing that .bacpac in the target elastic pool for the subscription it is rooted to, you can move between subscriptions. The following document explains all the ways in which you can export databases.

您将包含
登录到PowerShell
脚本的功能,以便对每个订阅进行身份验证并为该目标设置适当的变量数据库实例。

You are going to include a sign-in function to your PowerShell script to authenticate with each subscription and set the appropriate variables for that target database instance.

 我希望这会有所帮助。

 I hope this helps.


这篇关于将弹性池数据库从一个租户移动到另一个租户。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆