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?
ruud00000Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
the_b1ackfoxConnect With a Mentor Commented:
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...  
0
 
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...
0
 
ruud00000Author Commented:
Sorry I have to go now, be back in 2,5 hours

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SireesConnect With a Mentor Commented:
Do you have the .mdf files? If so, you can attach the database using sp_attach_single_file_db.

Check this  http://msdn2.microsoft.com/en-us/library/ms174385.aspx
0
 
the_b1ackfoxCommented:
Check your trash can first, just in case
0
 
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)
------------------------------
ADDITIONAL INFORMATION:
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?
0
 
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...
0
 
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...
0
 
David ToddConnect With a Mentor Senior DBACommented:
Hi,

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.

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

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

HTH
  David
0
 
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?

0
 
ruud00000Author Commented:
Thanks for teh support, I'll open another question for the ReportServer thing.
0
All Courses

From novice to tech pro — start learning today.