Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 25780 |  Welcome, Guest!   Register  Login
Home > Articles > Sql Server > System Databases Restoration

System Databases Restoration

1 vote(s)
Rating: 5 out of 5
Article posted by Rajasekhar.Bollareddy@Tcs.Com on 10/10/2012 | Views: 986 | Category: Sql Server | Level: Advance | Points: 250 red flag

Advertisements

Advertisements
Some times we need to restore System Databases.

This may happen due to system or hard disk or any upgrade failures.
We have two cases to go for restoring system databases

1)If MSSql Service is running fine then we will proceed to restoring system databases.

2)If MSSql service is not running or it is going to fail while at restarting then we need to reinstall SQLServer Software in 2005 and 2008 and in 2000 we have one option of rebuilding master database by running of the Rebuildm.exe executable and this was located at C:\Program Files\Microsoft SQL Server\80\Tools\Binn by default.

In the case of one we must need to restore system databases again but in case of two it's depend on business requirement. If we restore system databases again then no need to create user logins,tables,views,triggers,procedures and Server level configurations in the System databases.

I feel you might be understand why we need to restore system databases.

Steps to restore System databases

------------------------------------------

1)Take the backups of all System databases in the drives and verify them whether the taken backups are valid files or not.

2)Restoration of System Databases and User Databases are different here. We can only restore master database when the server should be on single user mode.

Steps to start SQL Services in Single User Mode

  • A3 A) Go to the SQL Server Configuration Manager then click on SQLServices then it displaying what are the services running under SQLServer.
  • 3 B)Right click on SQLServer(MSSqlservice) or any other named instance and click on properties then it displaying all properties what it has.
  • 3 C)Click on Advanced, in this window we have Startup Parameters. Here just place -m and fallowed by ;(Semicolon) as shown in the below screen shot.
  • 3 D)Click on Ok and restart the SQLServer(MSSqlservice). If we wont restart SQLServer(MSSqlservice) then it is still under multiple user mode only.

4) Go to Windows Start –>Run and under the Run type CMD and click enter button then it display Command Prompt.

5)Under Command Prompt type sqlcmd and click enter.

6)Now it is ready for executing SQL queries under the single user mode

7)Give the restore Query for the Master database as given below

 

RESTORE DATABASE [master] FROM

DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\master.bak'

WITH FILE = 1, REPLACE, STATS = 10

go

Run the above query

Now Restoration of Master Database was completed.

8)Fallow the same procedure for Msdb, Model Databases too.

9)If we have Distribution database also exists then restore this too and this is must for replication.

10)After restoration of all system databases Please remove the -m option in the startup parameters in the SQLServer(MSSqlservice) and click ok and restart the SQLServer(MSSqlservice) then its ready for SQLServer to connect with Management Studio.

Thanks for your attention for reading article and All The Best For Your Careers and My Career Too.


Advertisements

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

Latest Articles from Rajasekhar.Bollareddy@Tcs.Com
Experience:2 year(s)
Home page:
Member since:Wednesday, October 10, 2012
Level:Starter
Status: [Member]
Biography:
>> Write Response - Respond to this post and get points
Related Posts

This article explores one of the features (of SQL server 2008 and higher) of providing the change tracking abilities i.e. what data has changed.

The IDENTITY columns are auto incrementing columns provided by SQL Server. There can only be one IDENTITY column per table. SQL Server will take care of incrementing this column automatically.

This is part 20 of the series of article on SSIS. In this article we shall learn how to execute SSIS package from stored procedure.

Here I am going to share how can we take the database backup of all the SQL Server databases at once instead of taking it individually.

Were you ever in need of debugging a stored procedure in SQL Server 2005. Any .NET Developer is well versed with debugging .NET applications. The .pdb files will be used internally to serve the purpose. Pdb files will have the mapping information from Native to MSIL and ultimately to the .NET code. I will not get into the internals of how this happens as this article falls under the SQL Server category.

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/18/2013 3:24:16 AM