| Author |
Topic |
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-21 : 07:18:43
|
| I've got a scheduled backup of a 6.5 database that I need to create a scheduled restore for. The plan had been:a) backup database data_ab) copy a.bak to server bc) use RESTORE DATABASE data_b FROM DISK = 'c:\a.bak' WITH NORECOVERY to restore the database to data_b (that already exists and has data).I'm now stumped because 6.5 doesn't seem to have the RESTORE command (or, if it does, I'm doing something really stupid). Can anybody advise on the best way to get around this?Thanks.Joseph |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-09-21 : 07:33:29
|
| Use LOAD.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-09-21 : 07:34:36
|
| What error are you getting?Shouldn't you be forcing the restore over the current DB on data_b?? |
 |
|
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-21 : 08:01:42
|
| I should explain that I was introduced to SQL Server at 10am this morning - this is all completely new to me...Derrick, I thought that I couldn't use LOAD because I already have data in the tables... doesn't LOAD simply append to the existing data?Rick, can you explain what you mean by forcing the restore?Thanks (and excuse my ignorance),Joseph |
 |
|
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-21 : 08:04:30
|
| Sorry, I meant to say that the error I am getting is:Incorrect syntax near the keyword 'DATABASE'.The thing is, I looked through the SQL reference that seems to have installed with SQL Server and, whilst I can find load and dump, I cannot see restore... did it even exist on 6.5? |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-09-21 : 08:36:50
|
| LOAD restores a backup OVER the existing database. After the LOAD, the database will look like whatever database the backup file came from at time of backup. ???? RESTORE works the same way.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-21 : 08:43:03
|
| Oh, I see. I was confused there - I thought that LOAD simply errored if there was data (and appended if the APPEND keyword was used). I'll give it a go.Cheers,Joseph |
 |
|
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-21 : 11:05:20
|
| Okay.. a follow-up question (oops!)If the window through which I was running the load was 'accidentally' killed (it was me, I confess) and the database seems to be stuck in a 'loading' state, what can I do to get it back? |
 |
|
|
MuadDBA
628 Posts |
Posted - 2004-09-21 : 15:42:12
|
| Drop the dataabse and re-create it?Use sp_resetstatus (did that exist in 6.5?) |
 |
|
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-22 : 03:47:15
|
| It's okay - I kicked the script off again (whilst the database was in 'loading' state) and when it finished everything was fine... I think... Thanks for the help everyone. |
 |
|
|
jjc
Starting Member
8 Posts |
Posted - 2004-09-23 : 06:17:21
|
| Another quick (newbie) question on this topic whilst I'm here......other than checking the data in the tables, is there an easy way of checking if the backup & transaction logs have been applied? |
 |
|
|
|