Situation
This machine runs the shop database of an online store in PostgreSQL. After a new version was
released, an order disappeared from it and some orders got different amounts.
Every night the database is copied with pg_dump into /var/backups/shop. The team wants a copy
of the database as it was before the failure, next to it, as a separate shop_restore database,
to bring the data back from. shop itself stays untouched for now: the team uses it to work out
what the release did. A colleague has already started restoring a copy into shop_restore, but
did not finish and did not write down how far they got.
The release log is /var/log/shop/deploy.log. Run administrative commands with sudo;
sudo -u postgres psql connects you as the PostgreSQL superuser. There is no internet on the
machine.
Task
shop_restoreholds the orders and settings from the last copy taken before the failure.- The tables in
shop_restoreare built as in that copy: columns, keys, constraints. - A new order in
shop_restorewould get the same number it would have got at the time of the copy. - The
shop_restoredatabase and everything in it belong to theshoprole, as inshop. - The
shopdatabase and the copy files in/var/backups/shopstay as they are.
Lab goals
0 of 5-
shop_restore holds the orders and settings from the last copy taken before the failure — not checked yet
-
The tables in shop_restore are built as in that copy — columns, keys, constraints — not checked yet
-
A new order in shop_restore would get the same number as at the time of the copy — not checked yet
-
The shop_restore database and everything in it belong to the shop role — not checked yet
-
The shop database and the copy files in /var/backups/shop are unchanged — not checked yet