Best Practice for full backup and transaction log truncation

  • anbu678@gmail.com wrote:

    I would like to understand how to create auto job to take the full backup, transaction backup + truncating the log files(without making the database to simple recovery mode and truncating)

    If your backup works well there is no need to truncate logfiles anyway.

  • Dummy  Reply to force page 2 to display. This "Post 16" bug is STILL not fixed. Going on 2 years. Sigh....

    • This reply was modified 8 months, 3 weeks ago by  homebrew01.
    • This reply was modified 8 months, 3 weeks ago by  homebrew01.
    • This reply was modified 8 months, 3 weeks ago by  homebrew01.
    • This reply was modified 8 months, 3 weeks ago by  homebrew01.
  • While not clear, it seems as though you have a database in FULL recovery which has not had a log back in 3 or 4 years. The log file must be enormous! As you obviously do not understand how SQL Server works, I suggest you try the following on a test system first:

    1. Set the database to SIMPLE recovery.
    2. Shrink the log file.
    3. Set the log file to a sensible size.
    4. Make the log growth setting sensible.
    5. Set the database to FULL recovery
    6. Do a FULL backup of the database.
    7. Start doing log backups at a sensible interval which is normally every 5 minutes up to every hour. This will not shrink the log file but it will allow the space to be re-used so ideally the log file should not grow.

    Details on sensible log file settings can be found here:

    https://www.sqlshack.com/sql-server-transaction-log-administration-best-practices/

    I would be inclined to automate the backups with Ola Hallengren's Maintenance Solution

     

    • This reply was modified 8 months, 3 weeks ago by  Ken McKelvey.

Viewing 3 posts - 16 through 17 (of 17 total)

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