If SQL Agent isn't available for Azure SQL Database then is it possible to maintain (indexes, statistics etc) the databases with Ola Hallengren's maintenance scripts, for example?


1 Answer 1


Once you have created an Azure SQL Database you can use all tools listed on the following image to provide maintenance:

enter image description here

Regarding to Ola Hallengren's maintenance scripts, you can install them using psdbatool on a Managed Instance

enter image description here

Learn more about psdbatool here.

You can also install them manually.

And run them.

EXECUTE dbo.IndexOptimize
@Databases = 'mydbnamehere',
@FragmentationLow = NULL,
@FragmentationLevel1 = 5,
@FragmentationLevel2 = 30,
@UpdateStatistics = 'ALL',
@OnlyModifiedStatistics = 'Y'

You may also need Azure Automation to schedule execution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.