September 6, 2010 at 9:56 pm
I am trying to shrink a datafile with dbcc option to gain some disk space, but its not working, running indefinitely. Any guess why its not performing.
Thanks
Vivek
September 6, 2010 at 10:40 pm
Why are you trying to shrink data file ..it can leads to fragmentation i.e poor index selection.
instead you can go for log shrinking
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
September 6, 2010 at 10:44 pm
Anyways ,,if you still want to shrink data file ..you can use the TRUNCATE_ONLY option in DBCC shrinkfile
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
September 6, 2010 at 10:47 pm
:-)No option working. Have tried everything.
September 6, 2010 at 10:54 pm
Try with DBCC shrinkdatabase ...and if it still doesnt work ..take a full backup and then try shrinkdatabase
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
September 6, 2010 at 11:11 pm
Try increasing the allocated size of your 1st datafile.
September 6, 2010 at 11:31 pm
As C_C_ said increase the size of your datafile lets say by 10 MB. Instead of releasing the entire space at once try and shrink the file in smaller chunks for eg. release 100 MB in one go and so on till you get yourself the desired amount of free space. This way your shrink operation will be faster
September 6, 2010 at 11:44 pm
Shrink database didn't work. I have tried it before. Also, increasing the size and then shrinking is not sufficing the requirement too.
Vivek
September 6, 2010 at 11:46 pm
Are you shrinking in smaller chunks?
September 6, 2010 at 11:53 pm
Yes and in multiple of 8, but no luck.
September 6, 2010 at 11:56 pm
Are you getting error or is it just not completing. Try and see if something is blocking your process. If not then there could be many user connections against the database. Try shrinking the files when connections are at a minimum.
September 7, 2010 at 12:04 am
- what kind of size are we talking about (current , target) ?
- how long did you wait for it to complete ?
- check (b)locking when you run dbcc shrinkfile ...
- are other users connected to that database ?
- how often do you run dbcc checkdb ?
- did you start with a full backup ?
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
September 7, 2010 at 12:10 am
Its just not completing. No blockings, no user connection even.
September 7, 2010 at 12:22 am
How much time are you waiting before cancelling it. Sometimes there is too much page arrangements going on inside which can take a lot of time. If there is no blocking then let it run for a while.
September 7, 2010 at 12:32 am
How much free space is in the database files ?
What command did you run ?
How long did it run ? Did you cancel it ? I had to shrink a large db file (300 G file in 1.2 Tb db) once and it took 24+ hours
Do you really need to shrink it ?
Viewing 15 posts - 1 through 15 (of 60 total)
You must be logged in to reply to this topic. Login to reply