Question

Difficulty: MediumManaging Storage and Database Solutions

An application engineer accidentally deleted critical database tables in a production Cloud SQL for MySQL instance named `prod-db`. You need to perform a Point-in-Time Recovery (PITR) to restore the database to its state exactly 30 minutes prior to the deletion into a new instance named `prod-db-restored`, verify the data, and switch application traffic. In what order should you execute these operational recovery steps?

  1. 1Identify the precise timestamp immediately preceding the accidental table drop from Cloud Audit Logs.
  2. 2Run the `gcloud sql instances clone` command specifying `prod-db` as the source, `prod-db-restored` as the target, and the `--point-in-time` parameter set to the identified timestamp.
  3. 3Connect to `prod-db-restored` and validate that the missing tables and records have been successfully recovered.
  4. 4Update application database configuration settings or connection strings to point to the IP address or instance connection name of `prod-db-restored`.

Answer

The correct operational sequence is: first, identify the target timestamp from Cloud Audit Logs; second, execute `gcloud sql instances clone` with the `--point-in-time` parameter; third, connect to the new instance to validate recovered data; and fourth, update application database connection configurations to point to the restored instance.
The correct recovery procedure starts by identifying the exact timestamp of the event using Cloud Audit Logs. Next, `gcloud sql instances clone` is executed with the `--point-in-time` flag to create a new instance initialized to that timestamp. Once the instance is provisions, data integrity is verified. Finally, application configurations are updated to point to the newly restored instance.

Step-by-Step Solution

1
Determine the exact historical timestamp from Cloud Audit Logs or database event logs.
Obtained a precise ISO 8601 timestamp prior to the accidental table drop.
Point-in-time recovery requires a specific timestamp to replay binary logs up to that exact moment.
2
Execute the point-in-time clone command via the Google Cloud CLI.
Cloud SQL creates `prod-db-restored` using the latest base backup and replays transaction logs up to the specified point in time.
In GCP Cloud SQL, point-in-time recovery to a new instance is performed using the `gcloud sql instances clone` command with the `--point-in-time` flag.
3
Query the restored database instance `prod-db-restored`.
Verified that all deleted tables exist and data consistency is confirmed.
Verification ensures that the chosen recovery timestamp was correct and that data is intact before sending live traffic.
4
Reconfigure application connection parameters.
Applications seamlessly connect to `prod-db-restored` and resume normal operation.
Traffic must be redirected to the restored instance to restore service functionality.

Key Concept

Cloud SQL Point-in-Time Recovery (PITR) using gcloud instances clone
Rate this question