BACKUP DATABASE creates a copy of a SQL Server database or log to disk or tape so that it can be restored later.
Backups protect against hardware failure, user errors, and ransomware. They let you restore the database to a specific point in time, keeping Customer, Order, and Product data safe.
FULL captures the entire database; DIFFERENTIAL stores changes since the last full; LOG captures transaction log entries for point-in-time recovery.
Use BACKUP DATABASE with the TO DISK clause. Add WITH COMPRESSION to cut file size and WITH STATS for progress.
BACKUP DATABASE EcommerceDB
TO DISK = 'D:\Backups\EcommerceDB_full.bak'
WITH COMPRESSION, STATS = 5;
Yes. BACKUP DATABASE is online and does not block reads or writes; it uses internal database snapshots.
Create a SQL Agent job or use PowerShell’s Invoke-Sqlcmd. Schedule nightly full, hourly log, and daily differential backups.
Use RESTORE DATABASE. For point-in-time, restore the full, then differential, then logs WITH NORECOVERY, ending WITH RECOVERY.
Write to local disk first for speed, then copy to off-site or cloud storage. Keep at least three copies in two locations.
Yes. Use WITH ENCRYPTION and supply a certificate or asymmetric key to protect sensitive customer emails and order data.
Retain at least as long as business or compliance rules require—often 30–90 days for full backups and a week for logs.
Compression slightly increases CPU usage but reduces disk IO and network transfer times. It is recommended unless CPU is already saturated.
Yes. Use the TO URL clause after configuring a credential that points to your Azure storage account.