SQL Server includes four system databases that are essential for its operation.
Each has a
specific role in managing and maintaining the SQL Server environment.
---
🗃️ System Databases in SQL Server
1. master
Purpose: Stores system-level information.
What it contains:
Login accounts
System configuration settings
Information about all other databases
Endpoints, linked servers, and system-level metadata
Backup? ✅ Yes, back it up regularly. It’s critical for server recovery.
---
2. model
Purpose: Template for new databases.
What it contains:
Default settings for new databases (collation, recovery model, file size, etc.)
Backup? ✅ Yes, especially if customized.
📝 Any new database inherits settings and objects (like tables or procedures) from the model
database.
---
3. msdb
Purpose: Used by SQL Server Agent for scheduling and automation.
What it contains:
SQL Agent jobs
Backup and restore history
Alerts and operators
Database Mail configurations
Backup? ✅ Yes, to preserve job history and schedules.
---
4. tempdb
Purpose: Holds temporary user and internal objects.
What it contains:
Temporary tables and stored procedures
Work tables used for sorting and joining
Row versioning
Backup? ❌ No, it's recreated every time SQL Server restarts.
📌 You can optimize performance by moving tempdb to a fast drive and configuring multiple
data files.