Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2010-05-14 : 06:14:21
|
I have a full, 3Gb .bak file to restore.I've created a new DB instance, with just master, model, msdb & tempdb, plus ReportServer and its tempDB.How do I restore this BAK? The first dropdown prompts for the database to put this into. I can't, because it doesn't exist.I was expecting an .mdf file to attach. Would that be better? Can a BAK be restored without the associated DB?I spoke to the support bloke and he says the BAK is what I need. I think I would need a script to build an empty DB infrastructure first, or just get an .mdf initially. Am I right? Do I have any options?Thanks |
|
Kristen
Test
22859 Posts |
Posted - 2010-05-14 : 06:56:18
|
If you do it from SSMS then I think the database has to exist. Just create one ...Then make sure you look at the OPTIONS tab and change the target path for the MDF / LDF (they will be set as-per the database the backup was made from, you will need to change the name to something more appropriate for your database, and possibly the Path too.You should also change the Logical Name (assuming you can do that from SSMS, I can't remember)And you may have to choose the OVERWRITE option (be very careful you aren't overwriting something you didn't mean to!Personally I would prefer a backup file to attaching the MDF/LDF but technically either will do. |
|
|
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2010-05-14 : 10:21:00
|
I like that you agree.After a bit of fiddling, I think it might be possible to restore a BAK file, by creating a new database, on the fly, although I've never done it yet.When you specify the BAK file, and look in the top dropdown of databases, one appears in the list which doesn't currently exist - the NAME of the database where the FULL backup came from. The error caused seems to be elsewhere - rather than using the BAK file specified, it's complaining about not finding an .mdf file on an E:\ CD.Has anyone encountered this before? |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-05-14 : 10:39:28
|
Check the File/Path on the OPTIONS tab (once you have done "Add a device" to add the Backup File to restore from. Is that pointing to E:?I find it much easier to restore using the SQL Command syntax ... but ... you kinda have to know what you are doing to do it that way. I helped someone restore a file with SSMS, over the phone, yesterday and it took us ages to work out which options had to be selected. Strikes me it could do with a wizard:Choose backup filenameRestore to New database, or existing one?... |
|
|
mikebird
Aged Yak Warrior
529 Posts |
Posted - 2010-05-14 : 11:23:17
|
Also, is there a difference between right-clicking 'Databases' at the top of the tree, or right-clicking an existing database? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|