June 8, 2011 at 6:46 am
Hey here is a question for you is there a way to have sql server let go of a data file thats been dropped WITHOUT RESTARTING THE SEVRER?
June 8, 2011 at 6:48 am
I'm not sure what you mean by "let go of".
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 8, 2011 at 6:50 am
I have a data file to a database that has been dropped. But it still excist on the file system and can not be deleted because it is still open by sql server?
June 8, 2011 at 6:54 am
if sqlserver is running and the database is open, you cannot delete the file on the operating system.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
June 8, 2011 at 6:57 am
There no other way a back door into sql sevrer to have the system let go of a particular file?
June 8, 2011 at 6:59 am
User database or TempDB?
Can you explain the situation you're seeing?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2011 at 7:04 am
Yes, the server had to many tempdb files some where dropped etc.. etc.. then my space was getting a little low and I looked the temp files are still there and being used but any queries I do say they do not excist. There has to be away to eliminate the files without having to restart the server.
June 8, 2011 at 7:11 am
what command did you use to drop the files?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
June 8, 2011 at 7:11 am
That's very likely to require a restart of the SQL Service (not a server restart)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2011 at 7:14 am
How bout this:
sp_attach_single_file_db @dbname= 'databasename', @physname= 'C:\Users\Documents\Databases\databasefile.mdf'
to reattach the file then empty it then detach the file and delete?
June 8, 2011 at 7:16 am
You can't attach or detach TempDB.
Additionally, that attach is to attach the primary file of a database. You can't just attach files to existing databases. Detach detaches the entire database, not a single file (hence why it can'ty be used on TempDB)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2011 at 7:18 am
Yes, but I could do it as a user db, but it does not matter even the OS says that it does not excist yet I see it in the file folder and the size of it. It's almost like it is a ghost file that I can not get rid of.
June 8, 2011 at 7:56 am
Perry Whittle (6/8/2011)
what command did you use to drop the files?
:Whistling:
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
June 8, 2011 at 7:58 am
I used the interface it was easier at the moment GUI>pickfile>removeButton
June 8, 2011 at 8:20 am
Although you have removed the file it cannot be truly dropped until you restart the database, as this is tempdb you must restart the SQL server services (no reboot required)
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 15 posts - 1 through 15 (of 25 total)
You must be logged in to reply to this topic. Login to reply