SQL Server Database Recovery

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

I would greatly appreciate some help as I am not an experienced developer, I work solo, and have no peers to help me out.

I had a major HDD failure on my NT machine. I know that I should not have been developing in a single phase environment, but the outcome of my crash is that I now have a .dat file which contains my stored procedures and data, and a brand new NT machine with a fresh SQL Server 6.5 installation.

I need to recover my database.

I presume that the process would start with the REINIT and REFIT commands (???). I do not have any backups, nor do I have any information about the device size (which is required for REINIT).

Am I on the right track???

Can I simply calculate the number of 2K segments from the physical size of the device???

How would I go about recovering my device and database from this .dat file???

-- Anonymous, July 27, 1998

Answers

Re: SQL Server Database Recovery

David,

If the .dat file includes all the data and log for a database, you are on the right track with DISK REINIT and DISK REFIT. These are both documented in the SQL Server Books Online.

The other approach that has worked for me to copy all databases from one server to another (countless times - I used it as a way to replicate a data warehouse) has been to copy all the *.DAT files from one server to another. (Your note doesn't specifically say, but if you have all the *.DAT files your recovery chances are very good.) For this to work, the MASTER.DAT file that you will be replacing on the new server must be in the same location (directory) as it was on the old server. The slight defect here is that both SQL servers will think that their server name as listed in, I think, the sysservers table is the name of the old server. This will only be a problem if you intend to replicate between the old server and the new server.

Let me know if this advice is on the right track,

Eric

-- Anonymous, July 30, 1998


Moderation questions? read the FAQ