Rebuilding All System Database in SQL 2005

Hi i recently lost all my data files for all system database however i do have a backup of all files, master model and MSDB etc 

I've restored the master and model backups on to another SQL2005 server and then placing the files into the data dir  on the server. 

What else should i do to get my server back up and running ? 

November 18th, 2014 2:30pm

Attach the data files (assuming they are not corrupt).

Open SSMS, right mouse click on Databases > Attach > Browse to the mdf file, ndf files (if they exist) and ldf file.

Do this for each database.

Free Windows Admin Tool Kit Click here and download it now
November 18th, 2014 2:42pm

Hi rookie, 

"I do have a backup of all files" means you have MDF and LDF files are backups of system databases  ? if yes you can simply replace the files by stopiing the sql server. offcounrse u loose some server data like jobs , database that were which were created after  the file backup u made. 

    if you have backup files you can still restore follow the below steps 

  1. Start the server instance in single-user mode, by using parameter -m , to know how to configure (http://msdn.microsoft.com/en-us/library/ms345416(v=sql.90).aspx)
  2. To restore a full database backup of master, use the following RESTORE DATABASE Transact-SQL statement:

               RESTORE DATABASE master FROM <backup_device> WITH REPLACE

positively you server should start now with the -m parameter

last line you asked 

 "What else should i do to get my server back up and running ? " 

you mean after you replacing the files that you restored, SQL service is not starting if yes, can you send us error log 


 

November 18th, 2014 2:42pm

Hi Ramakrishna,

Thanks for your reply just some background info. I found the server in the state that none of the SQL server were started..  so i can't start SQL Management studio if i do i can't get into the Management studio anyways..

I have the master and model database only restored to  D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ on the server. 

The msdb won't restore from backup nor do i have a tempdb  

Do i need to replace all the - d , -e and -l to be -m or just the master and mastlog ?  

-dD:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;

-eD:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG;
-lD:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf

Free Windows Admin Tool Kit Click here and download it now
November 18th, 2014 3:01pm

no need to replace all the -d,-e,-l at all, u just add the -m at the end make sure u have ";" (semicolon)

before -m

PS:
can you send us the SQL server error log ? so that we can see what was the error and where server is getting st

November 18th, 2014 3:06pm

2014-11-18 14:46:47.93 Server      Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86) 
Apr 14 2006 01:12:25 
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

2014-11-18 14:46:47.93 Server      (c) 2005 Microsoft Corporation.
2014-11-18 14:46:47.93 Server      All rights reserved.
2014-11-18 14:46:47.93 Server      Server process ID is 408.
2014-11-18 14:46:47.93 Server      Logging SQL Server messages in file 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2014-11-18 14:46:47.93 Server      This instance of SQL Server last reported using a process ID of 2492 at 11/18/2014 2:21:15 PM (local) 11/18/2014 2:21:15 PM (UTC). This is an informational message only; no user action is required.
2014-11-18 14:46:47.93 Server      Registry startup parameters:
2014-11-18 14:46:47.93 Server       -m D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2014-11-18 14:46:47.93 Server       -e D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2014-11-18 14:46:47.93 Server       -l D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2014-11-18 14:46:47.93 Server      Error: 17113, Severity: 16, State: 1.
2014-11-18 14:46:47.93 Server      Error 3(The system cannot find the path specified.) occurred while opening file 'master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.
Free Windows Admin Tool Kit Click here and download it now
November 18th, 2014 3:15pm

rookie the startup parameter (-m) you setup is wrong ,see the below  



November 18th, 2014 3:22pm

I agree with jakkampudi.

Can you try these steps?

Stop the sql instance, take off all the parameters you've added so far.

Net Start MSSQLServer /f /m"SQLCMD"
C:\Documents and Settings\ABCD>sqlcmd -E
1> go
2>RESTORE DATABASE master FROM DISK = 'C:\SQL\Backups\master.bak' WITH REPLACE
3>go
Net STOP MSSQLServer 

Start the SQL service.

To restore MSDB database, stop the sql agent and restore the database with overwrite option.

http://technet.microsoft.com/en-us/library/ms190749(v=sql.105).aspx

--Prashanth



Free Windows Admin Tool Kit Click here and download it now
November 18th, 2014 3:24pm

Hi ramakrishna

I've applied the ;-m at the end of the string and still no luck in starting the services... the Error log is the same i've add the changed string below the log... 

2014-11-18 14:46:47.93 Server      Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86) 

Apr 14 2006 01:12:25 
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

2014-11-18 14:46:47.93 Server      (c) 2005 Microsoft Corporation.
2014-11-18 14:46:47.93 Server      All rights reserved.
2014-11-18 14:46:47.93 Server      Server process ID is 408.
2014-11-18 14:46:47.93 Server      Logging SQL Server messages in file 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2014-11-18 14:46:47.93 Server      This instance of SQL Server last reported using a process ID of 2492 at 11/18/2014 2:21:15 PM (local) 11/18/2014 2:21:15 PM (UTC). This is an informational message only; no user action is required.
2014-11-18 14:46:47.93 Server      Registry startup parameters:
2014-11-18 14:46:47.93 Server       -m D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2014-11-18 14:46:47.93 Server       -e D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2014-11-18 14:46:47.93 Server       -l D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2014-11-18 14:46:47.93 Server      Error: 17113, Severity: 16, State: 1.
2014-11-18 14:46:47.93 Server      Error 3(The system cannot find the path specified.) occurred while opening file 'master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.



-dD:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;
-eD:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG;
-lD:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf;-m

November 18th, 2014 3:34pm

1)  Check and all drives should full permission for service account.

2)  changes temporary your credential for testing purpose to mssql services.


April 5th, 2015 1:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics