Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restore multiple DBs from single BAK file 2

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
Hi All,

I have a single 15Gb BAK file that I have restored from a client's db. I am seeing one database in the management console after the restore,using the management console, which is what I expected. However the client now tells me that there are a few databased included in that one BAK file.

So my question is: how do I restore multiple DBs from the single BAK file? Or is this just one database that they provided and not multiples.

I was under the impresssion that the console only lets me back up / restore one db at a time.

Can anyone shed some light on this?

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
It should be on DB per database backup file weather it is just a single copy of the target DB or multiple copies of the target DB that have been appended.

You cannot have different databases in the same backup set (at least I am not aware of that).


Thanks

J. Kusch
 
I've never seen, or heard of, more than one database in a BAK. However, you can run this to make sure,

Code:
restore headeronly
from disk = '<filename>'

-If it ain't broke, break it and make it better.
 
It is completely possible to have more than one backup of more than one database in a single backup file. As Mich pointed out, RESTORE HEADERONLY will show you the contents of the backup file. If there is more than one line of output, there are multiple backups. To select one, you simply need to use the FILE option:
Code:
restore database pubs from disk = 'C:\pubsBkup.bak' with replace, file = 2

To create a file with multiple backups (generally a bad idea to begin with, which is why people never see it) you simply specify NOINIT in the backup command.
 
Thanks, guys

That really helped. Couldn't find that googling from some reason

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top