How to enable online restore

When a general restore is done, the database is offline. How do we make the restore as online enabled, so the database can be up while the restore is happening?

thanks
LVL 6
anushahannaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
If your database is offline, just make it online using this command..

use master
go
ALTER DATABASE ur_db_name SET ONLINE WITH ROLLBACK IMMEDIATE

If I haven't understood your question, then kindly explain more on this.
0
gothamiteCommented:
If I have understood you correctly, you want to know how to access the database while the actual restore operation is in process. This is not always possible and depends on quite a lot....

You have two basic options for accessing data while a restore is in progress

1) You can perform a piecemeal restore (See this MSDN page for full details: http://msdn.microsoft.com/en-us/library/ms177425.aspx). This is applicable only if your database is split into multiple filegroups. Using this method, you can access data in whichever filegroup isn't currently being restored.

2) If this is part of a DR setup, you could consider using database mirroring to create a replica of the database on another server. Although the database won't be accessible directly you can create a snapshot of it, which will be accessible (but obviously read-only)

Hope that helps,
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anushahannaAuthor Commented:
I am referring to feature #2 in http://www.microsoft.com/sqlserver/2005/en/us/top-30-features.aspx
Is piecemeal the same as 'Online Restore'?
0
gothamiteCommented:
Yes. I know - I got all excited the first time I read that as well. But when it says "only the data being restored is unavailable" it in fact means "all of the data in the filegroup that is currently being restored is unavailable". I think they should change the wording personally.

Also piecemeal restores don't work for the PRIMARY filegroup - i.e. this filegroup is always offline during a restore. I think that's because it contains some system objects or something, so you would have to split your objects out into new filegroups to make this work.
0
anushahannaAuthor Commented:
Thanks. So it is a not a very practical option- especially if the DB is small enough that there is no need for multiple filegroups.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.