Desperately trying to restore database! 
Author Message
 Desperately trying to restore database!

I had a crash that deleted everything except the database files,
MyData.DAT and MyLog.DAT
I've reinstalled SQL Server and I'm trying to recreate my database using
the two files I have left. It looks like there is no direct way to
import my old files into the new installation.

I've created two new devices, same name and size as the original ones.
I've created a new database, with Data and Log on the two new devices.
I've created a backup device for the new database and use it to backup
Data and Log. After this, I delete the new database in order to use the
backup device to restore it. (If I don't do this, and I simply copy the
old files over the new ones, the database will be marked as "suspect"
and prevent me from restoring)

Now I close SQL Server, close SQL Services and manually copy my old
files over the new ones.
I restart the services and reopen the Enterprise Manager. The way I
figure it, if I create now a new database For Load, I should be able to
use the old file for restore. But what happens, even though I create it
for Load (using the same Data and Log devices) it REWRITES the two (old)
files with new, useless information. So when I use the backup device, I
get nothing but a generic database.

I found a bit of code that gets rid of the "suspect" mark, in the first
scenario. It goes like:
      use master
      go
      sp_configure "allow updates", 1
      reconfigure with override
      go
      update sysdatabases
      set status = status - 256
      where name = "MyDatabase"
      and status & 256 = 256
      go
      sp_configure "allow updates", 0
      reconfigure
      go

This way I get rid of "suspect" but instead, I get "recovering", so the
database is still inaccessible.

I'm beginning to think it's imposible to do this type of restore, but
this would be insane!

Please help!

Ion



Fri, 24 Nov 2000 03:00:00 GMT
 Desperately trying to restore database!

Ion,

You are approaching the problem the wrong way (as far as I can understand).

If you don't have a backup (dump) of the database, use DISK REINIT and DISK
REFIT to use your old database device files.
--
Tibor Karaszi
MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB

Quote:

>I had a crash that deleted everything except the database files,
>MyData.DAT and MyLog.DAT
>I've reinstalled SQL Server and I'm trying to recreate my database using
>the two files I have left. It looks like there is no direct way to
>import my old files into the new installation.

>I've created two new devices, same name and size as the original ones.
>I've created a new database, with Data and Log on the two new devices.
>I've created a backup device for the new database and use it to backup
>Data and Log. After this, I delete the new database in order to use the
>backup device to restore it. (If I don't do this, and I simply copy the
>old files over the new ones, the database will be marked as "suspect"
>and prevent me from restoring)

>Now I close SQL Server, close SQL Services and manually copy my old
>files over the new ones.
>I restart the services and reopen the Enterprise Manager. The way I
>figure it, if I create now a new database For Load, I should be able to
>use the old file for restore. But what happens, even though I create it
>for Load (using the same Data and Log devices) it REWRITES the two (old)
>files with new, useless information. So when I use the backup device, I
>get nothing but a generic database.

>I found a bit of code that gets rid of the "suspect" mark, in the first
>scenario. It goes like:
>      use master
>      go
>      sp_configure "allow updates", 1
>      reconfigure with override
>      go
>      update sysdatabases
>      set status = status - 256
>      where name = "MyDatabase"
>      and status & 256 = 256
>      go
>      sp_configure "allow updates", 0
>      reconfigure
>      go

>This way I get rid of "suspect" but instead, I get "recovering", so the
>database is still inaccessible.

>I'm beginning to think it's imposible to do this type of restore, but
>this would be insane!

>Please help!

>Ion



Sat, 25 Nov 2000 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Desperately trying to restore database!

2. Desperately trying to restore database!

3. Desperately trying to restore database!

4. Desperately trying to restore database!

5. Trying to restore master database

6. Error 603 when trying to restore a SQL 6.5 database

7. HELP. Trying to restore database

8. Error whilst trying to restore a database

9. Database in use message when trying to restore

10. Error when trying to restore a database

11. Please help - Keep getting authentication failure when trying to restore database

12. FIXED: Please help - Keep getting authentication failure when trying to restore database


 
Powered by phpBB® Forum Software