How to recover a master database fail?

Step 1

Verify Vertex Service and Vertex SQL is stopped. 

 

Step 2

On your desktop, right click your mouse on the background and select New Folder. Label the folder Backup. 

 

Step 3

Navigate to:

C:\Program Files\Microsoft SQL Server\MSSQL11.VERTEXSQL\MSSQL\DATA

Copy the master.mdf and mastlog.ldf to Backup folder.

Delete master.mdf and mastlog.ldf from C:\Program Files\Microsoft SQL Server\MSSQL11.VERTEXSQL\MSSQL\DATA

Step 4 

Navigate to:

 C:\Program Files\Microsoft SQL Server\MSSQL11.VERTEXSQL\MSSQL\Template Data

Copy the master.mdf and mastlog.ldf

Paste files into:

C:\Program Files\Microsoft SQL Server\MSSQL11.VERTEXSQL\MSSQL\DATA

Step 5 

Start Vertex SQL Service.

Step 6 

Open the Command Prompt. Copy the command below and paste it into the Command Prompt. Press enter.

sqlcmd.exe -S .\VERTEXSQL -U sa -P SornaCorp1! -Q “ALTER DATABASE MODEL SET READ_WRITE”

Copy the command below and paste it into the Command Prompt. Press enter.

sqlcmd.exe -S .\VERTEXSQL -U sa -P SornaCorp1! -Q “CREATE DATABASE Vertex ON (FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL11.VERTEXSQL\MSSQL\DATA\Vertex.mdf’), (FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL11.VERTEXSQL\MSSQL\DATA\Vertex_log.ldf’) FOR ATTACH”

Step 7 

Delete the Backup folder on your desktop. 

Step 8 

Start Vertex Service.