简体   繁体   English

Azure SQL DTU等级随powershell时间表增减

[英]Azure SQL DTU level increase and decrease with powershell schedule

We have a REPORT database in Azure.我们在 Azure 中有一个 REPORT 数据库。 Every morning, we need some complex sql procedures to work inside that server.每天早上,我们都需要一些复杂的 sql 程序在该服务器中工作。 Normally DTU level of this server is 0. but only in the mornings, it needs to be updated to DTU level 3. We are now making this manually by ourselves.通常这个服务器的DTU级别是0。但只有在早上,它需要更新到DTU级别3。我们现在自己手动制作。 But we want this to be automated via Powershell or anything.但我们希望通过 Powershell 或其他任何方式实现自动化。 how can we achieve this.我们怎样才能做到这一点。 Can you show us the way please because we are .NET developers and don't know anything about scripting languages.你能告诉我们方法吗,因为我们是 .NET 开发人员,对脚本语言一无所知。

Thanks for reading and hope you can help us.感谢您的阅读,希望您能帮助我们。

Single Azure SQL Database supports manual dynamic scalability, but not autoscale.单个 Azure SQL 数据库支持手动动态扩展,但不支持自动扩展。 For a more automatic experience, consider using elastic pools, which allow databases to share resources in a pool based on individual database needs.要获得更自动化的体验,请考虑使用弹性池,它允许数据库根据各个数据库的需求共享池中的资源。 However, there are scripts that can help automate scalability for a single Azure SQL Database.但是,有些脚本可以帮助自动化单个 Azure SQL 数据库的可扩展性。 For an example, see Use PowerShell to monitor and scale a single SQL Database .有关示例,请参阅使用 PowerShell 监视和扩展单个 SQL 数据库

Hope this helps.希望这可以帮助。

There are powershell script, azure cli and API that you can use to manage Elastic Pools.您可以使用 powershell 脚本、azure cli 和 API 来管理弹性池。

Powershell: For more information check here Powershell:有关更多信息,请查看此处

Set-AzSqlElasticPool -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -ElasticPoolName "ElasticPool01" -Dtu 1000 -DatabaseDtuMax 100 -DatabaseDtuMin 20 

Azure Cli: Check here for more information Azure Cli:点击此处了解更多信息

az sql elastic-pool update -g mygroup -s myserver -n mypool -c

API: Check here for details. API:查看此处了解详情。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}?api-version=2017-10-01-preview

I am assuming that you need auto-scaling for one or many database.我假设您需要对一个或多个数据库进行自动缩放。 Currently there's no such Azure functionality to make it automated as per your requirement.目前没有这样的 Azure 功能可以根据您的要求使其自动化。 But with the help of PowerShell you can change Service Tier and Pricing Tier of your Azure SQL Databases and in order to make it automated you need to run those appropriate PowerShell scripts with schedule so you don't have to change Pricing Tier and Service Tier each morning. But with the help of PowerShell you can change Service Tier and Pricing Tier of your Azure SQL Databases and in order to make it automated you need to run those appropriate PowerShell scripts with schedule so you don't have to change Pricing Tier and Service Tier each早晨。

Check out below links.查看以下链接。

https://jorgklein.com/2017/09/19/azure-sql-database-scheduled-autoscaling/ https://jorgklein.com/2017/09/19/azure-sql-database-scheduled-autoscaling/

https://blobeater.blog/2018/10/11/auto-scaling-azure-sql-db/https://blobeater.blog/2018/10/11/auto-scaling-azure-sql-db/

I hope it gives you more clear picture.我希望它能给你更清晰的画面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM