What are the ‘master’, ‘msdb’, ‘model’ and ‘tempdb’ databases are in SQL Server, and do I need to worry about them ?
In SQL Server, four essential system databases—master, msdb, model, and tempdb—are foundational to the server’s functionality. Here’s what they do and whether you need to be concerned about them:
1. Master Database
The master database is the most critical database in SQL Server. It stores all the system-level information such as server configuration, logins, and metadata for all other databases on the server. If the master database is corrupted or lost, the SQL Server might not start. Yes, you need to worry about this database. Regular backups and careful management are crucial to maintaining the integrity of your SQL Server instance.
2. msdb Database
The msdb database supports SQL Server Agent, which manages scheduled tasks like backups, job scheduling, and alerts. It also stores information for Database Mail, SSIS packages, and other SQL Server features. While the msdb database is less critical than the master database, you should still monitor and back it up regularly to ensure that scheduled jobs and automation processes run smoothly.
3. Model Database
The model database serves as a template for creating new databases. Whenever you create a new database, it inherits settings, schemas, and objects from the model database. If you need all new databases to start with specific settings or structures, you would modify the model database. You generally don’t need to worry about this database unless you have specific requirements for new databases.
4. tempdb Database
The tempdb database is a temporary storage area used by SQL Server for operations like sorting, joining large datasets, and storing temporary tables. It’s recreated every time the server restarts, which means it only contains temporary data. However, you do need to monitor tempdb, as it can grow quickly and affect performance if not managed properly. Keeping an eye on its size and usage is important, especially under heavy workloads.
Should You Worry About Them?
- Master: Absolutely, because it’s vital to the server’s operation.
- msdb: Yes, particularly if your server relies on scheduled tasks and automation.
- Model: Not usually, unless you need specific defaults for new databases.
- tempdb: Yes, especially in high-traffic environments, to avoid performance issues.
In addition to understanding the roles of these system databases, it’s also important to consider their sizing and storage needs. The master and msdb databases are typically small in size, as they primarily store configuration data, system-level information, and job schedules. However, their importance warrants storing them on reliable and fast storage, but they don’t usually require a dedicated SSD unless you are running a very large and complex SQL Server instance.
The model database is also small, since it only serves as a template, so it doesn’t require much storage space and can comfortably reside on the same disk as the master and msdb databases.
The tempdb database, however, can grow significantly depending on the workload, especially in environments with heavy transactional processing, complex queries, or large data sorting operations. Because tempdb is frequently used and can become a bottleneck, placing it on a high-performance SSD is often recommended. For high-performance environments, tempdb should ideally be on its own SSD to ensure that its heavy read/write operations do not interfere with the performance of other databases.
In summary, while the master, msdb, and model databases do not typically require separate SSD storage, tempdb greatly benefits from being placed on a dedicated SSD, especially in high-traffic environments, to ensure optimal performance and avoid potential slowdowns.
The master and tempdb databases require careful attention, the msdb and model databases should also be regularly monitored and maintained to ensure the smooth operation of your SQL Server environment.
Do you need an external pair of eyes to review your SQL Server architecture?
Maybe your platform development and growth have been organic rather than going through a full enterprise architect design. You have good dev team but NO DBA input. Improvements are built by seeing the real world ‘failure’ as opposed to gaming it out at the DEV/QA stage.
I can offer a full platform evaluation, covering questions such as:
• what is your usage (potential required iops, memory, cpu, space requirements)
• Real world behaviour, usage patterns, etc.
• Routine maintenance review
• Backups / failover review
• UAT environment review
• monitoring / metrics review
Some of the questions I can investigate:
• Are you wrongly sized?
• Are you on the right platform?
• Are you making best use of what you have?
• What is the best model for your business?
• What level of DBA input do you need?
I can provide all of above via my two day “SQL Server Health Check” for just £950 plus VAT. Click here for more info
