Before attempting any changes to a database's structure (schema or physical design), what complete set of preparatory actions should be taken to minimize risk and ensure recoverability and correctness?
-
Aclearly understand the current structure and contents of the database only.
-
Btest any changes on a test database only.
-
Ccreate a complete backup of the operational database only.
-
DAll of the above should be done.
Answer
Correct Answer: All of the above should be done.
Explanation
Introduction / Context:Safe database change management requires planning, validation, and rollback readiness. Even a small structural change (for example, adding a constraint or altering a column type) can impact applications, data quality, and availability. This question asks for the full set of prudent, professional actions to perform before making any database structural modifications.
Given Data / Assumptions:
- You plan to change schema objects such as tables, indexes, constraints, or triggers.
- The database contains production data that must be protected.
- You have access to a non-production environment for testing.
Concept / Approach:
Best practice combines three pillars: understanding, testing, and backup. First, thoroughly understand the current schema and data so you can predict side effects. Second, test proposed changes in a separate test or staging database to confirm behavior and performance. Third, take a full, restorable backup of the production database so you can recover quickly if something goes wrong.
Step-by-Step Solution:
1) Document the current schema, dependencies, and data volumes; review application usage of affected objects.2) Rehearse the change in a test environment using production-like data; validate DDL, DML side effects, and performance.3) Create and verify a complete backup; confirm restore steps and timing.4) Schedule the change with stakeholders; implement with monitoring and a rollback plan.Verification / Alternative check:
Perform a trial recovery from the backup in a sandbox. Validate that the restored database is consistent and applications can connect. This confirms that the backup truly protects you.
Why Other Options Are Wrong:
Option A: Understanding alone is insufficient without testing and backups.
Option B: Testing without understanding or backup still risks production impact.
Option C: A backup alone prevents data loss but does not ensure correctness or performance of the change.
Common Pitfalls:
Skipping test rehearsals, assuming a backup is valid without restore testing, and overlooking dependencies such as views, ETL jobs, or app code that rely on the old schema.
Final Answer:
All of the above should be done.