SQL backup and restore

Backup: Backup, create a copy of the database at a specific point in time

Cluster => to increase hardware connection and real-time fault tolerance, allowing the effect of partial failure
Backup: the data is additionally copied to an offline copy

  • Full Backup: Full backup, a baseline job for database backup, retaining a complete copy of the DB

  • Differential: Differential backup, copy the results of DB changes since the last Full Backup // What you do later will include the previous ones

  • Transaction Log Backup: Back up the transaction records of the DB change process //can be restored to the specified point in time when restoring

  • Data File/File Group: Very large DB, only one Data File or one File Group is backed up at a time==>Full backup is too large and slow

Backup planning

  • Small DB, does not change often, use Full backup

Start complete replication + log backup during the process

For example, the backup starts at 9:00 and ends at 9:30. The time point of the Full Backup backup is 9:00. The process between 9:00-9:30 is backed up by log backup.

recovery: Verification actions that will be performed before DB startup or after repair => Check Transaction log
1/If there is an unfinished Transaction=》Roll Back-》Return to the state before the transaction
2/If there is a completed Transaction=>roll forward -》Return to the post-transaction state and update to DB's Data File
Recovery Mode: Recovery mode is used to set the processing method of Transaction Log, so it will affect the transaction method provided by the system.

Master restore

1. Backup
2. Open profiler, restore normally, extract restore instructions
3. Open service
4. Right-click sql server -> content
5. Copy path
6. Open command prompt as administrator
7. Paste path -m
8. Close sql server service
9. Paste the restore command /n go
10. Start the service and restore is completed

Guess you like

Origin blog.csdn.net/baidu_34418619/article/details/78474925