Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
malletts
Starting Member
16 Posts |
Posted - 2005-04-14 : 13:41:56
|
| hi,is it possible to restore a database using only the log and data files? (mdf and ldf files)? The latest database backup i have is much older than the current database and i would lose most of my data if i have to restore from this.. |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-04-14 : 13:49:44
|
| how did you get the mdf and ldf files? did you copy them while the datasebase was online? or was the database shutdown properly when you copied the files? you didn't by chance use sp_detach_db did you? If you copied the files while the databsase was down (and hopefully shutdown properly) or if you used sp_detach_db you can bring your database back online with an sp_attach_db command. look it up in books online.if you copied the datafiles while your database was hot, then you are SOL.-ec |
 |
|
|
jason
Posting Yak Master
164 Posts |
Posted - 2005-04-14 : 16:02:39
|
| Forgive the confusion, but if you have the MDF and LDF, why are you restoring?As eyechart mentioned you can reattach the DB if it is healthy. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-04-15 : 02:00:33
|
| i think he wants to restore the database to a period of time and he only has the last copied mdf and ldf filesjust pressing the issue, do you have some backups of your database?try to attach the old database on a new database or another server and copy whatever you need to copy from there--------------------keeping it simple... |
 |
|
|
malletts
Starting Member
16 Posts |
Posted - 2005-04-15 : 06:20:23
|
| thanks all for the info,database won't start up properly now but im fairly sure it was shut down properly (so hopefully the mdf and ldf files aren't 'hot)im getting a 1067 error when trying to start the SQL service on the machine it is currently running on. My last 'good' backup was a few months ago - hence the need to look at using mdf and ldf files.The error logs are pointing to error 823, severity 24, state 6 errorwhich i know is using an I/O, hardware error but only message im getting in error logs is 'Unable to dump stack exception' - looks like a possible memory problem. We are looking at re-installing and trying to restore the database - nightmare. Any other advice gratefully receivedthanks,Stephen |
 |
|
|
jason
Posting Yak Master
164 Posts |
Posted - 2005-04-15 : 11:07:16
|
| Yes, that error normally indicates a serious problem. Make sure you OS and SQL instance are fully up to date with patches and service packs. Was there an I/O problem (drive failure, power failure, disk space, etc.) that you are aware of? Does SQL server bring the database online? |
 |
|
|
Wanderer
Master Smack Fu Yak Hacker
1168 Posts |
Posted - 2005-04-15 : 11:16:47
|
| The best bit of advice is unfortunately way too late - i.e. Have a good backup strategy and test your backups. I assume that the last good backup was an ad hoc thing, and you have no schedule, or do you mean that the last good backup is the last backup before whatever went wrong? If it is the later, then you would have to use it, surely?from the sounds of things, I would guess you could use the .mdf and .ldf on a seperate SQL server, and start them up (check BOL for SP_Attach_DB) ... if you have a problem with that with the .ldf file, you still may have a chance, using sp_attach_single_file_db and the .mdf fileBest of luck!*##* *##* *##* *##* Chaos, Disorder and Panic ... my work is done here! |
 |
|
|
|
|
|
|
|