December 16, 2008 at 3:30 pm
I was getting rid of a 150 GB log file using the following process:
detach the database
rename the log file
re-attach the database without the log file
Everthing was going fine until i realised that i had put the log file on the same drive as the mdf.
When i tried to do the same thing again, to correct my mistake, it will not re-attach without the log file ?
Why did it work the first time and not the second time ?
Thanks
December 16, 2008 at 3:37 pm
what was the attach command you used?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
December 16, 2008 at 3:39 pm
I right clicked on databases and attach was one of the options.
December 16, 2008 at 3:45 pm
You can detach, move the log file, re-attach, pick both files from their respective locations.
December 16, 2008 at 4:00 pm
ifila (12/16/2008)
detach the databaserename the log file
re-attach the database without the log file
Don't do that. Logs are not optional components of the DB and that's a really fast way to stuff a DB up.
If the log has grown excessively, back it up or switch to simple recovery to empty the log if necessary, then issue a shrink file on the log file.
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
December 19, 2008 at 10:18 am
Thanks for the information!
Sometimes it would delete the log file, other times it would not.
So i did a restore and and am back to square one.
I will follow your advice Gail.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply