Soru

Zorluk: OrtaManaging Storage and Database Solutions

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?

  1. Run `gcloud sql instances clone prod-db-instance restored-db-instance --point-in-time="2026-07-30T14:25:00Z"`.Cevap
  2. B
    Run `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.
  3. C
    Run `gsutil sql instances restore prod-db-instance --restore-time="2026-07-30T14:25:00Z"` to restore the production instance in place.
  4. D
    Run `gcloud firestore export gs://prod-db-backups --collection-ids="all"` to export the snapshot for recovery.

Cevap

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.

Adım Adım Çözüm

1
Identify the target recovery timestamp prior to the corruption event.
Timestamp identified as 14:25:00 UTC, which is 5 minutes before the 14:30 UTC corruption incident.
Point-in-time recovery requires an RFC 3339 formatted timestamp corresponding to a known good state.
2
Use the `gcloud sql instances clone` command with the `--point-in-time` flag.
A new target Cloud SQL instance is provisioned and populated with data up to the requested timestamp using write-ahead logs.
Cloning to a new instance ensures the primary production database remains online and accessible throughout the recovery and verification process.

Anahtar Kavram

Cloud SQL Point-in-Time Recovery (PITR) via Instance Cloning
Bu soruyu puanla