Provisioning SQL Databases — Question 32
You have a database named DB1 and an application named App1. App1 queries DB1.
You discover that a non-clustered index in DB1 is corrupt.
You need to repair the index. App1 must be able to query DB1 while the index is being repaired.
What should you do?
Answer options
- A. Run CHECKDB REPAIR DATABASE and specify the REPAIR_REBUILD parameter.
- B. Run CHECKDB REPAIR DATABASE and specify the ALLOW_DATA_LOSS parameter.
- C. Restore DB1 from a backup.
- D. Drop and recreate the index.
Correct answer: A
Explanation
The correct answer is A because using CHECKDB with the REPAIR_REBUILD option allows for the index to be repaired without taking the database offline, enabling App1 to continue querying DB1. Options B and C are incorrect as they either risk data loss or require complete restoration from a backup, which would make DB1 unavailable. Option D would not repair the index but rather recreate it, which could lead to downtime for App1.