

You can perform the same process for the model database as well. You will need to modify the script to use a valid backup path. Use the following command to create a full backup of the msdb database using T-SQL commands. Note: this exercise was performed on SQL Server 2005, but the same rules would also be applied on SQL Server 2005 and onwards. In the next sections we will go through the restore process for the msdb and model databases. The restore process of msdb or model demands additional considerations than that of a user databases. The restore process may get complicated if versions are not tracked and exclusive access is not ensured in all aspects. Hence both the msdb and model databases may need to be recovered in scenarios like database corruption, a rebuild of the master database or after a new server configuration. If the model database has been modified then it should be backed up. DBAs can modify the model database with whatever settings that are required and when a new user database is created it will reflect the configuration of the model database.

Before we get started, let's quickly discuss what the msdb and model databases are used for.
