SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Restoring .bak files with transaction backups
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SJMAC
Starting Member

United Kingdom
1 Posts

Posted - 03/04/2013 :  19:41:36  Show Profile  Reply with Quote
Hi Guys,

First up Im new here so hello and sorry if i've commited a forum faux-pas by jumping in a posting straight off...

Anyway, I dont have much experience with sql however I need to be able to restore databases from .bak file with transaction backups. As I understand it transaction backups need to be restore with a database back up and the must be restored in chronaligical order.

Can anyone advise me if the below script should work? Here i am trying to restore POS and History databases along with transactional backups that have been generated since the POS/History backups were created

RESTORE DATABASE POS FROM DISK = 'C:\Temp2\POS.BAK'
WITH NORECOVERY

RESTORE DATABASE HISTORY FROM DISK = 'C:\Temp2\History.BAK'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_101814.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_101815.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_104714.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_104714.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'
WITH NORECOVERY

RESTORE DATABASE POS WITH RECOVERY

RESTORE DATABASE HISTORY WITH RECOVERY

Any help here would be much appreciated!

Thanks, SJ

robvolk
Most Valuable Yak

USA
15670 Posts

Posted - 03/04/2013 :  20:31:28  Show Profile  Visit robvolk's Homepage  Reply with Quote
Assuming that files named HISTORY are for the history database, just some fixes:

RESTORE DATABASE POS FROM DISK = 'C:\Temp2\POS.BAK'
WITH NORECOVERY

RESTORE DATABASE HISTORY FROM DISK = 'C:\Temp2\History.BAK'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_101814.TRN'
WITH NORECOVERY

RESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_101815.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_104714.TRN'
WITH NORECOVERY

RESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_104714.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'
WITH NORECOVERY

RESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'
WITH NORECOVERY

RESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'
WITH NORECOVERY

RESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'
WITH NORECOVERY

RESTORE DATABASE POS WITH RECOVERY

RESTORE DATABASE HISTORY WITH RECOVERY
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000