databases gone after deleting .log.ldf files

I deleted .log.ldf files of my crm database aswell as of my reportserver database in iorder to make space on the harddisk, thinking these are 'just' log files, but now the whole databsese appear to be gone (though the .mdf files are actually still there).

Have I been VERY stupid?

How to correct, if at all?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Well, for starters, I am sure that there is more space on the server now...   Tell me you you have been making backups of the database through the maintenance plan...  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ruud00000Author Commented:
Yes space is good now...
Last backup from sunday, however there's certainly not a whole .ldf file in there, I can tell from the size of it. Tell me what you want to know about the backup...
ruud00000Author Commented:
Sorry I have to go now, be back in 2,5 hours

The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Do you have the .mdf files? If so, you can attach the database using sp_attach_single_file_db.

Check this
Check your trash can first, just in case
ruud00000Author Commented:
How to do that attach correctly?
When I go to SQL Server Managament Studio I right click on node Dtabases and then choose 'Attach'. Then I choose the mdf file from within the SQL server directory. However then I get the message that the file is in use:

TITLE: Microsoft SQL Server Management Studio
Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
CREATE FILE encountered operating system error 32(  Het proces heeft geen toegang tot het bestand omdat het door een ander  proces wordt gebruikt.) while attempting to open or create the physical file 'D:\Microsoft SQL Server\MSSQL\Data\_t_Computerhuys_MSCRM.mdf'. (Microsoft SQL Server, Error: 5123)

Ok so when I take the database off line, then I can continue but encounter the message 'Cannot attach database with the same name as an existing database  (Microsoft.SqlServer.Smo).
How to deal with that (I can simply delete the database node however I'm a bit frightened to make things worse...). Should I do that?
ruud00000Author Commented:
To be more specific, I can choose for 'Detach'  for the database. Then it asks
- Drop connections?
- Update Statistics?
- Keep Full Text Catalogs
By default the last one is checked on, the first two not. Should i kep it that way or change?
The fourth column states 'Status', showing the value 'ready'.
Fifth column ('Message') shows no value (empty).

As I understand from the hep text there I should probably check 'Updates statistics' and leave the rest as it is. Is it useful / safe to generate a script file of the detach first?

That is as far as I dare go now, I'll wait for your further instructions...
ruud00000Author Commented:
Oh, as to the trash can, I emptied that because the issue was insufficient disk space during installation of Windows updates which I rather didn't stop / undo.

So most likely even file recovery will fail...
David ToddSenior DBACommented:

I suspect that your files have autoclose set to true - is a default setting for SQL Express. Once things are back to normal, try changing this to false.

I'd start with making a copy of the mdf file, and seeing if you can attach just the .mdf file.

sp_attach_db 'MyNewDatabase', 'path-and-filename-of-.mdf'

SQL should create an empty .ldf in the default log directory.

ruud00000Author Commented:
I made an axtra copy of the .mdf files.
Now I chose to do a restore from the backup. That way i miss one day's transactions but I can live with that. Also I did a restore for the sharepoint database (of which I also deleted the .ldf file earlier on). Both restores where succesfull, so that's that ...

However I also need to do this for the ReportServer2005.mdf file of which I also deleted the .ldf file (that's the third and last one i deleted...).
This doesn't work out well however. The restore itself doesn't produce errors however something seems to go wrong when I try to open the reportserver now. First it reports that 'ReportServerTempDB' is off-line (rsRPCError). That is correct, but I have that database off'-line ever since I updated from SQL2000 to SQL2005 and it worked very well without it ever since. What's strange is that it wants to go there now. Then when i take it online, I get the message 'invalid column name 'Version' (rsRPCError).

What goes wrong here? How to correct?

ruud00000Author Commented:
Thanks for teh support, I'll open another question for the ReportServer thing.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Enterprise Software

From novice to tech pro — start learning today.