Restore master database in SQL Server

If master database is damaged or unusable, then we have to restore the master database. We can restore the database in two scenarios.

1. If server is accessible:

step1: Put the server in single user mode add -m to the startup parameters in the sql server service using the configuration manager and restart the server

step 2: connect to sql server by using the command prompt

SQL Server 2014 C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn
SQL Server 2012 or older versions: C:\Program Files\Microsoft SQL Server\110\Tools\Binn

step 3:
restore the master database by using the backup file.

RESTORE DATABASE master FROM DISK = ‘K:\SQLServer_Backups\master.bak’ WITH REPLACE;

step 4:
restart the server in multi user mode

If server is not accessible:

step 1:
Install a new instance with the same version and same service pack

step 2:
Restore the master database from the available backup by putting the sql-server in single user mode

step 3:
Restore the other system databases and user databases

Related Posts

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: