In MS SQL Server, two types of databases are there:
1. System Databases and
2. User Databases.
System Databases:
System databases are important databases & they are automatically
created during MS SQL Server installation. System databases store server information.
There are four main system databases in MS SQL Server but 2 other DBs are also available:
Master Database:-
1. The master database is one of the system databases and keeps details of MS SQL Server instances, system-level information, metadata, logins, and configurations.
2. If the Maser database is not online or up. SQL server service will not start.
3. The Recovery Mode of the master database is Simple, hence we can’t take the T-Log backup of this database.
4. The master is the first database; hence the ID of this database is 1.
5. Never store the master database-related files on the C drive.
6. We can't add files or file groups.
7. We can't change the database owner of the master database from SA to any other.
8. We can't drop the master database.
9. We can't set the database to OFFLINE.
10. We can't set the database or primary file group to READ ONLY.
11. We can't enable CDC (Change Data Capture) on the master database.
12. The master database will not be a part of mirroring or log shipping.
Advantages of the Master Database:
Disadvantages of the Master Database:
Single Point of Failure: The Master Database is essential to the SQL Server's operation. The entire SQL Server instance may be affected if it becomes damaged or unavailable, which might result in downtime for all databases housed on that instance.
Complexity: Making changes directly to the Master Database might be dangerous since it holds crucial system information. To decrease the likelihood of problems, it is advised to adjust server-level settings using SQL Server Administration Studio or other administration tools.
Limited User Data Storage: User data cannot be stored in the Master Database. It may be difficult to execute maintenance or upgrade operations on SQL Server if you attempt to keep a significant volume of user data in this database.
Version Compatibility: The Master Database may need to be modified to provide room for new system tables or settings when conducting SQL Server upgrades or moving to a different version. Sometimes, this procedure is difficult and has to be carefully planned.
Security Risks: The Master Database has to be securely guarded against unauthorized access since it houses important system data. Giving this database the wrong permissions might cause security flaws.
Components of the
Master Database:
The master database contains lots of important components
like system tables, system views, system stored procedures, system
functions, etc.
A few essential components of the master database are given:
System Tables: System
tables store configuration and status-related information of the SQL Server
instance. For example- sys. sysobjects, sys. sysprocesses, sys. configurations,
sys. sysdevices, sys. sysindexes, sys. databases, and sys. syslogins.
System Views: This
database also manages system views. It provides an easy way to access system tables. For Example:- [sys].[certificates],
[sys].[server_principals], [sys].[backup_devices],
[sys].[server_role_members], and [sys].[server_permissions].
System Stored Procedures: This database also contains a few system-stored procedures that help administrators perform their. For example:-sp_who, sp_readerrorlog, sp_ sp_helpdb, sp_addlogin, and sp_configure.
Functions of the
Master Database:
As specified earlier, this database is very critical & manages and administrates the SQL Server instance. A few important functionalities of the master database are given below:
1. Store Metadata
2. Manage Logins and Security
3. Store Configure of Server Settings
4. Recover from Disasters
5. Control Server Startup
Suggestions:
As you know, the master database is very critical so always take a backup of this database & store it at a safe location.
No comments:
Post a Comment