Solved

Restoring MS-SQL DBs from .bak files

Posted on 2001-07-30
7
442 Views
Last Modified: 2012-06-27
In the event of disaster, How does one recover previous system with backup files (.bak) on a new server and a fresh install of SQL Server?
0
Comment
Question by:masonrivlin
7 Comments
 

Accepted Solution

by:
allenstoner earned 100 total points
ID: 6335397
 If you using Enterprise Manager you can right-click the databases tag and under 'All Tasks' is a 'Restore Database'.  In the 'Restore as database' field at the top you can put in a new database name or overwrite an existing database.  For what you're asking you'll want to put in a new name.
  You'll want to restore from a device.  Under 'Select Device' browse to the location of the .bak file and select it as the device.
  If the actual SQL directories are different you may need to change them under the 'Options' tab.
  If you want to use t-sql check out the bol for 'RESTORE DATABASE' which will give you some direction as well as the syntax.

Allen
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
ID: 6336743
The procedure might change slightly if you have older version of SQL Server, especially for the TSQL statement of RESTORE DATABASE...

furhtermore, you might check out the following stored procedure (SQL7+): sp_change_users_login. It will help you to clean up "orphaned" users and create the necessary logins.

CHeers
0
 

Author Comment

by:masonrivlin
ID: 6341436
I appreciate your comments so far.  This would work for user dbs.  What about the master database?  I try to restore over it, find the .bak file as a device, and am told that the backup's sort order and the current install's sort order do NOT match and it cannot proceed.  Also, part of the error is that the binary sort order id of the backup (42) is not the same as the current (52).
Now what I want to do is force it over the existing master db.  After that, I am certain that the rest is a simple matter indeed.

With that in mind, How do I restore the master db when the backup from which I am working was saved in a NON binary sort order?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6343499
You have to rebuild the master database, using a tool that you should find on the SQL Server cd: rebuildm.exe
You can also reinstall the SQL Server, specifying those sort order.
0
 

Expert Comment

by:CleanupPing
ID: 9281934
masonrivlin:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9623425
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Award points to angelIII and allenstoner

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Anthony
EE Cleanup Volunteer
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question