Shrink Database

  • I have updated and corrected the script and included a create database statement. This does show fragmentation of .39% and 90+% if you run this in a newly created database with the defaults. If you have other objects in the database, it is possible that you will get other values.

    No attempt was made to trick people and in general we look to run questions on systems with basic defaults.

    I will award back points.

  • Nice question, learned a lot today.

  • SanDroid (8/10/2011)


    SQLRNNR (8/10/2011)


    I think this is a great question.

    As would I if the error in the script did not cause the wrong result.

    It seems incorrect to give a point to those that did NOT carefully read and understood what the script was doing.

    But you got more points from complaining then answering the question!

    I try to answer the question without testing the script to see if know the answer, (and to learn) and in this case i answered by experience and got the correct result.

    /HΓ₯kan Winther
    MCITP:Database Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform

  • Don't know that I deserve my point back, but thanks.

    I know that shrinking DB's is generally bad and had initially selected 90%. Then I decided to check my answer (e.g. - 'cheat') and got an error message associated with the create FirstTable statement being included with the GO batch and the fragmentation remained the same. When I "Corrected" the script the Fragmentation only increased to 12.5%. So, I really tricked myself by not trusting my instincts.

  • hakan.winther (8/10/2011)


    SanDroid (8/10/2011)


    SQLRNNR (8/10/2011)


    I think this is a great question.

    As would I if the error in the script did not cause the wrong result.

    It seems incorrect to give a point to those that did NOT carefully read and understood what the script was doing.

    But you got more points from complaining then answering the question!

    I try to answer the question without testing the script to see if know the answer, (and to learn) and in this case i answered by experience and got the correct result.

    FYI: Posting to the Forums does not give your points in the QOTD section. Posting to the Forums also does not affect your QOTD category averages. πŸ˜‰

    I used to only care about the overall score... but then someone pointed out that anybody can make a bunch of Forum posts that may or may not be correct.

  • Steve Jones - SSC Editor (8/10/2011)


    I have updated and corrected the script and included a create database statement. This does show fragmentation of .39% and 90+% if you run this in a newly created database with the defaults. If you have other objects in the database, it is possible that you will get other values.

    No attempt was made to trick people and in general we look to run questions on systems with basic defaults.

    I will award back points.

    Thank you Steve!

    We have had some really neat tricky QOTD lately. Very inventive. The original script posted with this question would be another good one if you could explain what causes the behavior.

  • great question. hope that the lesson isn't lost in all the kerfuffle... πŸ˜€ :hehe:

  • OzYbOi d(-_-)b (8/10/2011)


    great question. hope that the lesson isn't lost in all the kerfuffle... πŸ˜€ :hehe:

    Can we have kerfuffles for breakfast, mummy dear, mummy dear....Wait that's wrong. πŸ˜›

    Anyway, great question. I guessed, thinking since the db was small, that the second choice would be the most likely. I too had no idea shrinking caused that much of an issue. Interesting to note that it's listed as a best practice in MSDN to turn autoshrink off. If that's the case, then why even offer it as an option?

  • Good question.

    I thought about it for a while - and remembered previous discussions on SQLCentral about what a total disaster shrink is (unless you immediately follow it be reubuilding everything in sight) and picked the over 90 option.

    Tom

  • OzYbOi d(-_-)b (8/10/2011)


    great question. hope that the lesson isn't lost in all the kerfuffle... πŸ˜€ :hehe:

    I agree with you! There are so many databases with performance issues and if some of the issues can be solved this easy, then we can focus on more complex issues.

    On the other hand, you get a lot of happy clients when you can help them this easy. πŸ™‚

    /HΓ₯kan Winther
    MCITP:Database Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform

  • SanDroid (8/10/2011)


    hakan.winther (8/10/2011)


    SanDroid (8/10/2011)


    SQLRNNR (8/10/2011)


    I think this is a great question.

    As would I if the error in the script did not cause the wrong result.

    It seems incorrect to give a point to those that did NOT carefully read and understood what the script was doing.

    But you got more points from complaining then answering the question!

    I try to answer the question without testing the script to see if know the answer, (and to learn) and in this case i answered by experience and got the correct result.

    FYI: Posting to the Forums does not give your points in the QOTD section. Posting to the Forums also does not affect your QOTD category averages. πŸ˜‰

    I used to only care about the overall score... but then someone pointed out that anybody can make a bunch of Forum posts that may or may not be correct.

    You are right about the "importance" of the points, but personally I don't do it for the points or the right to brag about them. On the other hand, I am only at position 115 so my score doesn't show up on the score board. I do it to check my knowledge and to learn more.

    I do care about the point that I earn by helping others at ask.sqlservercentral.com and I think that it is more important points because you really make a difference by helping others. And I think that it's worth bragging about, but maybe its because I am at the 10:th on the "reputation" board. πŸ™‚

    /HΓ₯kan Winther
    MCITP:Database Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform

  • Great question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • very nice question!!! thanks!!!

    Living and learning!!!


    [font="Times New Roman"]rfr.ferrari[/font]
    DBA - SQL Server 2008
    MCITP | MCTS

    remember is live or suffer twice!
    the period you fastest growing is the most difficult period of your life!
  • hakan.winther (8/11/2011)


    SanDroid (8/10/2011)


    hakan.winther (8/10/2011)


    SanDroid (8/10/2011)


    SQLRNNR (8/10/2011)


    I think this is a great question.

    As would I if the error in the script did not cause the wrong result.

    It seems incorrect to give a point to those that did NOT carefully read and understood what the script was doing.

    But you got more points from complaining then answering the question!

    I try to answer the question without testing the script to see if know the answer, (and to learn) and in this case i answered by experience and got the correct result.

    FYI: Posting to the Forums does not give your points in the QOTD section. Posting to the Forums also does not affect your QOTD category averages. πŸ˜‰

    I used to only care about the overall score... but then someone pointed out that anybody can make a bunch of Forum posts that may or may not be correct.

    You are right about the "importance" of the points, but personally I don't do it for the points or the right to brag about them. On the other hand, I am only at position 115 so my score doesn't show up on the score board. I do it to check my knowledge and to learn more.

    I do care about the point that I earn by helping others at ask.sqlservercentral.com and I think that it is more important points because you really make a difference by helping others. And I think that it's worth bragging about, but maybe its because I am at the 10:th on the "reputation" board. πŸ™‚

    Learning and helping others is very important. I am only a Microsoft Certified Trainer and Red Cross Volunteer. When teaching classes I do not give students labs or tests with scripts that give the wrong results. I expect the same in other forums that are open to discussion.

  • SanDroid (8/11/2011)


    Learning and helping others is very important. I am only a Microsoft Certified Trainer and Red Cross Volunteer. When teaching classes I do not give students labs or tests with scripts that give the wrong results. I expect the same in other forums that are open to discussion.

    SanDroid, right or wrong in your analysis of the issue... a few things.

    1) A difference between:

    Microsoft Certified Trainer (Paid) and Red Cross Volunteer (Certified if doing training)

    QOTD submitter: Unpaid, uncertified, and trying to simply be helpful.

    2) A diatribe vs. a discussion

    You're becoming an embarassment to the SQL Community if they come to these boards, at the level of CELKO. You're already a running joke. Any question that comes out here that has any slightly off item you go into full-on rant mode. On your resume, do you list '18th place in QOTD's on SQL Server'? No? Then back off. Present your point, sure, but if you think there's humor or interest in your belligerant attitude, there isn't. Put your e-peen back in your pants, there's better ways to make your point then being an ***.

    3) Yes, you're right.

    I'm not saying you're not. There was a mistake in the script. Yes, there are circumstances where 'it depends'. In general these questions aren't meant to be run, though the script is there so we can understand it. It's to show you the question and for your brain to answer it, not your computer. Sure, I've gone back and run the scripts after the fact too, to see what was going on. If it adds to your knowledge, the QOTD did what it was meant to. 10 points here or there WILL NOT MATTER when you're dead, stop giving yourself a heart attack. Bring it up, make your point, and (I don't believe I'm the one saying this) learn some tact.

    It's getting to the point that people are actually worried about submitting QOTDs because of reactions like yours. Chill dude.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing 15 posts - 31 through 45 (of 71 total)

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