SQL Server 2005 - Backup, Integrity Check and Index Optimization

  • After a nice conversation with Ola I think I understand his concept about the script and the reasons for the logic in some points. It does make sense and if you wanted to add notifications to certain aspects it would be easy to modify.

    In my opinion it would depend on what you are comfortable with as far as relying on the script to make the correct decision depending on the situation or if you would like to be involved when something unplanned occurs so you can investigate.

    Overall I can't believe he did such a nice job with the script and I look forward to trying to use if all works out.

    Lee

  • I have been using this solution quite some time now, its super fantastic.

    Regards,

    Anish

  • This is a fantastic set of scripts. Thanks to Ola Hallengren for them!

    I do have one question, though. I have tried setting the CleanupTime for the backup script to 24 (for 24 hours), yet the server is leaving 2 days' worth of backup files on the server. Should it not leave only 1 copy? Should I set the CleanupTime to 23 (or 25?) hours to leave only 1 day's backup on the server for each database? Sorry if I'm missing something obvious.

    Thanks in advance for any help.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • I calculate the cleanup time before I start backing up the database. The reason for that is to protect against a scenario where you delete a backup that you have just performed. Please send me a mail (http://ola.hallengren.com/contact.html) if you are interested in more details on this.

    Another thing is that you may have variations in the time when the backup finishes.

    Because of these things you need to set the CleanupTime to 23 or 22 hours in your case.

    Ola Hallengren

    http://ola.hallengren.com

  • Ola Hallengren (6/11/2013)


    I calculate the cleanup time before I start backing up the database. The reason for that is to protect against a scenario where you delete a backup that you have just performed. Please send me a mail (http://ola.hallengren.com/contact.html) if you are interested in more details on this.

    Another thing is that you may have variations in the time when the backup finishes.

    Because of these things you need to set the CleanupTime to 23 or 22 hours in your case.

    Ola Hallengren

    http://ola.hallengren.com

    Many thanks, Ola. Setting the time to 23 hours seems to have worked. The backup job in question takes about 30 minutes, but that may have been enough time with the 24 setting to prevent deleting the older backup.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Just to say thanks for this script. It's been a couple of months that I've been using it on our many productions DB for index, stats, DBCC maintenance and it works great. I also like how much it is versatile and the logs.txt it makes!

    :w00t:

  • Thank you for the scripts.

    In the database integrity script, my script keeps failing, i did some research but i couldn't find anything online.

    sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -Q "EXECUTE Management.dbo.DatabaseIntegrityCheck @databases = 'ALL_Databases', @CheckCommands = 'CHECKDB', @Execute = 'Y', @LogToTable = 'Y',@IncludeReadOnly ='Y',@PhysicalOnly='Y'" -b

    Error:

    Executed as user: Mydomain\User. The process could not be created for step 1 of job 0x29F90DA62C665F4EA2E83934C9DB33D7 (reason: The parameter is incorrect). The step failed.

    What am i missing here?

  • After exchanging few emails with Ola, it is working now. It was a stupid mistake, in the job step the word sqlcmd should be in the first line, i had it on 3rd line 😛 .

  • DBconsistency check script has been working great. Hats off to you :).

    I would like to make few recommendations, i feel there is a basic feature missing, script should be able to execute from where it stopped. I am imagining if this scripts stops on my 8 TB databases, and if i restart it again it would be a disaster for me 🙁 . This is what it is holding me up from deploying in production. For sure your script is very smart, it would be helpful if there are some detail comments 🙂 because i tend to review every script before i execute it. Thanks

  • Thanks for the script.

  • Ola Hallengren (4/22/2008)


    The background for the design decision to execute all commands through a CommandExecute stored procedure is that I would like to have a consistent error handling and logging. Information about all commands are logged with start time, command text, command output and end time.

    Good explanation, thanks.

Viewing 11 posts - 31 through 40 (of 40 total)

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