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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recovery error (newbie question) 1

Status
Not open for further replies.

zxmax

Technical User
Nov 24, 2003
179
CA
I'm new at this, so bear with me,

we have a database that was corrupt, and we are tring to restore it,
- database name is "db"
we have the database bakckup "db.bak" and the transaction log bakup, "db.trn"

here is what i did to restore,
i deleted the old database >> created a new one >> right click on the database "db" >> all tasks >> restore option >> from device >> selected the file "db.bak" (with database complete Checked) >> the process was finshed succesfully)

Now i did the same thing for the transaction log, the only differennt i chose "db.trn" (under the restore backup set option, having "transaction log" checked >> and i got this error:
" the preceding restore operation did not specify WITH NORECOVERY or WITH STANDBY. Resart the restore sequence, spcifying WITH NORECOVERY or WITH STANDBY for all but the final step. RESORE LOG is terminating abnoramlly."

i'm not too sure how to restart the operation with NORECOVERY, can't find any option for that, i did some reading and i think it could be done thru scripts, but i'm not sure what to have in the script, and where to execute it,

Any help will be greatly appreciated
 
In the options tab select
leave the database nonoperational but able to restore additional transaction lgs.

This will allow you to restore the sequence of log files then recover.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thanks Nigelrivett,

But i got the same error
i tried deleting the whole database, and start form scratch,
Another question, do i backup the Database first, or the trans log ?
Thanks again
 
You will need to start over (delete the database again etc).

When restoring db.bak, set the recovery completion state (on the options tab) to either the 2nd or 3 option, which allows you to restore additional transaction logs.

When you restore db.trn you can go with the 1st (default) option which does not allow for any other transaction logs to be restored.
 
You need a full backup to start with then a sequence of tr logs.
From then on the full backups are independent of the tr log backup schedule.
You restore a ful backup (any one but usiually the latest) without recovery followed by all of the following tr log backups in sequence (these may span full backups - it doesn't matter) and recover with the last restore or after it to bring the database on-line.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thanks for the help so far,
now i got a different error message:
" The log in this backup set begins at LSN 10527000..., which is too late to apply to the database. An earlier log backup that includes LSN 10487200... can be restored. RESTORE LOG is terminating abnormaly."

what does that mean :)

thanks again
 
It means that the log backup does not contain all the transactions that were made after the full backup.
Either another log backup was made before the one you are applying or something truncated the log.

Or maybe the backups didn't work correctly.


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
nigelrivett, you are right, i was tring to use the last log, and there was 2 prior that, so i used the last 2 first, then it worked like a charm,

Thanks alot for all the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top