What is the reason to backup master, msdb and model system databases?
How does it help during disaster recovery? And are they to be restored just like user databases?
What is the reason to backup master, msdb and model system databases?
How does it help during disaster recovery? And are they to be restored just like user databases?
The best reason are the Microsoft recommendations from Backup & restore: system databases (SQL Server) (Microsoft | SQL Docs)
Description: The database that records all of the system level information for a SQL Server system.
Comments:
Back up master as often as necessary to protect the data sufficiently for your business needs. We recommend a regular backup schedule, which you can supplement with an additional backup after a substantial update.
..and then this bit of information from master Database (Microsoft | SQL Docs)
The master database records all the system-level information for a SQL Server system. This includes instance-wide metadata such as logon accounts, endpoints, linked servers, and system configuration settings. In SQL Server, system objects are no longer stored in the master database; instead, they are stored in the Resource database. Also, master is the database that records the existence of all other databases and the location of those database files and records the initialization information for SQL Server. Therefore, SQL Server cannot start if the master database is unavailable.
If you lose the master database, you lose the ability to start the instance.
It is not intended to be able to restore the master databse to a different server to "migrate logins". To achieve this look at the DBTools.IO or Transfer logins and passwords between instances of SQL Server (Microsoft | SQL Docs) or as Hannah pointed out in the comment.
Comments:
Back up model only when necessary for your business needs; for example, immediately after customizing its database options.
Description:
The database used by SQL Server Agent for scheduling alerts and jobs, and for recording operators. msdb also contains history tables such as the backup and restore history tables.
Comments:
Back up msdb whenever it is updated.
This happens whenever a backup or restore is performed, when jobs are executed or fail, mails are sent, etc. This is because all of the above mentioned tasks log their respective actions and outcomes in the various msdb tables.
IMO msdb is one of the most underrated databases on a SQL Server instance. Protect all of your system databases at all costs with a regular FULL database backup.
Disclaimer
Most of the information posted in this answer was copied from the above mentioned article and has been copied here, to ensure the availability of the information provided in Microsoft's article.
master database, using WITH REPLACE when the SQL Server is running in single-user mode, SQL Server automatically shuts down. Upon next restart of the SQL Server service, the logins present in the backed up master database will be present, along with all the other details stored in master, such as database file locations and numerous other settings.
– Hannah Vernon
Oct 04 '21 at 21:25
masterdatabase and I'm sure did come with the restore you did. The database Users are a different object stored at the database level, and my guess is your Logins got orphaned from the Users when you did your restore. That's a common issue that can be resolved. – J.D. Oct 04 '21 at 13:17masterwith a new name, i.e. notmaster, then the logins present in the restored version of the database will not be visible in SQL Server. Only logins stored in the currentmasterdatabase are visible. You can see them via aSELECTstatement executed in the Dedicated Administrator Connection, but only if you know where to look. – Hannah Vernon Oct 04 '21 at 21:27