October 27, 2009 at 4:33 am
The Gurus,
I ran a restore database statement and it completed without any error but ever since the database is not accessible and it just display a message that the database is in recovery... How can I get the database to be available as soon as the restore database is ran?
Also, I discovered that databases are available straight away after using the SSMS to restore. Why does database available straight away by using SSMS for restore and it's not when you ran the piece of code below:
RESTORE DATABASE CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910251800.bak' WITH NORECOVERY;
RESTORE LOG CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910260900.trn' WITH NORECOVERY;
RESTORE LOG CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910261000.trn' WITH NORECOVERY;
Thanks.
Regards.
October 27, 2009 at 4:45 am
sahoong (10/27/2009)
The Gurus,I ran a restore database statement and it completed without any error but ever since the database is not accessible and it just display a message that the database is in recovery... How can I get the database to be available as soon as the restore database is ran?
Also, I discovered that databases are available straight away after using the SSMS to restore. Why does database available straight away by using SSMS for restore and it's not when you ran the piece of code below:
RESTORE DATABASE CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910251800.bak' WITH NORECOVERY;
RESTORE LOG CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910260900.trn' WITH NORECOVERY;
RESTORE LOG CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910261000.trn' WITH NORECOVERY;
Thanks.
Regards.
it might have something to do with the fact that your database is still in recovery due to it waiting for you to restore more transaction logs, you need to use the "RECOVERY" option to finish the restore
--------------------------------------------------------------------------------------
[highlight]Recommended Articles on How to help us help you and[/highlight]
[highlight]solve commonly asked questions[/highlight]
Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
Managing Transaction Logs by Gail Shaw[/url]
How to post Performance problems by Gail Shaw[/url]
Help, my database is corrupt. Now what? by Gail Shaw[/url]
October 27, 2009 at 5:33 am
sahoong (10/27/2009)
Why does database available straight away by using SSMS for restore and it's not when you ran the piece of code below:RESTORE DATABASE CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910251800.bak' WITH NORECOVERY;
RESTORE LOG CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910260900.trn' WITH NORECOVERY;
RESTORE LOG CELCAT_LIVE_0910
FROM DISK = 'C:\CELCAT_LIVE_0910_backup_200910261000.trn' WITH NORECOVERY;
Well, you said to restore the database, restore two more logs and not bring it online. What do you expect SQL to do? Ignore the options that you specified?
Please go and read books Online, the section on RESTORE DATABASE and look at what RECOVERY, NORECOVERY and STANDBY do.
You need to either specify RECOVERY on the last restore or you need to run another command after to bring the DB online.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply