An operations engineer needs to recover a production Cloud SQL for PostgreSQL instance to a state prior to a data corruption incident that occurred at 14:30 UTC today. Automated daily backups and binary logging are enabled on the instance. The engineer must perform a point-in-time recovery (PITR) to a separate new Cloud SQL instance to inspect and verify the data without impacting the active production workload. Which command should the engineer execute?
- Run `gcloud sql instances clone prod-db-instance restored-db-instance --point-in-time="2026-07-30T14:25:00Z"`.Answer
- BRun `gcloud storage cp gs://prod-db-backups/dump.sql gs://restored-db-bucket/ --storage-class=COLDLINE` to archive the database files prior to running a restore.
- CRun `gsutil sql instances restore prod-db-instance --restore-time="2026-07-30T14:25:00Z"` to restore the production instance in place.
- DRun `gcloud firestore export gs://prod-db-backups --collection-ids="all"` to export the snapshot for recovery.
Answer
The correct action is to run `gcloud sql instances clone prod-db-instance restored-db-instance --point-in-time="2026-07-30T14:25:00Z"`.
The option specifying `gcloud sql instances clone` with the `--point-in-time` parameter creates a separate instance restored to the designated timestamp. This utilizes point-in-time recovery logs while satisfying the requirement to avoid downtime or modification on the active production instance.
Step-by-Step Solution
Key Concept
Cloud SQL Point-in-Time Recovery (PITR) via Instance Cloning