I'm trying to backup a database and restore it on an another server.
this backup process need to run every 2 hours.
all what I need from the backup batch is to create the backup file, which I
will copy to the other server and restore it from there.
my question is: after the backup run, and since "NORECOVERY" is specified,
the database display (Restoring...) , unless I run "RESTORE DATABASE test".
Does this restore statement affect the database in anyway other than make it
accessible again and restore it to its original status.
ALTER DATABASE test SET RECOVERY FULL
BACKUP DATABASE test TO test_device
BACKUP LOG test TO test_device
BACKUP LOG test TO test_device WITH NORECOVERY;
restore database test with RECOVERY;
thanks.This behavior is perfectly normal and expected. The RECOVERY step completes
the final log restore by rolling back incomplete transactions and rolling
forward all completed transactions. Of course, you cannot restore more log
files after this step, but the database is now ready to use.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"zino" <zino@.noemail.noemail> wrote in message
news:EB0F065E-9A2A-49EF-8147-E754354F924C@.microsoft.com...
> I'm trying to backup a database and restore it on an another server.
> this backup process need to run every 2 hours.
> all what I need from the backup batch is to create the backup file, which
> I
> will copy to the other server and restore it from there.
> my question is: after the backup run, and since "NORECOVERY" is
> specified,
> the database display (Restoring...) , unless I run "RESTORE DATABASE
> test".
> Does this restore statement affect the database in anyway other than make
> it
> accessible again and restore it to its original status.
>
> ALTER DATABASE test SET RECOVERY FULL
> BACKUP DATABASE test TO test_device
> BACKUP LOG test TO test_device
> BACKUP LOG test TO test_device WITH NORECOVERY;
> restore database test with RECOVERY;
>
> thanks.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment