Backing up and restoring several databases to the same backup device

  • Follow


Hi!

I am trying to backup several databases (AdventureWorks, 
AdventureWorksDW, AdventureWorksDW2008) to the same backup device 
(file). I would like to add all these databases to the same device. I 
have the following t-sql to accomplish this:

BACKUP DATABASE [AdventureWorks] TO  [AW_BKP_DEVICE]
WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorks-Full Database Backup',
SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO


BACKUP DATABASE [AdventureWorksDW] TO  [AW_BKP_DEVICE]
WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW-Full Database Backup',
SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO


BACKUP DATABASE [AdventureWorksDW2008] TO  [AW_BKP_DEVICE]
WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW2008-Full Database 
Backup',
SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO

Now i would like to see the contents of the backup device and to restore 
any of these databases. How can accomplish this?

Thank you
0
Reply Zaur 12/21/2009 10:26:45 AM

Zaur
Under Server Objects folder take a look into Backup Devices folder


"Zaur Bahramov" <zbakhramov@msn.com> wrote in message 
news:uA1JagigKHA.5792@TK2MSFTNGP05.phx.gbl...
> Hi!
>
> I am trying to backup several databases (AdventureWorks, AdventureWorksDW, 
> AdventureWorksDW2008) to the same backup device (file). I would like to 
> add all these databases to the same device. I have the following t-sql to 
> accomplish this:
>
> BACKUP DATABASE [AdventureWorks] TO  [AW_BKP_DEVICE]
> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorks-Full Database Backup',
> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
> GO
>
>
> BACKUP DATABASE [AdventureWorksDW] TO  [AW_BKP_DEVICE]
> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW-Full Database Backup',
> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
> GO
>
>
> BACKUP DATABASE [AdventureWorksDW2008] TO  [AW_BKP_DEVICE]
> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW2008-Full Database 
> Backup',
> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
> GO
>
> Now i would like to see the contents of the backup device and to restore 
> any of these databases. How can accomplish this?
>
> Thank you 


0
Reply Uri 12/21/2009 11:35:51 AM


I see the backup device, which I created earlier "AW_BKP_DEVICE". What I 
would like to do (and unerdstand), how to backup several databases to 
this device and restore a single database, and how to show contents of 
the backup device. When I use RESTORE VERYFYONLY I see only two files:

D:\SQLSrv\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Data.mdf
D:\SQLSrv\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Log.ldf


After backing up I was expecting to be able to see the content of the 
device, i.e. which databases are there and be able to restore each 
single database.



Uri Dimant wrote:
> Zaur
> Under Server Objects folder take a look into Backup Devices folder
> 
> 
> "Zaur Bahramov" <zbakhramov@msn.com> wrote in message 
> news:uA1JagigKHA.5792@TK2MSFTNGP05.phx.gbl...
>> Hi!
>>
>> I am trying to backup several databases (AdventureWorks, AdventureWorksDW, 
>> AdventureWorksDW2008) to the same backup device (file). I would like to 
>> add all these databases to the same device. I have the following t-sql to 
>> accomplish this:
>>
>> BACKUP DATABASE [AdventureWorks] TO  [AW_BKP_DEVICE]
>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorks-Full Database Backup',
>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>> GO
>>
>>
>> BACKUP DATABASE [AdventureWorksDW] TO  [AW_BKP_DEVICE]
>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW-Full Database Backup',
>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>> GO
>>
>>
>> BACKUP DATABASE [AdventureWorksDW2008] TO  [AW_BKP_DEVICE]
>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW2008-Full Database 
>> Backup',
>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>> GO
>>
>> Now i would like to see the contents of the backup device and to restore 
>> any of these databases. How can accomplish this?
>>
>> Thank you 
> 
> 
0
Reply Z 12/21/2009 12:57:27 PM

Z,B
Take a look at RESTORE HEADERONLY  command




