Showing posts with label reinstalling. Show all posts
Showing posts with label reinstalling. Show all posts

Friday, March 23, 2012

Restoring SQL Server Databases after uninstalling and reinstalling SQL Server.

Hi

I have another question : 1) Restoring SQL Server Databases after uninstalling and reinstalling SQL Server.

Two days ago there was some problem with Norton Antivirus, so Windows 98 restored itself to a previous state. The SQL Server name was not available when I tried to start again, so I had to uninstall and reinstall SQL Server. I started a new Database just a week before this happened (the change from Access to SQL Server as I stated in the other thread http://www.dbforums.com/showthread.php?threadid=987880) and after reinstallation I could not access the Database any more - even while it is in the Data directory. I did not have any backup to restore from - I just started creating tables, so there was only the Log file created and the MDF database file. I tried to import it for a while to the new server, but as the database is not shown in the new server, it was unable to import like I hoped. So how do you restore it back to SQL Server when you have no backup and only the (undamaged) MDF database file if you only have one server? I had to recreate the Database from scratch again - I don't want it to happen again.

Regards

CornYou might be able to reattach the database. Since I assume that SQL Server did a normal shut-down before SQL was uninstalled, the files should have quiessed normally.

Note that this is somewhat risky, but it is probably better than nothing. Make a backup copy of the files before you try to attach them. Make a second backup of the database if/when you attach it. Pray a lot during the process ;)

-PatP|||So how do you reattach the Database, I don't know what you are talking about. When I uninstallled, the directory was C:\Program Files\MSSQL7, but when I reinstalled it, I left it the default C:\MSSQL7 directory. Can this be the problem that the new server don't see the old database, because if this is the reason, then Im confused - well I'm confused already!|||look up sp_attach_db in bol, it's actually straight forward.|||I'd use sp_attach_db (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ae-az_52oy.asp), but there is also SQL Enterprise Mangler (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howtosql/ht_7_design_4wq1.asp) for the script-challenged.

-PatPsql