Backup
- SQL course
- Expert
- Lesson 39/45
- 5 min
Take full and incremental backups.
Backup
A backup copies data to a safe place. A full backup copies everything; an incremental backup copies only changes since the last backup.
COPY orders TO '/tmp/orders.csv';
-- full: tüm tablo
-- incremental: son yedekten sonraki satırlarFull takes all, incremental takes changes.
Backup — details
Incremental saves space but the restore needs a chain: first the full, then each incremental in order. A weekly full with daily incrementals is a common schedule.
Practice Backup
Back up the orders table to /tmp/orders.csv: COPY orders TO '/tmp/orders.csv'.
Starter code
-- backup
COPY ordersSample solution
COPY orders TO '/tmp/orders.csv';Expected output
COPY 5
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What does a full backup copy?
- Everything Correct answer
- Only the changes
- Only the views
- Only the indexes
Explanation: A full backup copies everything.
2 Export
COPY orders TO '____';
COPY orders TO '/tmp/orders.csv';
Explanation: /tmp/orders.csv is the right answer.
3 Backup: match the terms
| Term | Meaning |
|---|---|
full |
full |
incremental |
incremental |
COPY TO |
export |
schedule |
schedule |