Ola Hallengren for Managed instance

azureazure-sql-databaseola-hallengren

  1. How can we configure Ola Hallengren's solution on a managed instance? (We want output file for each run, storing it is an issue)
  2. If we want backup retention longer than 35 days for the database in managed instance, what are the possibilities? (copy_only backups to blob storage?)

Best Answer

Ola Hallengren's maintenance solution has several parts:

Database backups - you don't usually want to use these in Managed Instances because you can't restore the backups to another location, like on-premises. The only use for database backups is to restore them into another managed instance - like if you're doing it for disaster recovery, backing them up to blob storage, and then syncing that blob to a different Azure account (in case you're worried about a malicious actor closing your Azure account, and leaving you with no backups.) If you do want to use backups for that purpose, you can use the @Url parameter for the DatabaseBackup proc, and back up to a URL.

Integrity checks - these work the same way they work for normal SQL Server - no change for Ola's scripts here.

Index and statistics maintenance - these also work the same way they'd work on-premises, but be aware that with the limited transaction log throughput of Azure SQL DB and its relatives, you probably want to use the @Delay parameter when you rebuild/reorg indexes so that you slow down the amount of transaction log throughput you're generating, and leave some DTUs for user transactions.

Parameters common to all procs - don't try to log them to the file system, because you simply don't have access to the file system.