November 7, 2007 at 4:44 pm
I have a SQLServer 2005 database. I want to restore from the backup to 2 days back point in time. I am using the Microsoft SQLServer Managment Studio. After I pick the file and specify the time I keep getting the error:
System.Data.SqlClient.SqlError: RESTORE cannot process database 'DBNAME' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Smo)
I did a server reboot to clear off any hanging session.Stil I am getting the message. Please suggest.
Thanks
November 7, 2007 at 5:24 pm
Is the database you're trying to restore the default database of the login you're using? If so, try changing your default database to another (master is a good one; that's probably why the message suggests it) or try doing the restore using TSQL with 'USE MASTER'.
Greg
Greg
November 8, 2007 at 1:36 am
As a preparation for when the time comes to actually do this in a real live scenario, you may also do it without clicking away in Management Studio, but in straight T-SQL instead.
If nothing else, it's good practice and a good way to learn what the studio is doing behind the scenes.
/Kenneth
November 8, 2007 at 4:21 am
You cant apply Tlog backup when the db is in online.
1.) Restore the last full backup with norecovery
2.) Restore Tlog backup with recovery and specify the point-in-time.
Refer the below link
How to: Restore to a Point in Time (Transact-SQL)
Regards..Vidhya Sagar
SQL-Articles
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply