Courseiva

DP-300 Configure and manage automation of tasks Practice Question

You are responsible for automating index maintenance in Azure SQL Database. You need to ensure that index rebuilds and reorganizations are performed only when fragmentation exceeds 30% and 10%, respectively, and that the job runs weekly. Which approach should you use?

⚠ Common exam trap

DP-300 often tests the misconception that SQL Server Agent is available in Azure SQL Database, or that automatic tuning can be customized with specific fragmentation thresholds; candidates must remember that Elastic Database Jobs are the correct PaaS-native scheduling solution.

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

✓

Use Elastic Database Jobs to run a script that rebuilds/reorganizes indexes.

Elastic Database Jobs are the native Azure SQL Database mechanism for scheduling and executing T-SQL across one or more databases without requiring a separate VM or SQL Server Agent. The job can run a custom T-SQL script that queries sys.dm_db_index_physical_stats to evaluate fragmentation and conditionally issue ALTER INDEX ... REBUILD or REORGANIZE based on the 30% and 10% thresholds. This satisfies both the automation and the weekly schedule requirements within the PaaS environment.

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 SQL Agent job using T-SQL script with sys.dm_db_index_physical_stats.

    Why it's wrong here

    Azure SQL Database does not include SQL Agent, so this job cannot be created there; Elastic Jobs or Azure Automation is required. SQL Agent is tempting because it is the standard on-premises and SQL Server on Azure VM mechanism for scheduled index maintenance.

  • ✓

    Use Elastic Database Jobs to run a script that rebuilds/reorganizes indexes.

    Why this is correct

    Elastic Database Jobs run T-SQL against Azure SQL Database on a schedule, letting a script evaluate sys.dm_db_index_physical_stats and rebuild above 30% or reorganise above 10% fragmentation weekly. No SQL Agent exists in Azure SQL Database.

  • ✗

    Schedule a maintenance task using SQL Server Agent in a VM running SQL Server.

    Why it's wrong here

    SQL Server Agent exists only in SQL Server, not in Azure SQL Database, so a VM-hosted agent cannot run jobs against the database without extra connectivity and credential plumbing. Agent jobs are tempting for familiar scheduled maintenance, but Azure SQL Database needs Elastic Jobs or Azure Automation instead.

  • ✗

    Enable automatic index tuning in Azure SQL Database with the desired fragmentation thresholds.

    Why it's wrong here

    Automatic index tuning creates and drops indexes based on workload regression analysis; it exposes no fragmentation-threshold settings for rebuild at 30% or reorganise at 10%. It is tempting as a hands-off tuning feature, but it does not perform threshold-driven defragmentation on a weekly schedule.

About these practice questions

This DP-300 question is part of Courseiva's 574-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

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.