Disk Space

  • I tried moving the files to a different folder assuming that if the database file is in use it will not move and the rest will move so that i can cleanup that folder later but what i observed is though the database is not existing in the sql server db list still i cant move the file, it says file is in use and can not be moved. How is that possible?

    thanks

  • 2nd instance of sql server...

    file not release by sql server (reboot will fix)

    crappy bugs in some versions of windows like XP

    file in use by AV or backup software.

  • there is no other instance and also we reboot every weekend.

    is there a way i could find the program that is using that file.

    I do have litespeed but the database list is same as i have in sql server, is there any other program in litespeed uses that.

    thanks

  • Do you have ntfs permissions to delete those files?

  • yes i do have permission to delete the files, why?

  • I still cant figure out how would i determine which process is using the mdf files though the database is not existing.

    Also how can i find if there any other instances running the same database

    thanks

  • For the instances, just go tothe services panel in Administrative tools.

    See if you have multiple verions of the same sql service... that's a tell of multiple instances.

    Also see if the drive is shared and see if someone else could be using that file (very longshot here).

  • I checked again, there is no other SQL server running and the drive is also not shared, what else i can check.

    I also tried attaching that file to the server but it failed giving an error

    " CREATE File encountered operating system error 5(Access is denied) while attempting to open the physical file. (MS SQl Server Error:5123)

  • Mike Levan (2/17/2009)


    I tried moving the files to a different folder assuming that if the database file is in use it will not move and the rest will move so that i can cleanup that folder later but what i observed is though the database is not existing in the sql server db list still i cant move the file, it says file is in use and can not be moved. How is that possible?

    thanks

    Are you sure those files aren't part of a live database ? Sometime the names get mixed up over time from various restores. For instance you might have a database named "Sales_DB_Test" but the actual mdf might be "Sales_DB_Development.mdf".

  • I understand what you say... but is there a way in t-sql to list all databases where physical file names are not matching with the database name or vise versa can we pull the database name with the help of mdf or ldf file.

    thanks

  • Maybe you already did something like this but as the earlier post suggested, run:

    exec sp_MSforeachdb 'Select ''?'' as DB_Name, * from ?.dbo.Sysfiles'

    output to text, not grid, then search for the character string that matches the locked file name.

  • There are also non-SQL product that use .MDF file extensions. Do you have some other product installed ?

    http://filext.com/alphalist.php?extstart=%5EM

  • how can i output the result into text file?

  • I was just suggesting you output the results into a text window instead of a grid, then you can more easily search:

    "Query" -> "Results To" -> "Results to text". Then use "Find Replace" from the "Edit" menu.

    There are various ways to save to a text file:

    "Results to File"

    "Results to text" then copy-paste

    "Results to grid", then click the upper left corner of your results and choose "Save Results as" to get a .csv file Also, Use Tools -> Options -> Results if you want column headers.

  • I dont see that file name to any of the existing databases on the server.

Viewing 15 posts - 16 through 30 (of 30 total)

You must be logged in to reply to this topic. Login to reply