Courseiva
Configure and manage automation of taskshardMultiple SelectObjective-mapped

DP-300 Configure and manage automation of tasks Practice Question

Your company uses Azure SQL Managed Instance for a critical application. You need to automate the process of rebuilding all indexes that have fragmentation above 30% across all databases on the instance. The automation must run every Sunday at 2:00 AM and must log the results to a table. Which three steps should you take to implement this automation?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Create a logging table in a database to record start time, end time, and status.

Creating a logging table is necessary to record the results of the index maintenance operations. Option C is correct because SQL Agent jobs can be scheduled on a Managed Instance to run tasks at specific times, such as every Sunday at 2:00 AM. Option E is correct because a T-SQL script using sys.dm_db_index_physical_stats to identify fragmented indexes and ALTER INDEX REBUILD to rebuild them is the standard approach. Option B is incorrect because Azure Automation runbooks require additional setup (like Hybrid Runbook Worker) to connect to SQL Managed Instance, and it is not the simplest way to schedule a recurring task on the instance. Option D is incorrect because Elastic Database Jobs is designed for Azure SQL Database and is not supported on Azure SQL Managed Instance.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create a logging table in a database to record start time, end time, and status.

    Why this is correct

    Logging is required for tracking the automation.

  • Use an Azure Automation runbook with the PowerShell module SqlServer to connect and run the maintenance.

    Why it's wrong here

    Azure Automation runbooks are primarily for orchestrating tasks across multiple Azure services or managing resources externally. While a PowerShell runbook could connect to Azure SQL Managed Instance, it is not the native, server-side mechanism for scheduling database maintenance and logging results *within* the instance. Azure SQL Managed Instance includes Azure SQL Agent, which provides an integrated, server-side job scheduler perfectly suited for recurring, on-instance index maintenance and logging to a table. This option would be suitable for automating tasks that span various Azure services.

  • Create a SQL Agent job on the Managed Instance scheduled for Sunday at 2:00 AM.

    Why this is correct

    SQL Agent is available on Managed Instance and can schedule jobs.

  • Use Elastic Database Jobs to run the script across all databases.

    Why it's wrong here

    Elastic Jobs is not available for Managed Instance.

  • Write a T-SQL script that uses sys.dm_db_index_physical_stats and ALTER INDEX REBUILD.

    Why this is correct

    This script can be executed by the SQL Agent job.

Go deeper

Related to this question

About these practice questions

One of 906 original DP-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.