Blog Post

Recovering a Database

,

So you’re restored a database, restored a few logs, all with NORECOVERY as expected and realize there are no more logs. You see this in Management Studio and wonder what do to:

restoringdb

I’ve run a bunch of code, restoring lots of files, but I’m done.

RESTORE DATABASE db4 FROM DISK = 'db4_base.bak' WITH norecovery
RESTORE LOG db4 FROM DISK = 'db4_log1.trn' WITH norecovery
RESTORE LOG db4 FROM DISK = 'db4_log2.trn' WITH norecovery
RESTORE LOG db4 FROM DISK = 'db4_log3.trn' WITH norecovery
RESTORE LOG db4 FROM DISK = 'db4_log4.trn' WITH norecovery
....
RESTORE LOG db4 FROM DISK = 'db4_log42.trn' WITH norecovery

You don’t need another log to bring things online. This simple command will fix things:

RESTORE DATABASE db4 WITH recovery

That will return:

RESTORE DATABASE successfully processed 0 pages in 2.629 seconds (0.000 MB/sec).

and your database will be ready to go:

retoreddb

Filed under: Blog Tagged: Backup/Recovery, sql server, syndicated

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating