Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

The Voice of the DBA

Steve Jones is the editor of SQLServerCentral.com and visits a wide variety of data related topics in his daily editorial. Steve has spent years working as a DBA and general purpose Windows administrator, primarily working with SQL Server since it was ported from Sybase in 1990. You can follow Steve on Twitter at twitter.com/way0utwest

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

Comments

Posted by Jason Brimhall on 7 July 2011

It's always nice to have little reviews like this on recovery.

Posted by narendra.verizon on 8 July 2011

It was nice...

Leave a Comment

Please register or log in to leave a comment.