Question 509 of 953
Configure and manage automation of taskshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is the `ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON)` statement, because it rebuilds all indexes on the specified table while keeping the database fully accessible to users, which is essential when you need to automate online index rebuild when fragmentation exceeds 50% in Azure SQL Database. This command directly addresses the requirement by using the ONLINE option, which prevents blocking and minimizes downtime during the rebuild process, a critical consideration for production workloads. On the Microsoft Azure Database Administrator Associate DP-300 exam, this question tests your understanding of index maintenance strategies and the distinction between REBUILD and REORGANIZE, with a common trap being the omission of the ONLINE clause or mistakenly using `ALTER INDEX REORGANIZE`, which cannot handle high fragmentation levels. A helpful memory tip is to think "50% or more, rebuild with ONLINE to the core," reinforcing that fragmentation above 50% demands a full rebuild, not a reorganize, and the ONLINE keyword is non-negotiable for availability.

DP-300 Configure and manage automation of tasks Practice Question

This DP-300 practice question tests your understanding of configure and manage automation of tasks. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Exhibit

Refer to the exhibit.

```
-- Output from sys.dm_db_index_physical_stats
OBJECT_NAME = 'Orders'
index_type_desc = 'CLUSTERED'
avg_fragmentation_in_percent = 65
page_count = 25000
```

Refer to the exhibit. You are monitoring index fragmentation in an Azure SQL Database. You need to automate the rebuild of this index when fragmentation exceeds 50%. The rebuild must be online to minimize downtime. Which T-SQL statement should you include in your automated maintenance job?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "minimum / minimize"

    Why it matters: Asks for the least resource use — fewest addresses, smallest subnet, lowest overhead. Eliminate over-provisioned options even if they would technically work.

Question 1hardmultiple choice
Full question →

Exhibit

Refer to the exhibit.

```
-- Output from sys.dm_db_index_physical_stats
OBJECT_NAME = 'Orders'
index_type_desc = 'CLUSTERED'
avg_fragmentation_in_percent = 65
page_count = 25000
```

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

ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON);

Option B is correct because it uses the `ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON)` statement, which rebuilds all indexes on the table online, allowing concurrent user access and minimizing downtime. This meets the requirement to automate the rebuild when fragmentation exceeds 50%, as online rebuilds are supported in Azure SQL Database for this purpose.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • ALTER INDEX Orders ON Orders REBUILD;

    Why it's wrong here

    Syntax is incorrect; should be ALTER INDEX ALL or specify index name.

  • ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON);

    Why this is correct

    Online rebuild minimizes downtime.

    Clue confirmation

    The clue word "minimum / minimize" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • ALTER INDEX ALL ON Orders REORGANIZE;

    Why it's wrong here

    Reorganize does not reduce fragmentation sufficiently for high fragmentation.

  • ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = OFF);

    Why it's wrong here

    Offline rebuild causes downtime.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse `REORGANIZE` with `REBUILD` for high fragmentation, or they overlook the `ONLINE = ON` option, assuming all rebuilds are online by default in Azure SQL Database.

Detailed technical explanation

How to think about this question

Online index rebuild in Azure SQL Database uses row-versioning to allow concurrent DML operations during the rebuild, though it requires sufficient database resources and may have a higher performance overhead than offline rebuilds. The fragmentation threshold of 50% is a common best practice for triggering a rebuild rather than a reorganize, as reorganize is typically used for fragmentation between 5% and 30%. In real-world scenarios, monitoring fragmentation with `sys.dm_db_index_physical_stats` and automating the rebuild with a job ensures optimal query performance without prolonged downtime.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DP-300 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DP-300 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DP-300 question test?

Configure and manage automation of tasks — This question tests Configure and manage automation of tasks — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON); — Option B is correct because it uses the `ALTER INDEX ALL ON Orders REBUILD WITH (ONLINE = ON)` statement, which rebuilds all indexes on the table online, allowing concurrent user access and minimizing downtime. This meets the requirement to automate the rebuild when fragmentation exceeds 50%, as online rebuilds are supported in Azure SQL Database for this purpose.

What should I do if I get this DP-300 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "minimum / minimize". Asks for the least resource use — fewest addresses, smallest subnet, lowest overhead. Eliminate over-provisioned options even if they would technically work.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.