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 |
SJMAC
Starting Member
1 Post |
Posted - 2013-03-04 : 19:41:36
|
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 createdRESTORE DATABASE POS FROM DISK = 'C:\Temp2\POS.BAK'WITH NORECOVERYRESTORE DATABASE HISTORY FROM DISK = 'C:\Temp2\History.BAK'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_101814.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_101815.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_104714.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_104714.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'WITH NORECOVERYRESTORE DATABASE POS WITH RECOVERYRESTORE DATABASE HISTORY WITH RECOVERYAny help here would be much appreciated!Thanks, SJ |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2013-03-04 : 20:31:28
|
Assuming that files named HISTORY are for the history database, just some fixes:RESTORE DATABASE POS FROM DISK = 'C:\Temp2\POS.BAK'WITH NORECOVERYRESTORE DATABASE HISTORY FROM DISK = 'C:\Temp2\History.BAK'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_101814.TRN'WITH NORECOVERYRESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_101815.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_104714.TRN'WITH NORECOVERYRESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_104714.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'WITH NORECOVERYRESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'WITH NORECOVERYRESTORE LOG POS FROM DISK = 'C:\Temp2\POS_20130304_111613.TRN'WITH NORECOVERYRESTORE LOG HISTORY FROM DISK = 'C:\Temp2\HISTORY_20130304_111614.TRN'WITH NORECOVERYRESTORE DATABASE POS WITH RECOVERYRESTORE DATABASE HISTORY WITH RECOVERY |
|
|
|
|
|