Showing posts with label uninstalling. Show all posts
Showing posts with label uninstalling. 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

Tuesday, March 20, 2012

Restoring MSDE Databases

I have uninstalled and re-installed an application that uses MSDE on one of
our workstations. Before uninstalling the application I copied the .mdf and
..ldf files to a new location. I now need to restore the databases that are
associated with this application using the .mdf and .ldf files I saved. I
also need to verify the initial configuration (data and log files
names/paths)
I initially tried to detach the database, copy the backup files to the
MSSQL\Data folder and then reattach the database. This worked except that
the database came back in a "read-only" mode. I then opened the properties
of the database and tried to uncheck the "Read-only" option in the
properties. When I tried to save the new settings I received a message that
stated "Device activation error".
Can anyone tell me how I can:
1) Verify the configuration of the database that was installed by the
application I installed.
2) Rebuild this database using the .mdf and .ldf files?
Thanks for any input.
Nancy
Hi Nancy,
Sounds like you're basically on the right track. Is there any chance the
files were copied in from a CD or something and actually are read-only?
If you attach read-only mdf & ldf files, the database comes up in a
read-only mode.
HTH,
Greg Low [MVP]
MSDE Manager SQL Tools
www.whitebearconsulting.com
"Nancy Kafer" <nkafer@.homesteaderslife.com> wrote in message
news:OBnN12BgEHA.3428@.TK2MSFTNGP11.phx.gbl...
> I have uninstalled and re-installed an application that uses MSDE on one
of
> our workstations. Before uninstalling the application I copied the .mdf
and
> .ldf files to a new location. I now need to restore the databases that are
> associated with this application using the .mdf and .ldf files I saved. I
> also need to verify the initial configuration (data and log files
> names/paths)
> I initially tried to detach the database, copy the backup files to the
> MSSQL\Data folder and then reattach the database. This worked except that
> the database came back in a "read-only" mode. I then opened the properties
> of the database and tried to uncheck the "Read-only" option in the
> properties. When I tried to save the new settings I received a message
that
> stated "Device activation error".
> Can anyone tell me how I can:
> 1) Verify the configuration of the database that was installed by the
> application I installed.
> 2) Rebuild this database using the .mdf and .ldf files?
> Thanks for any input.
> Nancy
>
|||Hi Greg,
Thanks for the solution. That worked perfectly!!!!
Nancy
"Greg Low [MVP]" <greglow@.lowell.com.au> wrote in message
news:OHp7LaFgEHA.384@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Hi Nancy,
> Sounds like you're basically on the right track. Is there any chance the
> files were copied in from a CD or something and actually are read-only?
> If you attach read-only mdf & ldf files, the database comes up in a
> read-only mode.
> HTH,
> --
> Greg Low [MVP]
> MSDE Manager SQL Tools
> www.whitebearconsulting.com
> "Nancy Kafer" <nkafer@.homesteaderslife.com> wrote in message
> news:OBnN12BgEHA.3428@.TK2MSFTNGP11.phx.gbl...
> of
> and
are[vbcol=seagreen]
I[vbcol=seagreen]
that[vbcol=seagreen]
properties
> that
>