介绍 (Introduction)
This article is the third I am writing about Microsoft SQL system databases.
本文是我正在撰写的有关Microsoft SQL系统数据库的第三篇文章。
- The first article Configuration, operations and restrictions of the tempdb SQL Server system database was about the tempdb database
- 第一篇文章tempdb SQL Server系统数据库的 配置,操作和限制与 tempdb 数据库有关
- SQL Server system databases – the master database was about the master database. SQL Server系统数据库–主数据库是关于主数据库的。
In this article, I will focus only on the msdb database, one of the four system databases that exist in any MSSQL instance:
在本文中,我将仅关注msdb数据库,该数据库是任何MSSQL实例中存在的四个系统数据库之一:
msdb的用法 (msdb usage)
The msdb database is mostly known as “the SQL Server Agent database” because it stores information of all SQL Agent jobs as their configuration and their execution history.
msdb数据库通常被称为“ SQL Server代理数据库”,因为它存储所有SQL代理作业的信息作为其配置和执行历史记录。
But it is not dedicated mainly to SQL Server Agent. Features like the Service Broker or the Database Mail also stores data in msdb database.
但是它不是主要用于SQL Server代理。 Service Broker或数据库邮件之类的功能也将数据存储在msdb数据库中。
The msdb database it is also used to store information about all backups and restores that are executed, no matter if they were executed by a SQL Agent job or ran by SSMS, sqlcmd or any other application (e.g. backup solutions as NetBackup), msdb will keep track of all related operations.
msdb数据库还用于存储有关已执行的所有备份和还原的信息,无论它们是由SQL Agent作业执行还是由SSMS,sqlcmd或任何其他应用程序(例如,备份解决方案,如NetBackup)运行, msdb都会跟踪所有相关操作。
的角色 (Roles)
One particularity of the msdb is that is the only system database that has pre-defined database roles besides the regular fixed database roles ones. Besides the members of the sysadmin fixed server role that are able to perform any operation in the MSSQL instance, only members of the following database roles are able to execute the related operations (for better understanding I have grouped these database roles):
msdb的一个特殊性是,除了常规的固定数据库角色之外,它是唯一具有预定义数据库角色的系统数据库。 除了能够在MSSQL实例中执行任何操作的sysadmin固定服务器角色的成员之外,只有以下数据库角色的成员才能执行相关的操作(为了更好地理解,我将这些数据库角色分组了):
Group name | Database role name | Notes |