Database_Backups_Recovery_Flashcards
What is a database backup?
The process of creating a copy of the database information to safeguard against data loss or corruption.
Why are backups important?
- Data Protection
- Business Continuity
- Compliance and Regulations
- Data Integrity
What are the types of backups?
- Full Backup
- Incremental Backup
- Differential Backup
What is a full backup?
A full backup copies all data from the database, requiring more storage space and time.
What is an incremental backup?
An incremental backup only backs up the data that has changed since the last backup, either full or incremental.
What is a differential backup?
A differential backup captures all changes made since the last full backup.
What are key backup strategies?
- Regular Scheduling
- Storage Solutions
- Testing and Verification
What is database recovery?
The process of restoring database data from a backup after data loss or corruption.
Why is recovery important?
- Disaster Recovery
- Operational Continuity
- Data Integrity
- Compliance
What are common recovery scenarios?
- Hardware Failure
- Data Corruption
- Accidental Deletion
- Disaster Recovery
What are the steps in the database recovery process?
- Assessment
- Choosing a Recovery Point
- Preparation
- Restoration
- Validation
- Review
What features does PostgreSQL offer for backups and recovery?
- ACID Compliance
- Extensive Data Type Support
- Advanced Replication
- Point-in-Time Recovery (PITR)
- Robust Security Features
- Flexible Backup Options
- Efficient Disaster Recovery
- Tooling and Extensions
- Performance and Scalability
What is the command to backup a PostgreSQL database?
pg_dump -U username -d db_name > /path/to/folder/for/db_backup/db_backup.sql
What is the command to restore a PostgreSQL database from a backup?
dropdb -U username db_name
createdb -U username db_name
psql -U username -d db_name -f /path/to/folder/for/db_backup/db_backup.sql
What are best practices for backup and recovery?
- Regular Backup Schedules
- Backup Types and Rotation
- Disaster Recovery Plan
- Backup Automation
- Automated Testing
- Monitoring and Alerts
- Data Encryption
- Access Controls
- Documentation and Training
- Offsite and Onsite Storage
- Backup Storage Management
- Test Restores
- Data Integrity Checks