"Z.B." <"zbakhramov["@]msn.com> wrote in message 
news:OKSVn0jgKHA.3552@TK2MSFTNGP06.phx.gbl...
>I see the backup device, which I created earlier "AW_BKP_DEVICE". What I 
>would like to do (and unerdstand), how to backup several databases to this 
>device and restore a single database, and how to show contents of the 
>backup device. When I use RESTORE VERYFYONLY I see only two files:
>
> D:\SQLSrv\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Data.mdf
> D:\SQLSrv\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Log.ldf
>
>
> After backing up I was expecting to be able to see the content of the 
> device, i.e. which databases are there and be able to restore each single 
> database.
>
>
>
> Uri Dimant wrote:
>> Zaur
>> Under Server Objects folder take a look into Backup Devices folder
>>
>>
>> "Zaur Bahramov" <zbakhramov@msn.com> wrote in message 
>> news:uA1JagigKHA.5792@TK2MSFTNGP05.phx.gbl...
>>> Hi!
>>>
>>> I am trying to backup several databases (AdventureWorks, 
>>> AdventureWorksDW, AdventureWorksDW2008) to the same backup device 
>>> (file). I would like to add all these databases to the same device. I 
>>> have the following t-sql to accomplish this:
>>>
>>> BACKUP DATABASE [AdventureWorks] TO  [AW_BKP_DEVICE]
>>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorks-Full Database Backup',
>>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>>> GO
>>>
>>>
>>> BACKUP DATABASE [AdventureWorksDW] TO  [AW_BKP_DEVICE]
>>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW-Full Database Backup',
>>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>>> GO
>>>
>>>
>>> BACKUP DATABASE [AdventureWorksDW2008] TO  [AW_BKP_DEVICE]
>>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW2008-Full Database 
>>> Backup',
>>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>>> GO
>>>
>>> Now i would like to see the contents of the backup device and to restore 
>>> any of these databases. How can accomplish this?
>>>
>>> Thank you
>> 

0
Reply Uri 12/21/2009 1:46:24 PM

Thanks Uri,

RESTORE HEADERONLY is what I was looking for.




Uri Dimant wrote:
> Z,B
> Take a look at RESTORE HEADERONLY  command
> 
> 
> 
> 
> "Z.B." <"zbakhramov["@]msn.com> wrote in message 
> news:OKSVn0jgKHA.3552@TK2MSFTNGP06.phx.gbl...
>> I see the backup device, which I created earlier "AW_BKP_DEVICE". What I 
>> would like to do (and unerdstand), how to backup several databases to this 
>> device and restore a single database, and how to show contents of the 
>> backup device. When I use RESTORE VERYFYONLY I see only two files:
>>
>> D:\SQLSrv\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Data.mdf
>> D:\SQLSrv\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks_Log.ldf
>>
>>
>> After backing up I was expecting to be able to see the content of the 
>> device, i.e. which databases are there and be able to restore each single 
>> database.
>>
>>
>>
>> Uri Dimant wrote:
>>> Zaur
>>> Under Server Objects folder take a look into Backup Devices folder
>>>
>>>
>>> "Zaur Bahramov" <zbakhramov@msn.com> wrote in message 
>>> news:uA1JagigKHA.5792@TK2MSFTNGP05.phx.gbl...
>>>> Hi!
>>>>
>>>> I am trying to backup several databases (AdventureWorks, 
>>>> AdventureWorksDW, AdventureWorksDW2008) to the same backup device 
>>>> (file). I would like to add all these databases to the same device. I 
>>>> have the following t-sql to accomplish this:
>>>>
>>>> BACKUP DATABASE [AdventureWorks] TO  [AW_BKP_DEVICE]
>>>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorks-Full Database Backup',
>>>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>>>> GO
>>>>
>>>>
>>>> BACKUP DATABASE [AdventureWorksDW] TO  [AW_BKP_DEVICE]
>>>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW-Full Database Backup',
>>>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>>>> GO
>>>>
>>>>
>>>> BACKUP DATABASE [AdventureWorksDW2008] TO  [AW_BKP_DEVICE]
>>>> WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorksDW2008-Full Database 
>>>> Backup',
>>>> SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
>>>> GO
>>>>
>>>> Now i would like to see the contents of the backup device and to restore 
>>>> any of these databases. How can accomplish this?
>>>>
>>>> Thank you
> 
0
Reply Z 12/21/2009 2:12:44 PM

4 Replies
204 Views

(page loaded in 0.869 seconds)


Reply: