Wednesday, March 7, 2012

Database Restore

I have a SQL cluster I built about two weeks ago on Windows 2003, now we are
trying to restore a database to the server from a different location (non
cluster) and we are unable, database seems to go but sql manager states the
database is in a still loading state, is there anything I have to do, like
stop the cluster services.
Thanks,
Bob Smith
Hi
Make sure that you select "Leave database oprational..." from the options
tab in the Restore dialogue.
You can re-run the restore, overwriting the DB you tried earlier.
Regards
Mike
"Bob Smith" wrote:

> I have a SQL cluster I built about two weeks ago on Windows 2003, now we are
> trying to restore a database to the server from a different location (non
> cluster) and we are unable, database seems to go but sql manager states the
> database is in a still loading state, is there anything I have to do, like
> stop the cluster services.
> Thanks,
> Bob Smith
|||Mike,
Thanks, but this was checked, do I need to break the cluster to do a
restore, I even tried creating new database and doing an import, btw I am not
a very experienced sql admin, I know my way around and can troubleshoot etc,
but I done the restore on a straight sql server non cluster, then I go to the
clustered setup and do the restore and it sits there saying loading and it is
grayed out.
Thanks Again,
Bob Smith
"Bob Smith" wrote:

> I have a SQL cluster I built about two weeks ago on Windows 2003, now we are
> trying to restore a database to the server from a different location (non
> cluster) and we are unable, database seems to go but sql manager states the
> database is in a still loading state, is there anything I have to do, like
> stop the cluster services.
> Thanks,
> Bob Smith
|||See if this helps.
Copy the data and log files for your user database from the non-clustered server to the shared disk that your SQL Server virtual instance recognizes.
Lets say for example, you copied the mydbdata.mdf and mydbdata.ldf files to "F:\Program Files\Microsoft SQL Server\MSSQL\Data" folder
Now re-attach the database pointing to the files in the new location as follows: (Run the following commands from Query Analyzer)
use master
go
sp_attach_db 'mydb','C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydbdata.mdf','C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydblog.ldf'
go
Verify the change in file locations using sp_helpfile :
use mydb
go
sp_helpfile
go
If you are not comforable with Query Analyzer, you can use Enterprise Manager to attach the db. Here are the steps from SQL Server Books Online
To attach a database
Expand a server group, and then expand a server.
Right-click Databases, and select All Tasks/Attach Database.
Enter the name of the MDF (master data file) of the database to attach. If you are not sure where the file is located, click browse (...) to search. There can only be up to 16 file names specified. For more information,
see sp_attach_db.
To ensure that the specified MDF file is correct, click Verify. The Original File Name(s) column lists all the files in the database (data files and log files). The Current File(s) Location column lists the file names and
paths. If Microsoft SQL Server cannot find the files in the specified locations, the attach operation fails. The Current File(s) Location column can be edited, and the current location of the file must be in this column for
the attach operation to work. For example, if you have changed the default location of the file before you detached it, you must specify the current location for the attach operation to be successful.
In the Attach as box, enter the name of the database. The database name must not match any existing database names.
Specify the database owner.
Click OK. A database node for the newly attached database is created in the Database folder.
HTH,
Best Regards,
Uttam Parui
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security vulnerabilities. The easiest way to do this is to visit the following websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx

No comments:

Post a Comment