Azure SQL Database is a PaaS solution for migrating your on-premises databases to the Azure cloud infrastructure. It is a managed service and Azure manages the infrastructure, database availability, backup restore, and compute resources.

Database maintenance is a regular task for database administrators for optimized performance for your application queries. In an on-premise SQL Server, usually, we configure SQL Server Agent jobs with the custom T-SQL scripts or use database maintenance plans for regular performing index maintenance based on a defined threshold.

  • Do we need to do index maintenance on Azure SQL Databases as well?
  • How can we do index maintenance on Azure databases?

Yes, it is a misconception that we do not need to perform database maintenance on Azure databases. Uses are responsible for index and statistics maintenance on these databases other your performance might degrade over time. However, by default, it has the following configurations in regards to statistics.

  • Auto Create Statistics: True
  • Auto Create Incremental Statistics: False
  • Auto Update Statistics: True
  • Auto Update Incremental Statistics: True

Azure Database does not have any SQL Server agent to run the scripts. Therefore, we do have a question here:

How can we automate the Azure SQL Database index and statistics maintenance?

In this article, we use azure automation accounts and runbooks for scheduling maintenance scripts. Refer to the following articles to become familiar with azure automation.

#azure #sql azure #azure automation: #azure sql

Azure Automation: Automate Azure SQL Database indexes and statistics maintenance
2.75 GEEK