Click to See Complete Forum and Search --> : Closing an mdf - anyone know what these are?


Brad Jones
June 15th, 2009, 03:34 PM
Okay, I wasn't sure where to post this, so I picked general developer.

I've done something that has put a database onto my computer that is open and used. The date on the files get updated when I reboot, but otherwise they are simply there and I can't do anything with them because they are open. The files are:

SiteTracking.mdf
SiteTracking_log.ldf

I don't know/remember what I did, so I don't know if these are important. Can't figure out how to open and look at these. Because they are "in use", Windows (XP in this case) won't let me screw with the files either.

Anyone know anything about these?

Brad!

Arjay
June 15th, 2009, 04:16 PM
These are MS SQL database files.

Open SQL Management Studio, expand the Databases node, right click on the [presumably] SiteTracker database and the choose properties.

From there click on the 'Files' node and look to the right under 'Database Files' listview. You should see these file names listed in the 'File Name' column.

Note: these files could be connected to a SQL Express database. If you don't have SQL Management Studio, you can shutdown the MSSQL service to access these files.

[Edit] If you don't need these files, you can open SQL Management studio and delete the database.

dglienna
June 15th, 2009, 08:53 PM
The offending file is the SiteTracking_log.ldf file, which is a LOCK. Boot into safe mode, and delete it. If it is there, the DB won't open

Brad Jones
June 15th, 2009, 08:56 PM
Thanks guys.

The file didn't wouldn't open in SQL Server either due to it being in use. I didn't want to have to reboot into safe mode, but that seems to be my only option. I was hoping someone would know what they were used for. I guess I should be able to tell once I shut it down and take a look at its contents :).

Brad!

Arjay
June 15th, 2009, 08:59 PM
Are you sure David? It looks like a SQL log file to me.

dglienna
June 16th, 2009, 02:38 AM
I presumed that the db wouldn't be attached in safe mode...

Just searched and found this:

dettach the database
delete ldf
attache mdf again

for safety reasons take a backup of you database before dettching


I guess you could move the file rather than delete it