Skip to content
Ameen Abozaid
Planned lessonMID-018-L06

Demo: restoring to five minutes before a bad DELETE

  • Lesson 6 of 6
  • Mid-level
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

perform a PITR end to end.

Draft outline details

Step by step

  1. Enable WAL archiving and take a base backup; write down the time.
  2. Run workload, note a safe timestamp, then run DELETE FROM orders without a WHERE clause.
  3. Stop the server and move the damaged data directory aside; restore the base backup.
  4. Set recovery_target_time to five minutes before the delete, create recovery.signal, and start.
  5. Planned mistake: target a time after the delete; the rows are gone again. Fix: choose an earlier target and repeat.
  6. Verify row counts, promote, and record the elapsed recovery time.

Prepares MID-018-LAB1.

Check your understanding

Why recover to a time before the delete rather than after?

Show answer

Replay stops at the target, so the delete is never applied.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.