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

Restoring backup error 2

Status
Not open for further replies.

jdgonzalez

Programmer
May 11, 2004
72
0
0
US
Hi everyone,

I'm hoping someone can help me out here. I'm starting a process of practicing my restoration of backups using query analyzer. I've been able to perform the restoration of the backup, but restoring the transaction logs is not working.

My scenario assumes that the backup is being restored to a new server and that I lost all data on the old one (except the backup and transaction logs which are copied to the network).

Here is the code I was using.

Code:
restore log backuptest
from disk = 'C:\Documents and Settings\Administrator\Desktop\old_db\old_db_tlog_200505090000.TRN'
with norecovery

...but the error I get is:

Code:
Server: Msg 4306, Level 16, State 1, Line 1
The preceding restore operation did not specify WITH NORECOVERY or WITH STANDBY. Restart the restore sequence, specifying WITH NORECOVERY or WITH STANDBY for all but the final step.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.

I've been reading BOL on how to recover to a new server, but it's just not making any sense.

Any help provided would be greatly appreciated.

Thanks
 
Let me ask ... did you also restore the DB w/ the NoRecovery option too? If not ... that is your issue.

Thanks

J. Kusch
 
As Jay points out....WITH NORECOVERY is everything.

When you restore a database, there are two important options:

1. WITH RECOVERY
2. WITH NORECOVERY

WITH RECOVERY is the default. What do the two do? When WITH RECOVERY is issued, that tell SQL Server the database is fully restored and there are no more files to restore for this database.

WITH NORECOVERY tells SQL SERVER that there ARE more files to be restored. For example, Differential backups and/or Transaction Log backups.

-SQLBill

Posting advice: FAQ481-4875
 
Thanks. Luckily, this is a development environment I built so time is not an issue.

I'll restore the db using it with 'with norecovery'. Now that I think about, I didn't specify an option, so it used with recovery.

Aside from that, once the restore completes, I should be able to restore the transaction logs. Correct?

 
Jay and SQLBill,

Thanks for your help. What's in BOL now makes sense:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top